2013年11月14日 星期四

IP Default Route & IP Default-gateway


Not a dumb question at all.  Here is a doc that actually compares the commands and explains when and why you would use them.

事實上很少人能夠弄懂這兩者間的差異。

Ip default gateway is only used when the switch is in L2. You can use ip route or default-network at L3.

我想以上說明已經夠清楚了。

Use the ip default-gateway command when ip routing is disabled on a Cisco router. 

Use the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to set the gateway of last resort on Cisco routers that have ip routing enabled

info from cisco.com 思科闡述的更加明白。

事實上思科設備把以下兩行指令視為相同:

(ip default route)
ip route 0.0.0.0 0.0.0.0 [next_hop]
(ip default-network)
ip default-network [next_hop]
(L2 Switch)
ip default-gateway [next_hop]

而IPv6的下法則是:

(ip default route)
ip route ::/0 [next_hop]
(ip default-network)
ip default-network [next_hop]
(L2 Switch)
ip default-gateway [next_hop]

記得下一站的目的地位址或網卡出口要下正確。

Ref. Configuring a Gateway of Last Resort Using IP Commands

沒有留言: