Cisco Routing: “ip default network” versus standard static routes

One point of confusion for some CCNA and CCNP candidates is the difference between setting a static default route and using the Cisco routing command ip default network.

At first glance, they seem to do the same. Both configure a destination to send packets to if there is no more specific route in the routing table.

The main difference between these two options is that setting a static default route defines only a default route for the router on which you configure it, while ip default network will distribute the route via the routing protocol.

Let’s look at the routing tables of a hub-and-speak network using the ip default network command. R1 is the pivot point and R2 and R3 are the spokes. They are connected directly via network 172.12.123.0 / 24, and each has a loopback with a 32-bit mask numbered according to the router number (1.1.1.1, etc.) RIP runs on all three routers and the loopbacks advertised.

R1 has another serial interface with the IP address 10.1.1.1 / 24, and this network is marked as a default network with the command ip default network 10.0.0.0. It is not advertised by RIP.

The route protocol will then advertise this route. With RIP, the default network is advertised as 0.0.0.0. (With IGRP, it appears as the network number, but is marked as an IGRP external route.) This route is a candidate default route on R1, as we see with the asterisk along the 10.0.0.0 / 24 network (code ) table removed for short-time):

R1 # show ip route

Gateway or last resort is not set

1.0.0.0/32 is subnetted, 1 subnets

C 1.1.1.1 is directly linked,

Loopback0 R 2.0.0.0/8 [120/1] via 172.12 .123.2, 00:00:11, Serial0

R 3.0.0.0/8 [120/1] via 172.12.123.3, 00:00:11, Serial0

172.12.0.0/16 is variable subnet, 2 subnets, 2 masks

C 172.12. 21.0 / 30 is directly connected, BRI0

C 172.12.123.0/24 is directly connected, Serial0

* 10.0.0.0/24 is subnet, 1

subnet C 10.1.1.0 is directly connected, Serial1

On R2 and R3, a standard RIP route is now seen (deleted again):

R2 # show ip route

code tablesGateway of last resort is 172.12.123.1 to network 0.0.0.0

R 1.0.0.0/8 [120/1] via 172.12.123.1, 00:00:00, Serial0 . 213

2.0.0.0/32 is subnet, 1 subnet

C 2.2.2.2 is directly connected, Loo pback0

R 3.0.0.0/8 [120/2] via 172.12.123.1, 00:00:00, Serial0.213

172.12.0.0/ 16 is variable subnet, 2 subnets, 2 masks

C 172.12.21.0/30 is directly connected, BRI0

C 172.12.123.0/24 is directly connected, Serial0.213

R * 0.0.0.0/0 [120/1] via 172.12.123.1 , 00:00:00, Serial0.213

R3 # show ip route

Gateway of last resort is 172.12.123.1 to network 0.0.0.0

R 1.0.0.0/8 [120/1] via 172.12.123.1, 00:00:27 , Serial0.31

R 2.0.0.0/8 [120/2] via 172.12.123.1, 00: 00: 28, Serial0.31

3.0.0.0/32 is subnet, 1 subnet

C 3.3.3.3 is directly connected,

Loopback0 172.12. 0.0 / 24 is subnet, 1 subnet

C 172.12.123.0 is directly connected, Serial0.31

R * 0.0.0.0/0 [120/1] via 172.12.123.1, 00:00:28, Serial0.31route

And the defaultworks, because we can ping 10.1.1.1 from both R2 and R3. Since they have no other match in their routing tables, they use the default route.

R2 # ping 10.1.1.1Initialization of

Tikom to abort.

Send 5, 100 byte ICMP echoes to 10.1.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), return min / average / maximum = 68/68/68 mssequence

R3 # ping 10.1.1.1

Tap escapeto stop.

Send 5, 100 byte ICMP echoes to 10.1.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), return min / average / maximum = 68/68/68 msstatic

When deciding whether to use a standardroute or a standard network, remember that if you want the routing protocol to to propagate the default route, the ip default network command will do it for you. But if you just want the local router to have the default route, a static IP route is the way to go.