Configuring a gateway of last resort
Here are three commands (all providing the same solution) for adding a gateway of last
resort on the gateway router to the ISP:
Gateway(config)#ip route 0.0.0.0 0.0.0.0 217.124.6.1
Gateway(config)#ip route 0.0.0.0 0.0.0.0 s0/0
Gateway(config)#ip default-network 217.124.6.0
As I said before, all three of these commands would accomplish the goal of setting the gateway
of last resort, but there are some small differences between them. First, the exit interface
solution would be used over the other two solutions because it has an AD of 0. Also, the ip
default-network command would advertise the default network when you configure an IGP
(like RIP) on the router. This is so other routers in your internetwork will receive this route as
a default route automatically.
I’ll discuss one last topic before moving on to dynamic routing. If you have the routing table
output as shown here, what happens if the router receives a packet from 10.1.6.100 destined
for host 10.1.8.5?
Corp#sh ip route
[output cut]
Gateway of last resort is 10.1.5.5 to network 0.0.0.0
R 10.1.3.0 [120/1] via 101.2.2, 00:00:00, Serial 0/0
C 10.1.2.0 is directly connected, Serial0/0
C 10.1.5.0 is directly connected, Serial0/1
C 10.1.6.0 is directly connected, Fastethernet0/0
R* 0.0.0.0/0 [120/0] via 10.1.5.5, 00:00:00 Serial 0/1
This is a tad different from what I’ve shown you up until now because the default route is
listed as R*, which means it’s a RIP-injected route. This is because someone configured the
ip default-network command on a remote router as well as configuring RIP, causing RIP
to advertise this route through the internetwork as a default route. Since the destination
address is 10.1.8.5 and there is no route to network 10.1.8.0, the router would use the default
route and send the packet out serial 0/1.