Documente Academic
Documente Profesional
Documente Cultură
1.
NET3008
Advanced Routing
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 1
Functions of a Router
Why Routing?
Routing allows a packet to be sent to a different network
than the packet's
packet s source network (i
(i.e.
e it facilitates packet
movement between broadcast domains).
192.168.1.0/24 192.168.2.0/24
f0/0 f0/1
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 2
Functions of a Router
Routers Choose Best Paths
Routers have full information about the networks to which their
interfaces are connected … these are called directly-connected
networks.
In addition, routers learn about remote networks through
administrator configured static routes and dynamic routing
administrator-configured
protocols.
A router's routing table stores the information about all the
networks
t k it knows
k (connected
( t d or remote),
t ) including
i l di where
h a packet
k t
must be sent to reach each destination.
Upon receiving a packet, a router examines the destination IP
address and consults its routing table to determine the best path
along which to send it – must determine the next hop IP address
where the packet must be sent and the egress interface to use.
• If no entry in the routing table matches the packet's destination IP,
the packet is dropped.
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 3
Functions of a Router
Quick Review – What's in a Layer?
Layer 1 is used to send bits between L2 devices: serves to
propagate signals representing information bits over the network
medium, possibly through other intermediary L1 devices (e.g.
hubs, repeaters).
Layer 2 is used to send frames between L3 devices: serves to
deliver frames directly from one L3 node to another, within a single
network or broadcast domain, possibly through other intermediary
L2 devices
de ices (e.g.
(e g sswitches).
itches) L2 uses
ses L1 to stream the bits making
up the frame.
Layer 3 serves to map out how a packet must hop from one
network
t k to
t another
th ini order
d tot reach
h that
th t packet’s
k t’ destination
d ti ti
network.
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 6
Switching Packets between Networks
Example - Routed Packet Delivery
Packet
Encapsulation / Decapsulation
at each Hop
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 7
Switching Packets between Networks
1.
1 IP Host Wants to Send a Packet
Because destination IP 192
192.168.4.10
168 4 10 is on a
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 8
Switching Packets between Networks
2.
2 Packet Routing In
In-transit
transit
R1 R2
Flag-Addr
7E-0F
destination IP 192.168.4.10
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 12
The Routing Table
Routing
R ti T Table
bl Entries
E ti
Interpreting the entries in the routing table.
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 13
The Routing Table
Routing
R ti T Table
bl Sources
S
The show ip route command displays the contents of the
routing
ti ttable:
bl
Local route interfaces - Added to the routing table
when an interface is configured and active
active.
(only displayed in IOS 15 or newer)
Directly
y connected interfaces - Added to the routing
g
table when an interface is configured and active.
Static routes - Added when a route is manually
configured and the exit interface is active.
Dynamic routing protocol - Added when routes are
learned via a routing protocol (e
(e.g.
g RIP
RIP, EIGRP
EIGRP, OSPF)
OSPF).
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 14
Path Determination
Administrative
Ad i i t ti Distance
Di t
If multiple paths to a destination become known to a router, the path
installed in the routing table is the one with the lowest Administrative
Distance (AD).
• AD is another attribute of a route, stored alongside the obvious
aspects such as
as, network prefix
prefix, mask and exit interface.
interface
• AD is a measure of route reliability. A lower AD is interpreted as
being more reliable and therefore, preferred – this should be easy
to remember because naturally
naturally, we prefer shorter distances.
distances
• A route's AD value is assigned depending upon the source from
which it was learned – for example:
• A route known because of a directly connected network is completely
reliable (since the router is connected to it), so its AD is 0.
• Next, is a static route which by default is assigned an AD of 1. This is
based on the presumption the administrator has configured the route
due to specific knowledge and/or requirements.
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 15
Path Determination
Default Administrative
D f lt Ad i i t ti Distances
Di t
Aside from Connected and Static routes, the only other sources of
routes are those learned through dynamic routing protocols. This is a
table of Default Administrative Distances set by IOS:
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 17
Path Determination
What's
Wh t' Better
B tt (a.k.a
( k Lower
L Cost)?
C t)?
Consider this topology.
Using RIP based on hop count, the lowest metric would be 1 hop from R2 across
the serial link direct to R3.
U
Using
i OSPF b based d on cost,
t it would
ld d
depend
d upon th
the b
bandwidth
d idth off th
the lilinks.
k B Butt
given the vast difference between Ethernet and serial speeds, it would most likely
be computed as being lower cost to go from R2 to R1 to R4, then R3.
A default route is used when the routing table does not contain a
specific path matching the packet's destination address.
We can config
configure
re a static default
defa lt route
ro te by
b specif
specifying
ing a net
network-
ork
prefix and mask of all zeroes … 0.0.0.0 (known as quad-zero)
ip route 0.0.0.0 0.0.0.0 {exit-intf [next-hop-ip] | next-hop-ip}
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 22
Statically Learned Routes
Static
St ti RRoute
t with
ith Exit
E it Interface
I t f
A static route can be configured with exit interface, next-hop IP or both:
ip route network
network-prefix
prefix mask {exit
{exit-intf
intf [next
[next-hop-ip]
hop ip] | next
next-hop-ip}
hop ip}
Consider static routes from LabC (n.b. LabD will NAT 192.168.5.x to ISP):
S0/0/0
DCE Internet
.1 ISP
.2 192.0.2.0/30
S0/2/0
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 26
Dynamic Routing Protocols
IPv4 Routing
IP 4 R ti P Protocols
t l
Cisco ISR routers can support a variety of dynamic IPv4
routing protocols including:
EIGRP – Enhanced Interior Gateway Routing Protocol
OSPF – Open
O Shortest
Sh P
Path
h Fi
First
IS-IS – Intermediate System-to-Intermediate System
(pronounced: "I"
I "S"
S to "I"
I "S")
S)
RIP – Routing Information Protocol (v2 is classless)
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 27
Dynamic Routing Protocols
IPv6 Routing
IP 6 R ti P Protocols
t l
Cisco ISR routers can support a variety of dynamic IPv6
routing protocols including:
RIPng – RIP next generation
OSPFv3
OSPF 3 (can also route IPv4 via address family feature)
EIGRP for IPv6
MP-BGP4 – Multi-Protocol Border Gateway Protocol v4
• able to carry BGP routes and also payloads for other routing
protocols via address family feature
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 28
Dynamic versus Static Routing
Difference
Diff iin F
Fundamental
d t l Strategy
St t
Static Routing pushes traffic:
Each administratively
administratively-configured
configured static route identifies a
reachable network and an exit interface and/or next-hop through
which that destination can be reached.
This effectively pushes traffic out of that router.
router
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 31
Configure IPv4 Summary Routes
Calculate
C l l t Summary
S Route
R t
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 32
Configure IPv4 Summary Routes
CIDR S
Specification
ifi ti
Each CIDR prefix/mask represents a block of IP addresses,
specifying where the block starts, starts and how far it extends.
extends
• The block starts at the IP value given by prefix with mask significant bits … that is,
all bits to the right of the first mask bits are not fixed - can be either 0 or 1.
172 20
172.20. 0.
0 0 10101100 00010100 00000000 00000000
172.20.0.0/16
/
. . . . . .
172.20.255.255 10101100 00010100 11111111 11111111
172.21. 0. 0 10101100 00010101 00000000 00000000 172.20.0.0/15
. . . . . .
172.21.255.255 10101100 00010101 11111111 11111111
172.22. 0. 0 10101100 00010110 00000000 00000000 172.20.0.0/14
. . . . . .
172.22.255.255 10101100 00010110 11111111 11111111
172.23. 0. 0 10101100 00010111 00000000 00000000
. . . . . .
172.23.255.255 10101100 00010111 11111111 11111111
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 34
Configure IPv4 Summary Routes
Static
St ti Summary
S Route
R t - Example
E l 2
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 35
Configure IPv4 Summary Routes
Summary
S Route
R t C Calculation
l l ti
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 36
Configure IPv4 Summary Routes
Configure
C fi Summary
S Route
R t - Example
E l 2
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 38
Configure IPv6 Summary Routes
Calculating
C l l ti IPv6
IP 6 Summary
S Addresses
Add
Follow these steps to summarize IPv6 networks into a single IPv6
prefix:
fi
Step 1. List the network addresses (prefixes) and identify the part
where the addresses differ.
Step 2. Expand the IPv6 prefix if it is abbreviated.
Step 3. Convert the differing section from hex to binary.
Step 4. Count the number of matching bits from the left to determine
the prefix-length for the summary route.
Step 5. Copy the matching bits and then add zero bits to determine
the summarized network address (prefix).
Step 6. Convert the binary section back to hex.
Step 7. Append the prefix of the summary route (result of Step 4).
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 39
Configure IPv6 Summary Routes
IPv6
IP 6 Summarization
S i ti Example
E l
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 40
Configure IPv6 Summary Routes
IPv6
IP 6 Summary
S Calculations
C l l ti
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 41
Configure IPv6 Summary Routes
IPv6
IP 6 Summary
S Configuration
C fi ti
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 42
Accessing the Internet
Connecting
C ti tto th
the Internet
I t t
Customer ISP
Internal Static summary route
Provider
customer s0/0/1 networks
s0/0/0
networks CE PE & Internet
Static default route
205.211.48.0 to 205.211.63.0
(Supernet of 16 consecutive public class C's registered to Algonquin College)
Except
cep for
o larger
a ge aand
d more
o e co
complex
p e dep
deployments,
oy e s, there’s
e e s typically
yp ca y NO
O
dynamic routing configured between the Customer AS and the ISP
(Internet Service Provider) AS.
The Customer Edge (CE) router has a static default route configured
towards the Provider Edge (PE) router.
CE(config)#ip route 0.0.0.0 0.0.0.0 s0/0/0
ISP’s
ISP s PE has a static route to the CE for the CIDR block representing
ALL public IP addresses registered to the Customer AS.
PE(config)#ip route 205.211.48.0 255.255.240.0 s0/0/1
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 43
Accessing the Internet
Propagating
P ti Default
D f lt Route
R t
The static default route just described, gives Internet reachability
t the
to th CE router.
t But
B t what
h t about
b t networks
t k deep
d inside
i id ththe AS?
For the entire AS to reach the Internet, all internal routers behind
g default traffic to the edge.
CE will need a route directing g
To do this, we configure CE (the Border Router) to dynamically
propagate a default route into the whole routing domain.
• This pulls all Internet-bound traffic (packets destined for external
addresses) originating in the native AS, to CE at the border, who will
then route that traffic towards the provider network (following the
static default route configured on CE)
CE).
Supposing this enterprise is using RIP as its IGP, this command
advertises a quad-zero default to CE’s routing peers:
CE(config-router)#default-information originate
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 44
Accessing the Internet
Routing
R ti IInternet
t t Traffic
T ffi – Outbound
O tb d
Customer ISP Internet Src: 205.211.49.5
Dest: 1.1.1.1
Src: 205.211.49.5
Dest: 1.1.1.1 1 2 3
s0/0/1
CE s0/0/0 PE Rx
R1
s0/0/1
CE s0/0/0 PE Rx
R1
172.16.19.0/24
R1#sh ip route
172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
S 172.16.0.0/16 is directly connected, Null0
R 172.16.16.0/24 [120/1] via 172.16.20.5, 00:00:24, Serial0/0/0
R 172.16.17.0/24 [120/1] via 172.16.20.5, 00:00:24, Serial0/0/0
R 172.16.19.0/24 [120/1] via 172.16.20.5, 00:00:24, Serial0/0/0
C 172 16 20 0/24 is
172.16.20.0/24 i directly
di tl connected,
t d Serial0/0/0
S i l0/0/0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
R 192.168.2.0/24 [120/1] via 192.168.1.5, 00:00:07, FastEthernet0/0
R* 0.0.0.0/0 [120/2] via 192.168.1.5, 00:00:07, FastEthernet0/0/0
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 50
Summary Routes – Revisited
Packet
P k tM Movementt
At neighbour Rx, the summary route appears as:
R 172 16 0 0/16 [120/1] via 192.168.1.1,
172.16.0.0/16 192 168 1 1 00:00:23,
00:00:23 FastEthernet0/1
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 52
Summary Routes – Revisited
Manual
M l Summary
S Example
E l
We will now revisit the Enterprise Example used earlier to
demonstrate a manually configured RIP summary route at
R1 without using “redistribute” (not in Packet Tracer!):
R1(config)#int f0/0
R1(config-if)#ip summary-addr
R1(config if)#ip summary addr rip 172.16.0.0 255.255.0.0
172 16 0 0 255 255 0 0 172.16.0.0/16
172.16.20.0/24
Unlike the previous method 172.16.16.0/24
f0/0
R1
of redistributing g a static discard: 172 16 17 0/24
172.16.17.0/24
s0/0/0
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 54
Summary Routes – Revisited
Summary
S Routing
R ti Provides
P id Stability
St bilit
A dynamically advertised summary route will continue to
be advertised while at least one of the contained routes
remains valid.
• Consider our previous example ...
R1(config)#int f0/0
R1(config-if)#ip summary-addr rip 172.16.0.0 255.255.0.0 172.16.0.0/16
... the 172.16.0.0/16 summary will 172.16.16.0/24
172.16.20.0/24
continue
ti to
t be
b advertised
d ti d as long
l as R1 f0/0
s0/0/0
one or more of the "172.16" /24 172.16.17.0/24
subnets in the cloud stays up.
172.16.19.0/24
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 55
17F NET3008 © 2007 – 2017, David Bray, Algonquin College, Cisco Systems, Inc. All rights reserved. 56