Exp - No. 6 Static Route

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Exp.No.5 Computer Network Lab Asst.Lect.

Hiba Hussein

Exp.No.6
Static Route
Theory
Static routing occurs when you manually add routes in each router's routing
table. Static routes are usually manually configured by a network administrator by
adding in entries into a routing table. Every router makes its decision alone, based
on the information it has in its own routing table. The fact that one router has
certain information in its routing table does not mean that other routers have the
same information. Routing information about a path from one network to another
does not provide routing information about the reverse, or return, path.

Procedure:
1. Connect network shown in the figure below:

2. Configure interfaces and assign addresses, as follows:


Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname RT1
Exp.No.5 Computer Network Lab Asst.Lect. Hiba Hussein

RT1(config)#int fa0/1
RT1(config-if)#ip add 192.168.1.1 255.255.255.0
RT1(config-if)#no shut
RT1(config-if)#exit
RT1(config)#int s0/0
RT1(config-if)#ip add 192.168.2.1 255.255.255.0
RT1(config-if)#no shut
RT1(config-if)#^Z
RT1#
RT1#show ip route
Codes: C - connected, S - static, I - IGRP, 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 0.0.0.0 to network 0.0.0.0

C 192.168.1.0/24 is directly connected, FastEthernet0/0


C 192.168.2.0/24 is directly connected, Serial0/0/0
RT1#
show ip route command is used to display the routing table. Initially, the routing
table is empty if no interfaces have been configured.

3. Repeat step 2 for RT2 and RT3.


4. Configure static route
The command ip route is used for configuring a static route using the following
syntax:

Router(config)# ip route network-address subnet-mask {ip-address | exit


interface}

network-address: Destination network address of the remote network.


subnet-mask: Subnet mask of the remote network
One or both of the following parameters must also be used: ip-address: Next-hop
router’s IP address. (Does not have to be next-hop.), exit-interface: Outgoing or
exit interface.
To Configure static route in RT1,
RT1(config)# ip route 192.168.3.0 255.255.255.0 se0/0
Exp.No.5 Computer Network Lab Asst.Lect. Hiba Hussein

RT1(config)# ip route 192.168.4.0 255.255.255.0 se0/0


RT1(config)# ip route 192.168.5.0 255.255.255.0 se0/0

5. Repeat step 4 for other routers.


6. Verify the static route configuration on RT1, RT2 and RT3 with the show
running-config and show ip route command.
RT1# show running-config

RT1# show ip route


Codes: C - connected, S - static, I - IGRP, 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 0.0.0.0 to network 0.0.0.0

C 192.168.1.0/24 is directly connected, FastEthernet0/0


C 192.168.2.0/24 is directly connected, Serial0/0/0
S 192.168.3.0/24 [1/0] via 192.168.2.2
S 192.168.4.0/24 [1/0] via 192.168.2.2
S 192.168.5.0/24 [1/0] via 192.168.2.2

7. Test connectivity

Test connectivity by pinging from each host to the other host at another
network.

Default Static Route


A default route is used to represent all routes with zero or no bits matching. When
there are no routes that have a more specific match, the default route will be a
match. A default static route is a route that will match all packets.

1. Configuring a Default Static Route

Router(config)# ip route 0.0.0.0 0.0.0.0 [exit-interface| ip-address ]


Exp.No.5 Computer Network Lab Asst.Lect. Hiba Hussein

2. Configuring a Default Static Route for the network above

a. Delete individual static routes.


R1(config)# no ip route 192.168.3.0 255.255.255.0 serial0/0/0
R1(config)# no ip route 192.168.4.0 255.255.255.0 serial 0/0/0
R1(config)# no ip route 192.168.5.0 255.255.255.0 serial 0/0/0

b. Configure single default static route.

R1(config)# ip route 0.0.0.0 0.0.0.0 serial0/0/0

3. Repeat step 2(a and b) for other routers

4. Verify the default static route configuration on RT1, RT2 and RT3 with the
show ip
route command.
RT1# show ip route
Codes: C - connected, S - static, I - IGRP, 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 0.0.0.0 to network 0.0.0.0

C 192.168.1.0/24 is directly connected, FastEthernet0/0


C 192.168.2.0/24 is directly connected, Serial0/0/0
S* 0.0.0.0/0 is directly connected, Serial0/0/0

You might also like