In this post I will create a default route and distribute it using RIP.
Below is a diagram of the network I'll be using in this post.
Currently on R0 I have no default route.
R0
R0#sh ip route
Gateway of last resort is not set
R 192.168.4.0/24 [120/1] via 192.168.1.2, 00:00:08, Serial1/0
C 192.168.1.0/24 is directly connected, Serial1/0
R 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:08, Serial1/0
R 192.168.3.0/24 [120/1] via 192.168.1.2, 00:00:08, Serial1/0
I will configured interface S1/1 on R0 as being the interface that is connected to my ISP.
R0(config)#interface serial 1/1
R0(config-if)#ip address 195.211.64.2 255.255.255.252
R0(config-if)#no keepalive
R0(config-if)#no shut
R0(config-if)#end
I also check the default route on R3
R3
R3#sh ip route
Gateway of last resort is not set
C 192.168.4.0/24 is directly connected, Loopback0
R 192.168.1.0/24 [120/1] via 192.168.3.1, 00:00:25, Ethernet0/0
R 192.168.2.0/24 [120/1] via 192.168.3.1, 00:00:25, Ethernet0/0
C 192.168.3.0/24 is directly connected, Ethernet0/0
Back on R0 I create a default route pointing to Serial 1/1 and distribute it with RIP.
R0
R0(config)#ip route 0.0.0.0 0.0.0.0 s1/1
R0(config)#router rip
R0(config-router)#default-information originate
R0(config-router)#end
Checking my route table I can see I have a gateway of last resort set and a default route is set.
R0#sh ip route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
R 192.168.4.0/24 [120/1] via 192.168.1.2, 00:00:15, Serial1/0
195.211.64.0/30 is subnetted, 1 subnets
C 195.211.64.0 is directly connected, Serial1/1
C 192.168.1.0/24 is directly connected, Serial1/0
R 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:16, Serial1/0
R 192.168.3.0/24 [120/1] via 192.168.1.2, 00:00:16, Serial1/0
S* 0.0.0.0/0 is directly connected, Serial1/1
On R3 I check the routing table to make sure it has a default route set and it is sending the packets out the right interface.
R3
R3#sh ip route
Gateway of last resort is 192.168.3.1 to network 0.0.0.0
C 192.168.4.0/24 is directly connected, Loopback0
R 192.168.1.0/24 [120/1] via 192.168.3.1, 00:00:26, Ethernet0/0
R 192.168.2.0/24 [120/1] via 192.168.3.1, 00:00:26, Ethernet0/0
C 192.168.3.0/24 is directly connected, Ethernet0/0
R* 0.0.0.0/0 [120/3] via 192.168.3.1, 00:00:26, Ethernet0/0