Static Route Configuration Example:


Network Topology:






Static Route= Destination Address+ Destination Subnet mask+Exit interface Address.

Router1 Configuration:


--- System Configuration Dialog ---

Continue with configuration dialog? [yes/no]: n


Press RETURN to get started!


Router1>en
Router1#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#int GigabitEthernet 0/1
Router1(config-if)#Ip address 192.168.10.1 255.255.255.0
Router1(config-if)#no shutdown
Router1(config)#int GigabitEthernet 0/0
Router1(config-if)#Ip address 192.168.30.1 255.255.255.0
Router1(config-if)#no shutdown

Static Route Configuration:

Router1(config)#Ip route 192.168.20.0 255.255.255.0 192.168.10.2
Router1(config)#Ip route 192.168.50.0 255.255.255.0 192.168.10.2

Router2 Configuration:


--- System Configuration Dialog ---

Continue with configuration dialog? [yes/no]: n


Press RETURN to get started!



Router2>en
Router2#Config t
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#int gigabitEthernet 0/0
Router2(config-if)#ip address 192.168.10.2 255.255.255.0
Router2(config-if)#no shutdown
Router2(config)#int gigabitEthernet 0/1
Router2(config-if)#ip address 192.168.20.2 255.255.255.0
Router2(config-if)#no shutdown


Static Route Configuration:

Router2(config)#ip route 192.168.30.0 255.255.255.0 192.168.10.1
Router2(config)#ip route 192.168.50.0 255.255.255.0 192.168.20.1


Router3 Configuration:


  --- System Configuration Dialog ---

Continue with configuration dialog? [yes/no]: n


Press RETURN to get started!



Router3>
Router3>en
Router3#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router3(config)#Int gigabitEthernet 0/0
Router3(config-if)#Ip address 192.168.20.1 255.255.255.0
Router3(config-if)#no shutdown
Router3(config)#Int gigabitEthernet 0/0
Router3(config-if)#Int gigabitEthernet 0/1
Router3(config-if)#Ip address 192.168.50.1 255.255.255.0
Router3(config-if)#no shutdown

Router3#
%SYS-5-CONFIG_I: Configured from console by console


Static Route Configuration:

Router(config)#Ip route 192.168.10.0 255.255.255.0 192.168.20.2
Router(config)#Ip route 192.168.30.0 255.255.255.0 192.168.20.2

Routing Table entries:

Router3#sh ip route

Gateway of last resort is not set

S 192.168.10.0/24 [1/0] via 192.168.20.2
192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.20.0/24 is directly connected, GigabitEthernet0/0
L 192.168.20.1/32 is directly connected, GigabitEthernet0/0
S 192.168.30.0/24 [1/0] via 192.168.20.2
192.168.50.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.50.0/24 is directly connected, GigabitEthernet0/1

L 192.168.50.1/32 is directly connected, GigabitEthernet0/1

Ping Response:

Router3#ping 192.168.10.2

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

Router3#ping 192.168.30.1

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


2 comments: