Routing and Routing Protocols - Introduction
What is Routing?
To route, a router needs to do the following:
Know the destination address
Identify the sources it can learn from Discover possible routes Select the best route
Maintain and verify routing information
What is Routing? (Cont)
Routers must learn destinations that are not directly connected.
Directly Connected Networks and the IP Routing Table
192.168.2.0/24 e0 RTA s0 172.16.0.0/16 s0 RTB 192.168.1.0/24 .1 s1 10.0.0.0/8 RTC e0
RTA#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, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set
RTA#
The Routing Table prior to any interface configuration The command to view the IP Routing table is: (priviledge or user mode)
Router# show ip route
Currently, no routes in the routing table.
Directly Connected Networks and the IP Routing Table
192.168.2.0/24 RTA e0
172.16.0.0/16 s0 s0
RTB
192.168.1.0/24 s1
10.0.0.0/8 RTC e0
RTA(config)#inter e 0 RTA(config-if)#ip add 192.168.2.1 255.255.255.0 RTA(config-if)#no shutdown RTA#show ip route Codes: C - connected,.. <Other codes and gateway information omitted> C 192.168.2.0/24 is directly connected, Ethernet0 RTA #
Adding an ipaddress/mask to an interface tells the router that it is a member, Directly Connected" to that network just like when a host computer is configured with an ip address/mask. Notice the route is shown with the subnet mask and the exit-interface. Dont forget the no shutdown Dont forget the interface must be in up and up
Directly Connected Networks and the IP Routing Table
192.168.2.0 /24 RTA e0 172.16.0.0/16 s0 s0 192.168.1.0/24 RTB 10.0.0.0/ 8 e0
s1
RTC
RTA#show ip route
Codes: C - connected,.. <Other codes and gateway information omitted> C C 172.16.0.0/16 is directly connected, Serial0 192.168.2.0/24 is directly connected, Ethernet0
RTB#show ip route Codes: C - connected,.. <Other codes and gateway information omitted> C C 172.16.0.0/16 is directly connected, Serial0 192.168.1.0/24 is directly connected, Serial1
RTC#show ip route Codes: C - connected,.. <Other codes and gateway information omitted> C C 10.0.0.0/8 is directly connected, Ethernet0 192.168.1.0/24 is directly connected, Serial1
Directly Connected Networks and the IP Routing Table
192.168.2.0 /24 RTA e0 .1
172.16.0.0/16 s0 .1 .1 s0 .1 .2
192.168.1.0/24 RTB .2
s1
RTC
10.1.0.0/ 16 e0
RTA#show ip route C C !!!!! 172.16.0.0/16 is directly connected, Serial0 192.168.2.0/24 is directly connected, Ethernet0
RTA#ping 172.16.0.1
RTA#ping 172.16.0.2
!!!!! RTA#ping 192.168.1.1 .....
RTA#ping 192.168.1.2
..... RTA#ping 10.1.0.1 .....
Question: If RTA can ping RTBs 172.16.0.2 interface why cant it ping RTBs 192.168.1.1 interface?
Answer: Routers can only reach networks known about in its own
routing table.
Routing and Routing Protocols Static Routing
Routing Types
Static Route Operation
Hoboken#show ip route Codes: C - connected, S - static, S C 172.16.1.0/24 [1/0] is directly connected, Serial0 192.168.2.0/24 is directly connected, Ethernet0
ip route command
RTR(config)# ip route prefix mask{address|
interface} [distance] prefix IP route prefix for the destination. mask Prefix mask for the destination. IP address of the next hopthat can be used to reach address that network.
interface
Network interface to use (exit-interface) distance
(Optional) An administrative distance.
Static Route Operation
If the exit interface (gateway) is down the static route will
not be put in the routing table.
Common uses for Static Routes
Static routes in the real-world
Soon we will learn about dynamic routing protocols (RIP, etc.), where routers can learn automatically about networks, without the manual configuration of static routes. Does this mean that static routes are never used in the real-world? No! Static routes are used in conjunction with dynamic routing protocols. It is common to use a static route where using a dynamic routing protocols would have disadvantages or where it just not needed.
Static Routes
Configured unidirectional static routes to and from a stub network to allow communications to occur.
Static Route Example
This is a unidirectional route. You must have a route configured in the opposite direction. With point-to-point serial links, you can also configure the outgoing interface instead of the next-hop IP address.
Default Routes
This route allows the stub network to reach all known networks beyond router A.
RTB#show iproute Gateway of last resort is 172.16.2.2 to network 0.0.0.0 172.16.0.0/16 is subnetted, 1 subnets C C S* 172.16.1.0/24 is directly connected, Ethernet0 172.16.2.0/24 is directly connected, Serial1 0.0.0.0/0 [1/0] via 172.16.2.2
An Example of static routes
Host 1
Baypointe
Lets configure three static routes on Baypointe using either an intermediateaddress or exit interface:
.1 E0
172.16.1.0/2 4
Hub .1 E0 SanJose1 S0 S1 .2
172.16.2.0/2 4
192.168.1.0/2 4
.1 S0 SanJose2 S0
.1 Baypointe E0 .1
Hub
172.16.3.0/2 4
192.168.2.0/2 4
Hub
Host 2 Host 3 Baypointe(config)# ip route 172.16.1.0 255.255.255.0 192.168.1.2 Baypointe(config)# ip route 172.16.2.0 255.255.255.0 192.168.1.2 Baypointe(config)# ip route 172.16.3.0 255.255.255.0 192.168.1.2
An Example of static routes
Lets configure static routes to R1 can reach network 3.3.3.3/32 of R3
Verify static routes
Ping and Traceroute to troubleshoot