Professional Documents
Culture Documents
Protocol
By
Routing Types
Hoboken#show ip route
Codes: C - connected, S - static,
S
172.16.1.0/24 [1/0] is directly connected, Serial0
C
192.168.2.0/24 is directly connected, Ethernet0
ip route command
RTR(config)# ip route prefix mask {address | interface}
[distance] [tag tag] [permanent]
address
IP address of the next hop that can be used to reach that
network.
tag tag (Optional) Tag value that can be used as a "match" value for
controlling redistribution via route maps. (CCNP Advanced Routing)
Permanent (Optional) Specifies that the route will not be removed, even if
the interface shuts down. (CCNP Advanced Routing)
If the router cannot reach the outgoing interface that is being used in the route, the
route will not be installed in the routing table.
This means if that interface is down, the route will not be placed in the routing table.
6
Administrative Distance
Two choices.
We will see the differences in a moment.
10
11
Static Routing
12
Static Routing
13
Static Routing
192.168.2.0/24
e0
.1
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
Routers do not need to configure static routes for their own directly connected
networks.
We need to configure static routes for networks this router needs to reach.
We will need to configure static routes for the other routers as well, as routing
information about a path from one network to another does not provide routing
information about the reverse, or return path.
Convergence When all the routers in the network (AS) have accurate and consistent
information, so that proper routing and packet forwarding can take place.
Convergence will not happen until all the routers have complete and accurate routing
information, meaning we must configure static routes on all the routers before packets
will be correctly delivered.
14
Static Routing
192.168.2.0/24
e0
.1
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
10.1.0.0/16
s1
s1
.1
.2
RTC
e0
.1
Network/subnet route
Intermediate-Address
(usually next-hop)
RTA#show ip route
Codes: C - connected, S - static,
C
172.16.0.0/16 is directly connected, Serial0
S
192.168.1.0/24 [1/0] via 172.16.0.2
C
192.168.2.0/24 is directly connected, Ethernet0
Static Routing
192.168.2.0/24
e0
.1
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
Administrative Distance This is the trustworthiness of the routing information. The default
administrative distance of static routes is 1.
If the router learns about a route to a network from more than one source, it will install the route
16
with the lower administrative distance in the routing table.
Static Routing
192.168.2.0/24
e0
.1
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
Metric This is the cost of getting to this route, I.e. how far away this network is.
Static routes always show a cost of 0 even if it was configured with the intermediate address is
multiple-hops away.
Static Routing
192.168.2.0/24
e0
.1
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
2
1
RTA#show ip route
Codes: C - connected, S - static,
C
172.16.0.0/16 is directly connected, Serial0
S
192.168.1.0/24 [1/0] via 172.16.0.2
C
192.168.2.0/24 is directly connected, Ethernet0
Recursive Lookup
The router knows it can get to 192.168.1.0/24 network by forwarding the packets to the router at
the ip address of 172.16.0.2
How does the router know how to get to the ip address 172.16.0.2?
It does a recursive lookup first (1) by looking up the 192.168.1.0/24 network and finding it
needs to forward the packet to 172.16.0.2 the router then (2) looks up the 172.16.0.0 network
and sees it can forward it out the interface Serial 0.
18
Static Routing
192.168.2.0/24
e0
.1
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
RTA#debug ip routing
IP routing debugging is on
RTA#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RTA(config)#ip route 192.168.1.0 255.255.255.0 172.16.0.2
05:53:48: RT: add 192.168.1.0/24 via 172.16.0.2, static metric [1/0]
RTA(config)#ip route 10.1.0.0 255.255.0.0 172.16.0.2
05:54:38: RT: add 10.1.0.0/16 via 172.16.0.2, static metric [1/0]
RTA(config)#undebug all
Notice that the static route is entered into the routing table by the routing table process (debug ip routing) with
a metric of 0.
19
Static Routing
192.168.2.0/24
e0
.1
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
20
Static Routing
192.168.2.0/24
e0
.1
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
172.16.0.0/16
RTA
.1
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
2
1
RTA#show ip route
Codes: C - connected, S - static,
C
172.16.0.0/16 is directly connected, Serial0
S
192.168.1.0/24 [1/0] via 172.16.0.2
C
192.168.2.0/24 is directly connected, Ethernet0
Recursive Lookup
The router knows it can get to 192.168.1.0/24 network by forwarding the packets to the router at
the ip address of 172.16.0.2
How does the router know how to get to the ip address 172.16.0.2?
It does a recursive lookup first (1) by looking up the 192.168.1.0/24 network and finding it
needs to forward the packet to 172.16.0.2 the router then (2) looks up the 172.16.0.0 network
and sees it can forward it out the interface Serial 0.
22
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
3
2
1
RTA#show ip route
Codes: C - connected, S - static,
C
172.16.0.0/16 is directly connected, Serial0
S
192.168.1.0/24 [1/0] via 172.16.0.2
S
10.1.0.0/16 [1/0] via 192.168.1.2
C
192.168.2.0/24 is directly connected, Ethernet0
Every route that does not reference an exit-interface must finally be resolved via a
route with an interface descriptor reference in the corresponding path descriptor a
route with an exit-interface.
Static routes cannot be recursively resolved and will not be in the routing table.
Consider these three static routes:
Route1:
Route2:
Route3:
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
RTA#debug ip routing
IP routing debugging is on
RTA#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RTA(config)#ip route 192.168.1.0 255.255.255.0 172.16.0.2
05:53:48: RT: add 192.168.1.0/24 via 172.16.0.2, static metric [1/0]
RTA(config)#ip route 10.1.0.0 255.255.0.0 172.16.0.2
05:54:38: RT: add 10.1.0.0/16 via 172.16.0.2, static metric [1/0]
RTA(config)#undebug all
Notice that the static route is entered into the routing table by the routing table process
(debug ip routing) with a metric of 0.
25
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
172.16.0.0/16
RTA
s0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
2
1
RTA#show ip route
Codes: C - connected, S - static,
C
172.16.0.0/16 is directly connected, Serial0
S
192.168.1.0/24 [1/0] via 172.16.0.2
C
192.168.2.0/24 is directly connected, Ethernet0
172.16.0.0/16
RTA
e1
s0
e0
s0
.1
.2
192.168.1.0/24
RTB
s1
s1
.1
.2
10.1.0.0/16
RTC
e0
.1
Static routes via broadcast links, it is best to use both an exit interface and intermediate
address.
This saves the router from having to do a recursive route lookup for the intermediate
address of 172.16.0.2, knowing the exit interface is Ethernet 0.
28
For point-to-point serial interfaces, the next-hop address in the routing table is never
used by the packet-delivery procedure, so it is not needed. (It could even reference a
bogus IP address.)
Static routes via broadcast networks such as Ethernet
It is best to configure static routes with both the next-hop address and the exitinterface.
Using only an intermediate address
What about static routes referencing only intermediate network address? In short, try
to avoid using them. The reason is that these static routes are not bound to any
interface, rely on intermediate address resolvability, and thus converge more slowly.
They can also create unexpected routing loops. Alex Zinin, Cisco IP Routing
NOTE: Most of our examples in this course do not follow either of these rules-of-thumb
but you may want to use it on your network.
29
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.
30
ISP
10.1.1.1/24
10.1.1.2/24
Cabrillo
College
172.16.0.0/16
Static routes in the real-world (continued)
In the example above, there is only one route, link, between Cabrillo Colleges network and the
ISP.
When there is only a single route to a network, this is known as a stub network.
It is very common for the ISP to have a static route pointing to its customers networks, in this
case Cabrillo College.
31
10.1.1.1/24
10.1.1.2/24
Cabrillo
College
ip route 0.0.0.0 0.0.0.0 10.1.1.1
172.16.0.0/16
What about Cabrillo College and sending packets to the ISP packets going to the Internet?
It is also common for customer networks to use a special kind of static route, known as a default static route.
Of course we will examine this later throughout the rest of this course, but for now we specify the network and
mask as 0.0.0.0 0.0.0.0 (pronounced quad-zero).
This tells the router to forward all packets to this next-hop address (or exit interface) that do not have an explicit
route in the routing table.
32
10.1.1.1/24
10.1.1.2/24
Cabrillo
College
ip route 0.0.0.0 0.0.0.0 10.1.1.1
172.16.0.0/16
RTB#show ip route
Gateway of last resort is 10.1.1.1 to network 0.0.0.0
C
172.16.0.0/16 is directly connected, Ethernet0
10.0.0.0/24 is subnetted, 1 subnets
C
10.1.1.0 is directly connected, Serial1
S*
0.0.0.0/0 [1/0] via 10.1.1.1
Any packets not matching the routes 172.16.0.0/16 or 10.1.1.0/24 are sent to the router 10.1.1.1 33
Summarizing static
routes
Host 1
172.16.1.0/24
Hub
.1 E0
172.16.0.0/24
172.16.2.0/24
.2
SanJose1
S0
S1
.2
192.168.1.0/24
.1
SanJose2
E0
.1
S0
S0
.1
.1
172.16.3.0/24
Hub
Baypointe
E0
192.168.2.0/24
Hub
34
Host 2
Host 3
172.16.1.0/24
Hub
.1 E0
172.16.0.0/24
172.16.2.0/24
.2
SanJose1
S0
S1
.2
192.168.1.0/24
.1
SanJose2
E0
.1
S0
S0
.1
.1
172.16.3.0/24
Hub
Baypointe
E0
192.168.2.0/24
Hub
Host 2
Host 3
Baypointe
Lets configure three static routes on Baypointe using either an intermediate-address or exit interface:
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
35
Summarized route:
Baypointe(config)# ip route 172.16.0.0 255.255.0.0 192.168.1.2
36
172.16.1.0/24
172.16.0.0/24
Hub
.1 E0
.2
SanJose1
S0
S1
.2
192.168.1.0/24
172.16.2.0/24
.1
.1
S0
S0
SanJose2
E0
.1
.1
172.16.3.0/24
Baypointe
Baypointe
E0
192.168.2.0/24
Hub
Hub
Host 2
Host 3
Summarized route:
Baypointe(config)# ip route 172.16.0.0 255.255.0.0 192.168.1.2
Advantages:
Subnets can be added and deleted on 172.16.0.0 network without having to change static
route on Baypointe router.
37
38
39
Thanks
Say Connected for more chapters on Routing
Follow us on
Google+