Wednesday, June 11, 2014

Configuring IPv4 Static and Default Routes



Static route will declared by next hop address or exit interface. In R1 added three networks using exit interface.

R1#conf t
R1(config)#ip route 172.31.0.0 255.255.255.0 serial 0/0/0
R1(config)#ip route 172.31.1.196 255.255.255.252 serial 0/0/0
R1(config)#ip route 172.31.1.128 255.255.255.192 serial 0/0/0
R1(config)#exit

After declare static route, using below command we can check the static route assign by this router.

R1#show ip route
Gateway of last resort is not set
     172.31.0.0/16 is variably subnetted, 7 subnets, 5 masks
S       172.31.0.0/24 is directly connected, Serial0/0/0
C       172.31.1.0/25 is directly connected, GigabitEthernet0/0
L       172.31.1.1/32 is directly connected, GigabitEthernet0/0
S       172.31.1.128/26 is directly connected, Serial0/0/0
C       172.31.1.192/30 is directly connected, Serial0/0/0
L       172.31.1.194/32 is directly connected, Serial0/0/0
S       172.31.1.196/30 is directly connected, Serial0/0/0


Here we will declared static route at R2 by using both options (next hop address or exit interface).

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#ip route 172.31.1.0 255.255.255.128 serial 0/0/0
R2(config)#ip route 172.31.1.128 255.255.255.192 172.31.1.198
R2(config)#exit
R2#sh ip route
Gateway of last resort is not set
     172.31.0.0/16 is variably subnetted, 8 subnets, 5 masks
C       172.31.0.0/24 is directly connected, GigabitEthernet0/0
L       172.31.0.1/32 is directly connected, GigabitEthernet0/0
S       172.31.1.0/25 is directly connected, Serial0/0/0
S       172.31.1.128/26 [1/0] via 172.31.1.198
C       172.31.1.192/30 is directly connected, Serial0/0/0
L       172.31.1.193/32 is directly connected, Serial0/0/0
C       172.31.1.196/30 is directly connected, Serial0/0/1
L       172.31.1.197/32 is directly connected, Serial0/0/1

Another way we implemented for R3 by using default route declaration we forwarded all packets to the next hop address or exit interface.

R3#conf t
R3(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0/1
R3(config)#exit
R3#sh ip route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0

     172.31.0.0/16 is variably subnetted, 4 subnets, 3 masks
C       172.31.1.128/26 is directly connected, GigabitEthernet0/0
L       172.31.1.129/32 is directly connected, GigabitEthernet0/0
C       172.31.1.196/30 is directly connected, Serial0/0/1
L       172.31.1.198/32 is directly connected, Serial0/0/1

S*   0.0.0.0/0 is directly connected, Serial0/0/1

No comments:

Post a Comment

Comment