Gateway command No More confusion!

——————————————————-

ip default-gateway (ip routing turned off when used; like windows gateway)

ip default-network 207.134.6.0 (same as below defines gateway of last resort)

ip route 0.0.0.0 0.0.0.0 207.134.6.1(creates gateway of last resort)

read below to know the difference between the last two. There is a big difference.

——————————————————-

Here’s a couple of interesting things I learned too. One was a few months ago, trying to get a Catalyst 4500 to work with the ip default-gateway command. I configured the switch exactly as I thought it need to, but it would not connect to it’s uplink. Finally, after a bit of reading, I found out that theĀ default-gateway command only works on layer 3 switches and routers with the “no ip routing” command. Another thing is the default network command. I’ve never seen it used, so I decided to check Cisco’s site for an explanation of it.

Apparently it’s (almost) the same thing as doing ip route 0.0.0.0 0.0.0.0 (next hop ip). Here’s the difference:

Cisco wrote:
If you use both the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to configure candidate default networks, and the network used by the ip default-network command is known statically, the network defined with the ip default-network command takes precedence and is chosen for the gateway of last resort. Otherwise if the network used by the ip default-network command is derived by a routing protocol, the ip route 0.0.0.0 0.0.0.0 command, which has a lower administrative distance, takes precedence and is chosen for the gateway of last resort.

So in short, if you have ip routing enable, use either ip default-network or ip route 0.0.0.0 0.0.0.0. If you do not have ip routing enable or are working on a pure switch, use ip default-gateway. Interesting stuff.

Edit: Oh yeah, and another difference is how routing protocols treat either

command. It’s detailed in the below link.
Source: http://www.cisco.com/warp/public/105/default.html#ipnetwork

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: