Thursday, February 14, 2008

Issues with the “ip default-network” Command

 

Commonly people run into issues with the ip default-network command putting static routes in their configuration when they select a network that can not be considered as the candidate default network. I’ll show the two common mistakes with this command that causes this to happen.

Inthe scenario below R4 is receiving a subnet of the 10.0.0.0/8 network (10.1.1.0/24) and has the 172.16.1.0/24 network directly attached to it’s E0/0 interface. We can also see that the router does not have any static routes configured.

Rack4R4(config)#do show ip route rip 
10.0.0.0/24 is subnetted, 1 subnetsR10.1.1.0 [120/1] via 172.16.1.7, 00:00:10, Ethernet0/0
Rack4R4(config)#Rack4R4(config)#doshow ip interface brief | exclude unassigned
Interface IP-Address OK? Method Status
ProtocolEthernet0/0172.16.1.4 YES manual up up
Rack4R4(config)#Rack4R4(config)#doshow run | include ip route
Rack4R4(config)#

NowI’ll set the default network to a network that I have a connected route for.

Rack4R4(config)#ip default-network 172.16.1.0 
Rack4R4(config)#do show run | include ip default-networkRack4R4(config)#Rack4R4(config)#do show run | include ip route
ip route 172.16.0.0 255.255.0.0 172.16.1.0Rack4R4(config)#

We can see that the ip default-network command put a static route in the configuration since the network I tried to mark as default was directly connected. Now I’ll try to remove it.

Rack4R4(config)#no ip route 172.16.0.0 255.255.0.0 172.16.1.0 
%No matching route to delete

Andas we can see from the error message the static route wasn’t removed. To remove the static route just do a “no” on the ip default-network command.

Rack4R4(config)#no ip default-network 172.16.1.0 
Rack4R4(config)#do show run | include ip routeRack4R4(config)#

Now we’ll try to set the default network to a subnet of a classful network that we have a route for in the routing table (see above)

Rack4R4(config)#ip default-network 10.1.1.0 
Rack4R4(config)#do show run | include ip default-networkRack4R4(config)#Rack4R4(config)#do show run | include ip route
ip route 10.0.0.0 255.0.0.0 10.1.1.0Rack4R4(config)#

Once again a static route was added and I’ll need to remove it.

Rack4R4(config)#noip default-network 10.1.1.0

In order for the ip default-network command to actually work I’ll need to select a classful network. To do this I summarized the 10.1.1.124/30 to 10.0.0.0/8 on the router that was advertising the /30 to R4.

Rack4R4(config)#do show ip route rip 
R 10.0.0.0/8 [120/1] via 172.16.1.7, 00:00:01, Ethernet0/0Rack4R4(config)#Rack4R4(config)#ip default-network 10.0.0.0
Rack4R4(config)#do show run | include ip default-networkipdefault-network 10.0.0.0
Rack4R4(config)#Rack4R4(config)#doshow run | include ip route
Rack4R4(config)#Rack4R4(config)#doshow ip route | include \*
ia - IS-IS inter area, * - candidate default, U - per-user static routeR*10.0.0.0/8 [120/1] via 172.16.1.7, 00:00:02, Ethernet0/0
Rack4R4(config)#

Aswe can see now the 10.0.0.0/8 is flagged as our candidate default network.

ShareThis