Cisco Routing/Switching – Static & Default Routes

Configure a static, default route on Corporate Router 1 pointing to the ISP. Configure a static default route on Corporate Router 2 pointing to Corporate Router 1 and a static Default Route on Branch Router 1 pointing to Corporate Router 2. 

Using our topology, we need to find a way to make this happen. So lets get stuck in:

First creating our default, static route to our ISP

CO-R1#sh ip int brief
Interface              IP-Address      OK? Method Status                Protocol 
GigabitEthernet0/0     10.1.0.1        YES manual up                    up 
GigabitEthernet0/1     unassigned      YES unset  administratively down down 
GigabitEthernet0/2     unassigned      YES unset  administratively down down 
Serial0/0/0            188.29.163.173  YES manual up                    up 
Serial0/0/1            unassigned      YES unset  administratively down down 
Vlan1                  unassigned      YES unset  administratively down down
CO-R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
CO-R1(config)#ip route 0.0.0.0 0.0.0.0 188.29.163.174
CO-R1(config)#do sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is 188.29.163.174 to network 0.0.0.0

     10.0.0.0/8 is variably subnetted, 4 subnets, 3 masks
C       10.1.0.0/24 is directly connected, GigabitEthernet0/0
L       10.1.0.1/32 is directly connected, GigabitEthernet0/0
R       10.16.1.12/30 [120/1] via 10.1.0.2, 00:00:01, GigabitEthernet0/0
R       10.23.2.0/24 [120/2] via 10.1.0.2, 00:00:01, GigabitEthernet0/0
     188.29.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       188.29.163.168/29 is directly connected, Serial0/0/0
L       188.29.163.173/32 is directly connected, Serial0/0/0
S*   0.0.0.0/0 [1/0] via 188.29.163.174

CO-R1(config)#

As you can see from the lines above we are routing to the next hop in which case is .174 therefore the default route is to 188.29.163.174 to network 0.0.0.0

you can now see the Static route is configured in the sh ip route next to S* as above.

 

As our ISP is a simulated router we are going to add a couple of loopback interfaces so that we can can do some ping testing as if it were a real ISP.

ISP#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
ISP(config)#int l0

ISP(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

ISP(config-if)#ip address 4.2.2.2 255.255.255.255
ISP(config-if)#exit
ISP(config)#int l1

ISP(config-if)#
%LINK-5-CHANGED: Interface Loopback1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up

ISP(config-if)#ip address 8.8.8.8 255.255.255.255
ISP(config-if)#end
ISP#
%SYS-5-CONFIG_I: Configured from console by console

ISP#sh ip int brief
Interface              IP-Address      OK? Method Status                Protocol 
GigabitEthernet0/0     unassigned      YES unset  administratively down down 
GigabitEthernet0/1     unassigned      YES unset  administratively down down 
GigabitEthernet0/2     unassigned      YES unset  administratively down down 
Serial0/0/0            188.29.163.174  YES manual up                    up 
Serial0/0/1            unassigned      YES unset  administratively down down 
Loopback0              4.2.2.2         YES manual up                    up 
Loopback1              8.8.8.8         YES manual up                    up 
Vlan1                  unassigned      YES unset  administratively down down
ISP#

Here we have configured the addresses as loopbacks, if you see the sh ip route below you can see it knows of only the addresses in the routing table:

ISP#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     4.0.0.0/32 is subnetted, 1 subnets
C       4.2.2.2/32 is directly connected, Loopback0
     8.0.0.0/32 is subnetted, 1 subnets
C       8.8.8.8/32 is directly connected, Loopback1
     188.29.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       188.29.163.168/29 is directly connected, Serial0/0/0
L       188.29.163.174/32 is directly connected, Serial0/0/0

ISP#

So if we log back into the Corporate router 1, we should be able to ping out to 8.8.8.8, before NAT is configured this means the ISP will only be able to talk back to the IP 188.29.163.173 on Corporate Router 1

CO-R1#ping 8.8.8.8

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms

CO-R1#ping 4.2.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/6 ms

CO-R1#

If we configure our static route on Corporate Router 2, we should be able to ping the WAN interface talking out to the ISP:

CO-R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
CO-R2(config)#ip route 0.0.0.0 0.0.0.0 10.1.0.1
CO-R2(config)#exit
CO-R2#
%SYS-5-CONFIG_I: Configured from console by console

CO-R2#ping 188.29.163.173

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 188.29.163.173, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/3/15 ms

CO-R2#ping 188.29.163.173

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 188.29.163.173, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/2/6 ms

CO-R2#

and this seems to be working fine via that static route.

Now to add a static route to Branch Router 1 talking to Corporate Router 2

B1-R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
B1-R1(config)#ip route 0.0.0.0 0.0.0.0 10.16.1.13
B1-R1(config)#end
B1-R1#ping 10.16.1.13

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.16.1.13, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/5 ms

B1-R1#ping 10.1.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/13 ms

B1-R1#ping 188.29.163.173

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 188.29.163.173, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/4/12 ms

B1-R1#

So this is now configured and the static route applied, we can now talk all the way up to the WAN interface.

 

A Better Way

If we were to remove the static routes from Corporate Router 2 and Branch Router 1 we could in fact use RIP from the Corporate Router 1 to send the information on the static route it has back to the other routers (That being said you still have RIP configured from the last post)

Cisco Switching/Routing – RIPV2 Routing, Corporate to Branch Office.

CO-R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
CO-R2(config)#no ip route 0.0.0.0 0.0.0.0 10.1.0.1
CO-R2(config)#
B1-R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
B1-R1(config)#no ip route 0.0.0.0 0.0.0.0 10.16.1.13
B1-R1(config)#

Going back to Corporate Router 1 as this still has the Static route configured we are going to use this to talk to the other routers and inform them of this route.

CO-R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
CO-R1(config)#router rip 
CO-R1(config-router)#default
CO-R1(config-router)#default-information orig
CO-R1(config-router)#default-information originate 
CO-R1(config-router)#

This is originating default-information regarding a route it takes in our scenario the default static route:

CO-R2#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is 10.1.0.1 to network 0.0.0.0

     10.0.0.0/8 is variably subnetted, 5 subnets, 3 masks
C       10.1.0.0/24 is directly connected, GigabitEthernet0/0
L       10.1.0.2/32 is directly connected, GigabitEthernet0/0
C       10.16.1.12/30 is directly connected, Serial0/0/0
L       10.16.1.13/32 is directly connected, Serial0/0/0
R       10.23.2.0/24 [120/1] via 10.16.1.14, 00:00:05, Serial0/0/0
R*   0.0.0.0/0 [120/1] via 10.1.0.1, 00:00:20, GigabitEthernet0/0

CO-R2#

As above you can now see an R* which explains the route is via 10.1.0.1 (Corporate Router 1) and is configured on there as a static route. You can also see the same on the branch router too:

B1-R1#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is 10.16.1.13 to network 0.0.0.0

     10.0.0.0/8 is variably subnetted, 5 subnets, 3 masks
R       10.1.0.0/24 [120/1] via 10.16.1.13, 00:00:10, Serial0/0/0
C       10.16.1.12/30 is directly connected, Serial0/0/0
L       10.16.1.14/32 is directly connected, Serial0/0/0
C       10.23.2.0/24 is directly connected, GigabitEthernet0/0
L       10.23.2.1/32 is directly connected, GigabitEthernet0/0
R*   0.0.0.0/0 [120/2] via 10.16.1.13, 00:00:10, Serial0/0/0

B1-R1#

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *