为什么ip default-gateway 172.44.1.1不work但是ip route 0.0.0.0 0.0.0.0 172.44.1.1却能把所有流量正确导向下一跳指定ip?

总而言之就是ip default-gateway只在设备配置了no ip routing时才生效
enable ip routing的情况下ip default-gateway即使配置了也会被忽略

在这里插入图片描述

参考: https://community.cisco.com/t5/switching/ip-default-gateway-problem/td-p/2977086

The reason why you need the “ip route” statement to reach 192.168.20.1 is because you have ip routing enabled, as per the first line of configuration in your post above. We use the ip route command set to tell the switch where to route traffic when ip routing is enabled, as with this enabled the switch essentially then becomes a router. The ip default-gateway command is only used if the device is in a layer 2 state and cannot route itself so it needs to be told its gateway just like a PC does.
In summary:
If ip routing is enabled then the ip default-gateway command is ignored.
If ip routing is disabled then the ip route 0.0.0.0 0.0.0.0 command is not effective.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值