CCNP Enterprise Routing 2022
CCNP Enterprise Routing 2022
E T W O R S
CCNP Enterprise
Advanced Routing
Services
Arranged by:
Eng. AHMED NABIL
Name:
1-Routing principles
2- OSPF in single area
3- OSPF in multiple areas
4- Manipulating Multiple Routing protocols
(Redistribution)
5- Routing updates filters and Route Maps
6- Policy Based Routing (PBR)
7- Border Gateway Protocol (BGP)
8- EIGRP
9- MPLS & MPLS VPN
10-VPN Techologies
11- Network Services
3
Ahmed Nabil
New Cisco
Certifications model
4
Networks overview
5
Ahmed Nabil
6
Ahmed Nabil
TCP/IP Model:
Application Layer protocols:
HTTP, FTP, SMTP, POP3, Telnet, SSH, SNMP, DHCP,
RIP1,RIP2, RIPng, BGP
(notice that some routing protocols are in the application layer as
RIP & BGP), BGP needed the help of TCP that’s why its in that
layer, while RIP was in that layer as an old tradition by the
programmers which was any non primary protocol is an
application). Primary protocols as IP, TCP, UDP,…
7
Ahmed Nabil
•Routing protocol:
-It is a set of rules that define how routing works.
-It is the exchange of information between routers so as
every router can has an overview about the existence or
disappearance of networks
-Its final target is to build a routing table for routers
•Routed protocol :
- It is responsible for sending users data traffic from end
to end by supporting:
1- logical addressing.
2- Encapsulating data from end to end
(end to end delivery)
3- The router will remove the frame header and trailer (switching
function).
4- The router will deliver the packet to the routing process to find
the best path for the packet to reach the destination by
checking the routing table.
5- The routing process will find the best path and deliver the
packet to the switching function again.
6-Switching process will create new frame header and trailer (will
make encapsulation) for the packet based on the O/P
interface defined encapsulation (whether it is Ethernet or
Frame Relay or ATM or PPP,…..)
9
Principles of
Routing Protocols
10
• Routing procedure :
1- Is the protocol stack exist?
That point depend on the IOS supported features (whether desktop features
or enterprise set or service provider set is used)
-Is the Routed protocol S/W exist on the IOS or not
(i.e. do IPX exist (if you need to route IPX packets, IPv6,…. ))
-Is the Routing protocol S/W exist on the IOS or not
(i.e. do IS-IS exist, do BGP exist, ……)
5- The forwarding decisions (information in the routing table) are built from
the exchange of the updates
In general, Cisco routers support the following three primary modes of packet
switching:
-Process switching (normal routing)
-Fast switching
-Cisco Express Forwarding (CEF)
Use
#show ip route
To display the routing table
To enable CEF, use one of the following commands depending on router platform
on global configuration mode or interface mode:(config) or (config-if)# ip cef
(config) or (-if)# ip route-cache cef
R1# show ip cef
Prefix Next Hop Interface
0.0.0.0/0 no route
0.0.0.0/8 drop
0.0.0.0/32 receive
1.1.1.1/32 receive Loopback0
2.2.2.2/32 10.1.1.2 Serial1/0
10.1.1.0/30 attached Serial1/0
10.1.1.0/32 receive Serial1/0
10.1.1.1/32 receive Serial1/0
10.1.1.3/32 receive Serial1/0
127.0.0.0/8 drop
172.16.1.0/24 attached FastEthernet0/0
172.16.1.0/32 receive FastEthernet0/0
172.16.1.1/32 receive FastEthernet0/0
172.16.1.255/32 receive FastEthernet0/0
192.168.1.0/24 10.1.1.2 Serial1/0
224.0.0.0/4 drop
224.0.0.0/24 receive
240.0.0.0/4 drop
255.255.255.255/32 receive
Static RP
Dynamic RP
15
Static Routing
• Characteristics:
1- If only one path to destination is available, you can use
a static routing .
2- No routing traffic overhead.
3- Could be used in slow WAN links.
4- High administration overhead.
17
Default Static Route:
Used to define path to internetworks default Gateway of
last resort
(config)# ip route 0.0.0.0 0.0.0.0 {o/p interface
/ ip address of next hop}
Default Network:
Default Gateway of last resort
IGP / EGP
1- IGP (Interior Gateway Protocol)
• Protocol that works within single AS.
• AS (Autonomous System) is the domain under single
technical administration or in other words that work under
single routing policy
Ex: Rip , OSPF, IS-IS , IGRP , EIGRP.
2- EGP (Exterior Gateway Protocol)
• Protocol that works between different ASs.
Ex: EGP , BGP.
19
Distance Vector / Link State / Hybrid
Distance Vector:
Ex: RIP and IGRP
At start up:
1- Each router collect its directly connected networks.
2- Each router will add these networks to its routing table.
3- Each router will send its full routing table out of all its active
interfaces on broadcast address 255.255.255.255 every
certain period (30sec for RIP, 90 sec for IGRP)
4-Routers receiving updates will use Bellman Ford Algorithm to
calculate table updates
After convergence :
- Only periodic updates is sent every period to indicate any
changes.
At change :
- Triggered update with full routing table is sent.
- Advantages:
1- Simple Implementation and configuration
2- Need low memory (only routing table)
3- Need low CPU (use Bellman Ford algorithm)
- Disadvantages:
1- Slow convergence
2- Classfull
3- High BW utilization during convergence period
4- Susceptible to routing loops
After convergence :
- Periodic updates after long period .
(LSA refreshment)
At change :
1- The router that feels the change will send partial
triggered update.
2- Each router will take a copy of the update then send it to
its neighbors then each router rebuild the tree again.
21
Advantages:
1- Fast convergence
2- Classless
3- Low BW utilization during convergence period (no
periodic
updates)
4- No routing loops
5- Reliable protocol
Disadvantages:
1- Complex Implementation and configuration
2- Need high memory (routing table, neighbor table &
topology database)
3- Need high CPU (use Dijkstra ”SPF” algorithm)
22
• Classfull RP C/C’s:
Classlfull RP does not send the subnet mask in its
updates.
1- Can not support VLSM.
2- Discontiguous networks will make routing problems
3- Auto summarization is made on the discontiguous
network boundary and can never be stopped
Ex: RIPv1 & IGRP
• Classless RP C/C’s:
Classless RP send the subnet mask in its updates.
1- Support VLSM.
2- Support discontiguous networks.
(Auto summarization can be stopped)
3- Support manual
summarization
and CIDR.
Ex: RIPv2, EIGRP, OSPF,
IS-IS & BGP
24
• RIP : (Routing Information Protocol)
- RIP timers:
* Periodic update every 30 sec.
* invalid/hold time is 180 sec (if network not updated for 180
sec, so it is marked as invalid and its route is poisoned).
* flush time 240 sec (route is deleted from all RIP tables after
240 sec).
(config)#router rip
(config)#router rip
(config-router)# version { 1 / 2 }
25
• Configuration:
(config)# router rip
(config-router)# network <direct connected network>
• Network command activates the interfaces to
1) send updates
2) receive updates
3) Advertise routing
entries learned
on that interface
26
Comparing RIPv1 & RIPv2
RIP v.1 RIP v.2
- Classfull - Classless
- Broadcast updates - Multicast updates
(255.255.255.255) (224.0.0.9)
- Metric = hop count - Metric = hop count
(max. =15) (max.=15)
- Admin. Dist. = 120 - Admin. Dist. = 120
- Periodic updates with full routing -Periodic updates with full routing
table every 30sec. table every 30sec.
- Triggered full routing table at -Triggered partial updates (affect
changes part only) at changes
- No authentication. - Support Authentication. (clear
text or MD5)
-Symbol in routing table “R” -Symbol in routing table “R”
-Update cannot contain more than
25 entry, so if more than 25 exist,
so every period more than one
packet is advertised
22 27
Auto and Manual Summarization :
Protocol Auto Can be Manual
summarization disabled summarization
RIP v.1 YES NO NO
IGRP YES NO NO
OSPF NO ----- YES
IS-IS NO ----- YES
RIP v.2 YES YES YES
EIGRP YES YES YES
/24 /16
28
RIPng (RIP next Generation)
Theory and Comparisons to RIP-2
The RIPng RFC states that the protocol uses many of the
same concepts and conventions as the original RIP-1
specification, also drawing on some RIP-2 concepts.
However, knowing that many of you might not remember a
lot of details about RIP-2.
Configuring RIPng
RIPng uses a new command style for the basic configuration, but
most of the optional features and verification commands look much
like the commands used for RIP for IPv4.
Step 2. Enable RIPng using the ipv6 router rip name global
configuration command. The name must be unique on a router but
does not need to match neighboring routers.
Step 3. Enable IPv6 on the interface, typically with one of these two
methods:
Configure an IPv6 unicast address on each interface using the ipv6
address address/prefix-length [eui-64] interface command.
Configure the ipv6 enable command, which enables IPv6 and causes
the router to derive its link local address.
Step 4. Enable RIP on the interface with the ipv6 rip name enable
interface subcommand (where the name matches the ipv6 router rip
name global configuration command).
31
R1# show running-config
! The output is edited to remove lines not pertinent to this example.
! Next, step 1’s task: enable IPv6 routing
ipv6 unicast-routing
!
! Next, on 5 interfaces, steps 3 and 4: configuring an IPv6 address,
! and enable RIPng, process “fred”.
interface FastEthernet0/0.1
ipv6 address 2012::1/64
ipv6 rip fred enable
!
interface FastEthernet0/0.2
ipv6 address 2017::1/64
ipv6 rip fred enable
!
interface FastEthernet0/1.18
ipv6 address 2018::1/64
ipv6 rip fred enable
!
interface Serial0/0/0.3
ipv6 address 2013::1/64
ipv6 rip fred enable
!
interface Serial0/0/0.4
ipv6 address 2014::1/64
ipv6 rip fred enable
!
interface Serial0/0/0.5
ipv6 address 2015::1/64
ipv6 rip fred enable
!
! Next, step 2’s task, creating the RIPng process named “fred”
ipv6 router rip fred
32
Ahmed Nabil
R3# show ipv6 route rip
IPv6 Routing Table - Default - 19 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
B - BGP, M - MIPv6, R - RIP, I1 - ISIS L1
I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
EX - EIGRP external
O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
R 2005::/64 [120/3]
via FE80::11FF:FE11:1111, Serial0/0/0.1
via FE80::22FF:FE22:2222, Serial0/0/0.2
R 2012::/64 [120/2]
via FE80::11FF:FE11:1111, Serial0/0/0.1
via FE80::22FF:FE22:2222, Serial0/0/0.2
! lines omitted for brevity...
R 2099::/64 [120/3]
via FE80::22FF:FE22:2222, Serial0/0/0.2
via FE80::11FF:FE11:1111, Serial0/0/0.1
! Unlike show ip protocols, show ipv6 protocols displays little info.
33
Ahmed Nabil
OSPF
in
single area
Ahmed Nabil
34
Overview
OSPF C/C’s
Ahmed Nabil 35
• OSPF tables:
1- Neighbor table (adjacency table)
- List of all neighbors (a neighbor is direct connected &
understands the same protocol)
#show ip ospf neighbors
2- Topology table (Link State Data Base - LSDB)
Contains all routers and their attached links in the area or
network,
or in other way all routes to all destination networks.
All routers within an area has identical copy of it.
#show ip ospf database
3- Routing table (forwarding database)
- Best routes to all destination networks.
#show ip route [ospf]
• OSPF topologies:
1- BMA (Broadcast Multiple Access)
Ex: Ethernet & Token ring links
2- Point to point
A network that joins a single pair of routers.
Ex: Interfaces running PPP or HDLC or point to point
sub interfaces ATM & Frame Relay
1- Hello packet:
- Used for neighbor
discovery and
maintenance of neighbor
relationship.
- Sent periodically on
multicast address
224.0.0.5 (all OSPF routers)
every 10sec. on BMA topology,
point to point links and
NBMA point to point links
& every 30sec. on NBMA multipoint topology
37
• Operation of OSPF :
1- Neighbor discovery (hello protocol) – forming adjacency:
1.1- down state:
- No communication yet.
38
• Hello packet:
Version Type packet length
RID
Area ID
Check sum authentication type
Password
Password
Hello interval options (area type) router priority
Router dead interval
DR ID
BDR ID
Neighbor 1
.
.
Neighbor n
39
1.3 – Two way state:
- The neighbor relationship is formed.
Note:
The Two way state is the final state between Drothers.
41
3- Routes discovery:
3.1- Exstart state:
- Form the master / slave relationship.
- The master is the router with the highest RID even it isn’t the
DR.
3.2- Exchange state :
- Send the link state ID for entries in the LSDB (The master
router sends a summary for entries in the LSDB “DBD”)
LSID : RID sequence
3.3 - Loading state:
- Requesting details from specific LSDB entries.
3.4 – Full State: (Full adjacency)
- All routers has a common LSDB
Hello
Hello
Ahmed Nabil
42
After the DR and BDR have been selected, the routers are considered to be in
the exstart state, and they are ready to discover the link-state information
about the internetwork and create their LSDBs. The process used to discover
the network routes is the exchange protocol, and it gets the routers to a full
state of communication. The first step in this process is for the DR and BDR to
establish adjacencies with each of the other routers. When adjacent routers
are in a full state, they do not repeat the exchange protocol unless the full state
changes.
As shown in the previous figure, the exchange protocol operates as follows:
Step 1 In the exstart state, the DR and BDR establish adjacencies with each
router in the network. During this process, a master-slave relationship is
created between each router and its adjacent DR and BDR. The router with the
higher router ID acts as the master during the exchange process.
Step 2 The master and slave routers exchange one or more DBD packets. The
routers are in the exchange state.
A DBD includes information about the LSA entry header that appears in the
LSDB of the router. The entries can be about a link or about a network. Each
LSA entry header includes information about the link-state type, the address of
the advertising router, the cost of the link, and the sequence number. The
router uses the sequence number to determine the “newness” of the received
link-state information.
Step 3 When the router receives the DBD, it performs these actions, as shown
in the figure:
1. It acknowledges the receipt of the DBD using the LSAck packet.
2. It compares the information it received with the information it has. If the DBD
has a more up-to-date link-state entry, then the router sends an LSR to the
other router. The process of sending LSRs is called the loading state.
3. The other router responds with the complete information about the
requested entry in an LSU packet. Again, when the router receives an LSU, it
sends an LSAck.
Step 4 The router adds the new link-state entries to its LSDB.
When all LSRs have been satisfied for a given router, the adjacent routers are
considered synchronized and in a full state. The routers must be in a full state
before they can route traffic.
At this point, all the routers in the area should have identical LSDBs.
43
LSA Sequence Numbering
• When a router encounters two instances of an LSA, it must
determine which is more recent. The LSA having the newer
(higher) LS a sequence number is more recent.
Ahmed Nabil
44
Creation of Adjacencies
45
Creation of Adjacencies
<…>
46
4 – Choosing routes:
• Each router in the area places itself into the root of the tree
that is built.
• The best path is calculated with respect to the lowest total cost
of links to a specific destination.
• Forming the routing table by applying the SPF algorithm
(Dijkstra algorithm) on the LSDB to form the RTG table.
• At convergence :
- No further updates unless the LSDB time expires (30 min.) (LSA
refreshment), periodic keepalive hellos are sent, dead interval is 4*hello,
Hello/dead=10/40 sec for BMA & P-P, 30/120 sec for NBMA multipoint.
- Summaries of individual link-state entries, not the complete link-state
entries, are sent every 30 minutes to ensure LSDB synchronization. Each
link-state entry has a timer to determine when the LSA refresh update
must be sent.
- Each link-state entry also has a maximum age of 60 minutes. If a link-
state entry has not been refreshed within 60 minutes, it is removed from
the LSDB.
47
• At change:
- The router that feels the change send LSU to DR & BDR on
224.0.0.6.
- The DR & BDR will send LSACK to the sender router.
- Then the DR will send LSU to all routers on 224.0.0.5.
- Then all routers will rebuild the SPF tree
Convergence stability :
To solve the flapping link problem, OSPF uses the convergence
stability rules (timers).
48
- Basic configuration:
(config)# router ospf <process id>
! process id = 1-65535 & can never be 0, a maximum of 32
process could be supported by ospf !
(config-router)#network <net. add.> <w.c.m> area <area
id>
Or
Router(config-if)# ip ospf process-id area area-id
! Optional method to enable OSPF explicitly on an interface
or
0
Ahmed Nabil
49
Optional configuration:
OSPF Router ID
• The router is known to OSPF by the OSPF router ID number.
• LSDBs use the OSPF router ID to differentiate one router from the next.
• By default, the router ID is the highest IP address on an active
interface at the moment of OSPF process startup.
• A loopback interface can override the OSPF router ID. If a loopback
interface exists, the router ID is the highest IP address on any active
loopback interface.
• The OSPF router-id command can be used to override the OSPF
router ID.
• Using a loopback interface or a router-id command is recommended for
stability.
Define the router ID:
(config-router)# router-id <ip address>
Loopback interface:
(config)# int loopback 0
(config-if)# ip address <ip> <mask>
Ahmed Nabil
52
Troubleshooting
#show ip route
RouterA# show ip route ospf
53
#show ip ospf
RouterB# show ip ospf
#show ip protocols
54
OSPF operation in NBMA networks
Due to based on layer 3 concepts all devices on NBMA segment must
be in the same subnet, so OSPF (layer 3 protocol) need to treat them
as direct neighbors, on the other hand using layer 2 concepts they may
not be directly connected (no PVC between all of them) they are not next
hops to each others, but OSPF can treat them in some cases as direct
neighbors as in the case of NBMA mode.
Ahmed Nabil
55
OSPF operation in NBMA networks
or partial mesh
56
Ahmed Nabil
57
• Configuration for NBMA networks:
(config)# int s0/0
(config-if)# ip ospf network { non-broadcast / broadcast /
point-to-multipoint [non-broadcast]/ point-to-point}
58
Ex2: Routers in Multipoint mode
130.130.1.2
S0
59
Ex3: Routers using point-to-point subinterfaces
130.130.1.2
S0
60
OSPF
in
Multiple
Areas
61
Ahmed Nabil
Single VS. Multiple Areas OSPF
So routers will need high CPU power & big memory size,
The solution if you require to scale your network using OSPF,
is to use hierarchical design.
62
Types of Routers
• Internal Router:
Router that has all its interfaces in the same area, it has
full LSDB for its area
(config)#router ospf <process id>
(config-router)#network <link id> <wcm> area <area id>
• ABR (Area Border Router):
Router that is responsible for connecting two or more
areas, it must has at least one interface in the backbone
area (area 0), it has full database for all areas to which it
is connected and send summary database updates
between these areas
(config)#router ospf <process id>
(config-router)#network <link id> <wcm> area 0
(config-router)#network <link id> <wcm> area <area id>
• ASBR (Autonomous System Boundary Router):
Router that has at least one interface into an external
internetwork (another AS) or other non-OSPF network
• Backbone Router:
Router that has at least one link in area 0, it could be an
internal router, ABR or ASBR
63
Types of LSAs
• Type 1 LSA:(router link LSA)
Intra-area LSA "O in routing table"
Every router generate router link advertisements and
flood it to all routers for each area to which it belong,
it describes:
1-directly attached link by its ip
2-mask of link
3-state of link, cost
4-describe whether the router is ABR or
ASBR, Type 1 LSID is the originating router RID
5-Link type (point to point to other router, stub,
multiaccess (transit), virtual link,..)
• Type 2 LSA: (Network Link LSA)
Intra-area "O in routing table"
generated by DR and flooded inside its area, its function is
that DR advertise its existence to all its area, Type2 LSID is
the ip of interface of the DR facing the segment
65
Ahmed Nabil
• Type5 LSA (AS External link LSA)
"OE1, OE2" in routing table
generated by ASBR and flood to all AS, it describe routes
to destination networks in an external AS
(Future use)
Interpreting the Routing Table: Types of Routes
Link count: Total number of directly attached links, used only on router LSAs.
The link count includes all point-to-point, transit, and stub links. Each point-to-
point serial link counts as two; all other links count as one, including Ethernet
links. 67
Ahmed Nabil
RouterA#show ip ospf database
OSPF Router with ID (10.0.0.11) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
10.0.0.11 10.0.0.11 548 0x80000002 0x00401A 1
10.0.0.12 10.0.0.12 549 0x80000004 0x003A1B 1
100.100.100.100 100.100.100.100 548 0x800002D7 0x00EEA9 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.31.1.3 100.100.100.100 549 0x80000001 0x004EC9
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
10.1.0.0 10.0.0.11 654 0x80000001 0x00FB11
10.1.0.0 10.0.0.12 601 0x80000001 0x00F516
10.1.1.0 10.0.0.11 7 0x80000009 0x004DC5
10.1.1.0 10.0.0.12 9 0x80000007 0x00E81B
10.1.1.0 172.31.1.1 1111 0x80000003 0x00DD82
10.1.2.0 10.0.0.11 599 0x80000003 0x00EB1C
10.1.2.0 10.0.0.12 603 0x80000001 0x004CCC
10.1.3.0 10.0.0.11 14 0x80000002 0x00E225
10.1.3.0 10.0.0.12 69 0x80000001 0x00DE29
10.200.200.13 172.31.1.1 1108 0x80000001 0x00764E
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
10.0.0.11 10.0.0.11 19 0x80000009 0x00B6C3 3
10.0.0.12 10.0.0.12 601 0x80000005 0x0085F0 3
10.200.200.13 10.200.200.13 20 0x80000003 0x000AB2 3
10.200.200.14 10.200.200.14 62 0x8000004D 0x003C2E 3
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
10.1.1.1 10.0.0.11 19 0x80000001 0x00D485
10.1.2.4 10.200.200.14 622 0x80000001 0x009F20
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
172.31.1.0 10.0.0.11 540 0x80000003 0x004108
172.31.1.0 10.0.0.12 542 0x80000003 0x003B0D
172.31.1.0 172.31.1.1 1399 0x80000003 0x00C5CA
172.31.2.0 10.0.0.11 536 0x80000001 0x00D762
172.31.2.0 10.0.0.12 537 0x80000001 0x00D167
172.31.2.0 172.31.1.1 1394 0x80000001 0x005C25
Summary ASB Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
100.100.100.100 10.0.0.11 536 0x80000001 0x007213
100.100.100.100 10.0.0.12 537 0x80000001 0x006C18
100.100.100.100 172.31.1.1 1394 0x80000001 0x00F6D5
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
10.254.0.0 100.100.100.100 1351 0x8000010A 0x00C518 0
68
Ahmed Nabil
Another Area’s types
AS
6. Not So Totally Stub area: 1. Back bone area: It is area 0, it is
(Totally stub + ASBR) connected to all other areas, and it
On all routers: ( - )# area 5 nssa accepts any type of LSAs except type7
On ABR: ( - )# area 5 nssa no-summery
Another
AS
Area Area
Area 5 1 2. Standard or ordinary area: (not
Type 75 area 0)
(So any area except area 0, by default
O*IA 0.0.0.0/0 is a standard area, it can have ASBR,
Type 5
and it accepts any type of LSAs except
Area 0
Type 3 type7)
Type 5
Area Area
Converted to 4 2
69
Types of Areas
• Ordinary or standard area:
Area that accept all types of LSAs (intra area, inter-area and
external), but doesnot accept type7
• Backbone Area (transit area):
It is area 0 and connect all other areas, it accept all types of areas
except type 7
70
• Stub area:
Area that its ABR does not advertise to it type 5 LSA and doesnot
accept type 7 LSA, but its ABR advertise default route instead, so
internal routers in that area type doesnot know any details about
other AS networks but can reach them using default route through
ABR, stub area can never contain an ASBR
71
Totally Stub area:
Area that its ABR does not advertise type 5, type 3, type 4
and does not accept type7, but instead its ABR advertise a
default route, so internal routers does not know details about
other AS networks and other Areas networks, but use default
route to reach them through their ABR.
72
• NSSA (Not-So-Stubby-Area):
It is a stub area that can contain ASBR, it accepts type7 LSA and
all other types except type 5 LSA and use default route instead
ABR of NSSA convert type 7 to other areain to type 5
Has O, OIA, O*IA, ON1 & ON2 routing entries
•NSSA - totally stub area: has O, O*IA, ON1 & ON2 routing entries
It is a total stub area that can contain ASBR, it accepts type7 LSA and use
default route only
On ABR router in NSSA total stub area
(config-router)# area <id> nssa no-summary
73
Configuring summarization
74
summary on ASBR:
(config-router)#summary-address <address> <mask>
The solution is to form a virtual link between the far area and
area 0 through the transit area
• #sh ip protocols
• #sh ip route
• #sh ip ospf neighbors
• #sh ip ospf interface
• #sh ip ospf database
• #sh ip ospf border-routers
• #sh ip ospf virtual-links
• (config-router)#log-adjacency-changes
Design considerations
Cisco recommend the following:
• 50 routers per area (max)
• 60 neighbours per router (max)
• 3 areas per router (max)
• Router can not be a DR or BDR for more than one
network segment
78
Ahmed Nabil
How OSPF for IPv6 Works
•Similar to IPv4
• The difference between the database and the routing table is that
the database contains a complete collection of raw data; the routing
table contains a list of shortest paths to known
destinations via specific router interface ports.
79
Ahmed Nabil
OSPFv3—Hierarchical Structure
• Topology of an area is invisible
from outside of the area:
– LSA flooding is bounded by area.
– SPF calculation is performed
separately for each area.
• Backbones must be contiguous.
• All areas must have
a connection to the backbone:
– Otherwise a virtual
link must be used to
connect to the backbone.
OSPFv3—messages
• OSPFv3 uses the same basic packet types as OSPFv2:
– Hello
– Database description (DBD)
– Link state request (LSR)
– Link state update (LSU)
– Link state acknowledgment (ACK)
80
Enhanced Routing Protocol Support Differences from OSPFv2
81
Ahmed Nabil
OSPFv3 vs OSPF v2
82
1- OSPFv3 uses IPv6 link-local addresses to identify the
OSPFv3 adjacency neighbors.
5- Multicast addresses:
• FF02::5—Represents all SPF routers on the link-local
scope; equivalent to 224.0.0.5 in OSPFv2
• FF02::6—Represents all DR routers on the link-local scope;
equivalent to 224.0.0.6 in OSPFv2
• Router LSAs and network LSAs contain only 32-bit IDs. They
do not contain prefixes.
84
The two renamed LSAs are as follows:
• Interarea prefix LSAs for area border routers (ABRs) (type
3):
•Type 3 LSAs advertise internal networks to routers in other areas
(interarea routes). Type 3 LSAs may represent a single network
or a set of networks summarized into one advertisement. Only
ABRs generate summary LSAs. In OSPF for IPv6, addresses for
these LSAs are expressed as prefix, prefix length instead of
address, mask. The default route is expressed as a prefix with
length 0.
• Interarea router LSAs for autonomous system boundary
routers (ASBRs) (type 4):
Type 4 LSAs advertise the location of an ASBR. Routers that are
trying to reach an external network use these advertisements to
determine the best path to the next hop. ASBRs generate type 4
LSAs.
Router(config-rtr)#router-id router-id
For an IPv6-only router, a router ID parameter must be defined in
the OSPFv3 configuration as an IPv4 address using the router-id
router-id command. You can use any IPv4 address as the router ID
value.
86
Ahmed Nabil
Example:
(config)#ipv6 unicast-routing
(config)# ipv6 router ospf 1
(config-rtr)# router-id 2.2.2.2
Router(config-rtr)#area range 1 2001:0DB8::/48
(config)# interface Ethernet0/0
(config-if)# ipv6 address 3FFE:FFFF:1::1/64
(config-if)# ipv6 ospf 1 area 0
(config-if)# ipv6 ospf priority 20
The priority number is used to in the designated router
election.
(config-if)# ipv6 ospf cost 20
The cost of sending a packet on the interface, expressed
in the link state metric.
OI 2001:0DB8:0:0:7::/64 [110/20]
via FE80::A8BB:CCFF:FE00:6F00, Ethernet0/0
OI 2001:0DB8:0:0:8::/64 [110/100]
via FE80::A8BB:CCFF:FE00:6F00, Ethernet0/0
OI 2001:0DB8:0:0:9::/64 [110/20]
via FE80::A8BB:CCFF:FE00:6F00, Ethernet0/0
87
Ahmed Nabil
OSPFv3 Configuration Example
Router1#
interface S1/1
ipv6 address
2001:410:FFFF:1::1/64
ipv6 ospf 100 area 0
interface S2/0
ipv6 address
3FFE:B00:FFFF:1::2/64
ipv6 ospf 100 area 1
Router2#
interface S3/0
ipv6 address
3FFE:B00:FFFF:1::1/64
ipv6 ospf 100 area 1
91
Ahmed Nabil
IS-IS overview
• Why IS-IS is used?
1-IS-IS is the most popular (RFC 1195) open standard,
scalable and stable IP routing protocol in the ISP industry
& it was developed before OSPF
2-The simplicity and stability of IS-IS make it robust in large
internetworks, so no need to use another protocol instead
3-US government mandated (forced) the support of an OSI
routing protocol (IS-IS, ISO-IGRP, static CLNS routes)
4-Simpler implementation than OSPF, it make efficient use of
bandwidth, memory and processor
5- Well positioned for IPv6, IS-IS updates is not carried within
another routed protocol, so it is routed protocol
independent
in
Cisco implementation
(1-13 byte)
93
Ahmed Nabil
Cisco implementation for NSAP address structure
• a) IDP (Initial Domain Part):
-AFI (Authority Format Identifier):
It is the main domain (authority) id.
i.e.: 49 reserved for locally administered (private) domain
-IDI (Initial Domain Identifier):
It is the sub-domain id.
• b) DSP (Domain Specific Part):
-HODSP (High Order DSP):
It is the area id, unique within domain.
-System id:
It is the device id, unique within area.
-NSEL (Network Selector):
It identifies a process (application) on the device, it
corresponds to a port number in IP environment.
94
Ahmed Nabil
Rules of ISO addressing
1-The ISO address is assigned to the system, not to the
interface
2-The router has one NET address
3-All routers within an area must use the same area
address
4-System id must be unique within the area
5-System id must have the same length for all ISs and ESs
within the domain (For Cisco implementation system id
is fixed for 6 bytes)
OSI Layer 2 address
SNPA address
• SNPA (Sub Network Point of Attachment) address is
equivalent to layer 2 data-link layer address
corresponding to the Layer 3 NSAP address, it is
identified by:
1-MAC address on LAN interfaces
2-Virtual Circuit id for (X.25, ATM, Frame Relay)
3-Encapsulation type for point to point (ex: HDLC for HDLC)
•Interfaces uniquely identified by circuit ID:
– One octet number on point-to-point interfaces (like 0x00)
– Circuit ID concatenated with 6-octet system ID
of a designated router on broadcast multiaccess
networks to form 7-octet LAN ID (1921.6800.0001.01)
95
Ahmed Nabil
Basic operation of OSI routing
96
Ahmed Nabil
• Level 0 routing is conducted by ES-IS
• Level 1 routing is performed IS-IS
• Level 2 routing is performed IS-IS
• Level 3 routing is performed IDRP (Inter Domain Routing
Protocol)
97
Ahmed Nabil
ES-IS discovery protocol operation
98
Ahmed Nabil
IS-IS Features
• Link-state routing protocol based on OSI model
• Use Dijkstra's SPF algorithm
• A router can only exist in one area
• Support two routing levels: Level 1 and level 2 routing
• Level 1 router:(like OSPF internal nonbackbone
routers)
-Router that build a L1 LSDB containing system ids only
and router interface to reach these system id, because it
make routing inside the area only.
• Level 2 router:(like OSPF ABR)
-Router that build a L2 LSDB about areas only and
interfaces to reach these areas, because it make routing
between areas only.
• Level 1 / Level 2 router: (like OSPF backbone routers)
-Router that build both L1 & L2 LSDB, so it support both
intra-area and inter-area routing, each L1/2 router
advertise a default route to all routers inside its area, it
act as Area Border Router (ABR) in a totally stub area.
• The IS-IS Backbone is not an area, it is the continuous
path containing all L2 & L1/L2 routers, so extending it is
very flexible.
99
Ahmed Nabil
OSI IS-IS routing process
100
Ahmed Nabil
Traffic flow process example
IS-IS operation
1)Forming Adjacency (neighbour discovery):
send L1 IIH (IS to IS Hello) or L2 IIH or both for Broadcast
media every 10 sec
Send P2P hello for point to point media every 10 sec
2)Elect DIS (Designated IS) called pseudo node:
-Router having highest priority (0-127) default to 64
-Then highest MAC address or SNPA address
but note that all routers will form adjacencies with DIS and
each others too, but only DIS generate pseudo node LSP
(as type2 LSA in OSPF)
and it also decrease adjacency
overhead, but it is not
guaranteed to stay if a
better IS exists on the LAN,
but there is no Backup DIS
is elected
102
For L1 there is a DIS, and for L2 there may be another DIS or
could be the same DIS for both L1 and L2
ES Neighbors 3
11.0.0.0/8
S0
S1
(Redistribution)
112
Ahmed Nabil
Why we need multiple routing protocols?
A) Migration
-From FLSM to VLSM
-From flat design to hierarchical design (to facilitate route
summarization which enhance network scalability)
Methods of redistribution
• One way redistribution:
redistribute networks learned by a certain protocol in a single
direction
• Two way redistribution:
redistributes all routes from a routing process to another and vice-
versa
Redistributing VS. Redistributed protocol
• Redistributing protocol:
It is the native protocol that will transform another protocol to its
form
• Redistributed Protocol:
It is the non-native protocol that will be transformed to another
protocol form
- note: in order for any routes to be redistributed it must exist in
the routing table of the redistributing router 114
Configuring Redistribution
117
Ahmed Nabil
Redistributing into RIP
metric 10
B Routing Table
R 10.0.0.8
For
Redistribution
Ospf1
120
Ahmed Nabil
Example: Routing Tables after Route Redistribution
R 10.0.0.8
121
Ahmed Nabil
IPv6 IGP Redistribution
IPv6 routing protocols can perform route redistribution, much like IPv4
route redistribution. The following list summarizes some of those key
similarities between both IPv4 and IPv6 route redistribution:
■ Redistribution takes routes from the IP routing table, not from the
topology tables and databases controlled by the source routing protocol.
■ The routing protocols use the same default administrative distance (AD)
settings for internal and external routes.
■ The IPv6 version of the redistribute command takes only routes learned
from an IGP but by default does not take connected routes on
interfaces enabled for that IGP. To also redistribute those connected
routes, the redistribute command must include the include-connected
parameter. When an IPv4 routing protocol redistributes from an IGP, it
always attempts to take both the IGP-learned routes and the connected
routes for interfaces enabled for that IGP.
Configuration with
route map:
First, the configuration shows an IPv6 prefix list and a route map that uses
a match ipv6 command that refers to the prefix list. The route map
matches the two LAN subnets in the RIP domain with the first route map
clause and sets the metric to 200. The implied deny clause at the end of
the route map matches all other routes, which makes R2 filter all other
routes from being redistributed into OSPF. As a result, the serial IPv6
subnet, 2000:0:0:1::/64, is filtered by the redistribution process. The show
ipv6 route ospf command on R3 will confirm that R3 learned routes for
both LAN subnets in the RIP domain but no other routes. Of particular
interest, note that OSPFv3 lists the route as OSPF external Type 2,
because just like OSPFv2, OSPFv3 defaults to redistribute routes as
external Type 2 routes. Note also that the output lists metrics for each
route as 200, because R2 set the metric to 200, and OSPF does not add
anything to the metric of E2 routes.
123
Ahmed Nabil
Controlling routing
updates traffic
&
Policy Based Routing
(PBR)
124
Ahmed Nabil
Controlling routing updates traffic
Passive interfaces
(config-router)#passive-interface <interface name>
(config-router)# passive-interface default
Note:
Passive interface will cause RIP and IGRP to stop sending
updates, But it can receive updates.
Passive interface may be also used with OSPF, ISIS & EIGRP,
but it will prevent also sending updates & hellos,
So no adjacencies could be formed with neighbors on a
passive interface, no updates can be either sent or received.
125
Ahmed Nabil
Using admin. distance to influence the route selection
• For EIGRP & BGP:
(Config-router)#distance eigrp <internal distance> <external distance>
(Config-router)#distance bgp <internal distance> <external distance>
• For OSPF:
(config-router)#distance ospf external <value> inter-area <value>
intra-area <value>
• for all protocols: used with all protocols to specify certain networks
(config-router)#distance <value> [<src of updates address> <wcm>]
[<access-list number or name for advertised routes>]
126
Ahmed Nabil
Example: Redistribution Using Administrative Distance
127
Ahmed Nabil
We will perform redistribution and use higher administrative
distance for redistributed routes
hostname P3R1 hostname P3R2
!
router ospf 1
redistribute rip metric 10000 metric-type 1 subnets
network 172.31.0.0 0.0.255.255 area 0
distance 125 0.0.0.0 255.255.255.255 64
!
router rip
version 2
redistribute ospf 1 metric 5
network 10.0.0.0
no auto-summary
!
access-list 64 permit 10.3.1.0
access-list 64 permit 10.3.3.0
access-list 64 permit 10.3.2.0
access-list 64 permit 10.200.200.31
access-list 64 permit 10.200.200.34
access-list 64 permit 10.200.200.32
access-list 64 permit 10.200.200.33
128
Ahmed Nabil
Distribute List
129
Ahmed Nabil
Distribute list action
Is there
filter for that Yes Is there
Routing an entry
interface for
update for this route?
routing
process
no
Permit Deny
no match
process in ACL in ACL
route
normally
Drop route
130
Ahmed Nabil
Example1
• Hide network 10.0.0.0 from router C using interface
filtering
Eigrp 1
B(config)#router eigrp 1
B(Config-router)#network 172.16.0.0
B(Config-router)#network 192.168.5.0
B(Config-router)#distribute-list 7 out s0
B(config)#access-list 7 deny 10.0.0.0 0.255.255.255
B(config)#access-list 7 permit any
Example2
Controlling Redistribution with Distribute Lists
131
Ahmed Nabil
Prefix Lists
• Used to filter a range of routes, which is impossible using
normal ACL, also it is impossible to specify the subnet mask
of updates that is required to be filtered using ACL, only prefix
list can match subnet and their masks
(config)#ip prefix-list <list name> description <description statement>
(config)#ip prefix-list <list name>[seq. no.] <deny/permit> <prefix>/<prefix
length> [ge <prefix length>][le <prefix length>]
! Seq. no. is optional and will start with 5 for the first statement
and incremented by 5 for further statements !
Note: implicit deny at the end
132
Example 1
• Deny default route
(config)#ip prefix-list ccnp1 deny 0.0.0.0/0
! To deny exactly 0.0.0.0/0 !
Example 2
• Deny 172.16.0.0/24 from update containing
172.16.0.0/24, 172.16.0.0/20 & 172.16.0.0/16
133
Ahmed Nabil
Route Maps
• The common uses of route maps:
1-Redistribution route filtering:
For routing updates filtering ( a more sophisticated
alternative to distribute list) & update modification
(modify metrics, metric types,...)
2-PBR (Policy Based Routing) – called Policy Maps
Routed traffic filtering and shaping
3-NAT
Use route-maps is used with NAT to permit users that
can be translated instead of access-list
4-BGP policy implementation
135
Ahmed Nabil
Route map configuration
Create route map
(config-route-map)#route-map <map-tag> deny [seq. no.]
(config-route-map)#match <condition>
! If main statement is deny, so no need for Set statement !
(config-route-map)#route-map <map-tag> permit [seq. no.]
(config-route-map)#match <condition>
! If no Set statement exist, that means no change will be applied !
(config-route-map)#route-map <map-tag> permit [seq. no.]
(config-route-map)#set <condition>
! If no Match statement exist, that means match any !
(config-route-map)#route-map <map-tag> permit [seq. no.]
(config-route-map)#match <condition a><condition b><condition c>
(config-route-map)#set <condition>
!If many match conditions exist horizontally that means a logical OR
(match condition a OR b OR c )!
(config-route-map)#route-map <map-tag> permit [seq. no.]
(config-route-map)#match <condition x>
(config-route-map)#match<condition y>
(config-route-map)#match<condition z>
(config-route-map)#set <condition d>
(config-route-map)#set <condition e>
! If many match or Set exist vertically, that mean a logical AND
(match condition x AND y AND z, then Set d AND e)!
(config-route-map)#route-map <map-tag> permit [seq. no.]
! If no match (mean match any) ,no Set (mean don’t modify
anything),the full statement will mean permit any with no changes
(config-route-map)#route-map <map-tag> deny [seq. no.]
! If no match (mean match any), deny in main statement (mean filter
route), so the full statement mean deny any route)!
136
Route map processing for redistribution
yes
yes
no
permit in deny in
no
the main the main
line statement line statement
138
Ahmed Nabil
Example2
Use Route map to form redistribution policy
(config)#router ospf 10
(config-router)#redistribute rip subnets route-map
CCNP
(config)#route-map CCNP permit 10
(config-route-map)#match ip address 1 2
(config-route-map)#set metric 500
(config-route-map)#set metric-type type-1
(config-route-map)#route-map CCNP deny 20
(config-route-map)#match ip address 3
(config-route-map)#route-map CCNP permit 30
(config-route-map)#set metric 5000
139
PBR (Policy Based Routing)
(Policy Map)
PBR C/Cs
1-Source based routing
different sources goes through different paths
2-QOS
mark different traffic with different TOS values in IP
packets
3-Load Sharing
distribute traffic on multiple paths
4-Cost saving
by distributing traffic among low-BW, low cost and high-
BW, high cost connections
140
Ahmed Nabil
Route map for PBR configuration
1)Create route map (policy map)
(config)#route-map <map-tag> <permit/deny> [seq. no.]
(config-route-map)#match <condition>
(config-route-map)#set <condition>
141
Ahmed Nabil
Route-map processing for PBR
yes
yes
no
permit in deny in
the main the main no
line statement line statement
Use
Is there entry no Discard
default packet
in routing table
routing
process yes
(destinatio
n based apply set
routing
table)
Match conditions
(config-route-map)#match ip address [ACL no. or name]
! Put Access-list that contain IP addresses that will be matched with
incoming packets source ip !
(config-route-map)#match length <min> <max>
! Check incoming packet min & max length !
(config-route-map)#match tos <value>
! Match TOS value in an incoming ip packet !
(config-route-map)#match ip-precedence <value>
! Match ip precedence value in an incoming ip packet !
142
Ahmed Nabil
Set conditions
144
Verifying Policy-Based Routing Examples
#traceroute <ip>
#ping <ip> , with record option
145
Ahmed Nabil
BGP
(Border Gateway Protocol)
146
Ahmed Nabil
Overview
• BGPv4 is an Exterior Gateway Protocol (EGP) that can
exchange routing updates between different Autonomous
Systems, so it operate mainly at the border of an AS.
• BGP is not designed to choose paths based on bandwidth,
delay and other metrics, but paths are chosen based on policy
attributes.
• AS is a collection of networks under a single technical
administration, AS is identified by a unique number between 1
– 65535.The range 64512 - 65535 is reserved for private use.
• Currently new AS numbering (32 bit) was introduced and AS
23456 is used for interoperability between old numbering (16
bit) and new numbering (32 bit)
BGP messages
1-Open message
It is used to open BGP session with a neighbor
(Includes holdtime and BGP router ID
2-Keepalive message
Periodic message that is sent to keep TCP session
stay still
3-Update message
It contain information about destination networks
and the attributes to reach these networks
4-Notification message
Sent to identify that an error condition is detected
for a certain router (i.e. memory or CPU error) 148
BGP C/Cs
• BGP is a path vector protocol (advanced distance vector).
(IGPs announce networks and describe the cost to reach
those networks, BGP announces pathways and the networks
that are reachable at the end of the pathway. BGP describes
the pathway by using attributes which are similar to metrics)
151
Ahmed Nabil
BGP Start up Operation
after neighbor command is written
(config)#router bgp <as#>
(config-router)#neighbor <neighbor ip> remote-as <neighbor as#>
Phase 1: Neighbor discovery:
Idle state:
router is searching IP routing table to see if a route exists to
reach the neighbor
Connect state:
router found route and has completed TCP 3-way handshake
Open sent:
open message is sent
Active state:
waiting confirmation on parameters to establish session
Open confirm:
receive agreement on parameters to establish session
Established state:
peering is formed and routing exchange begins
RouterA# debug ip bgp events
BGP events debugging is on
BGP : 172.16.1.2 passive open
BGP : 172.16.1.2 went from idle to connect
BGP : 172.16.1.2 open rcvd, version 4
BGP : 172.16.1.2 went from connect to open sent
BGP : 172.16.1.2 sending open, version 4
BGP : 172.16.1.2 went from open sent to open confirm
BGP : Scanning routing tables
BGP : 172.16.1.2 went from open confirm to established
Why a router could stuck in active state?
•Neighbor peering with the wrong address
•Neighbor does not have neighbor statement for this router
•Neighbor does not have a route to the source IP address of the
BGP open packet generated by this router 152
BGP Considerations:
Neighborship considerations:
1- Neighbor command in BGP
2- Neighbor reachability (route to neighbor should exist
in routing table, using connected,static or IGP)
3- Fixed source of BGP messages and updates are
required (update-source)
4- Adjusting TTL if neighbor is eBGP (eBGP-multihop)
153
Ahmed Nabil
1-Source of updates behaviour
• A router will never receive an update from a source unless that source
address is identified in its neighbor command (in its neighbor list)
• When a BGP packet is received for a new BGP session, the source
address of the packet is compared to the list of neighbor statements.
– If a match is found, a relationship is established.
– If no match is found, the packet is ignored.
• Make sure the source IP address matches the address that the other
router has in its neighbor statement.
• To identify the source of updates for a certain neighbor
(config)#router bgp <as#>
(config-router)#neighbor <neighbor ip> update-source <interface
name>
This command allows the BGP process to use the IP address of a
specified interface as the source IP address of all BGP updates to that
neighbor.
• A loopback interface is usually used, as it will be available as long as
the router is operational.
• The IP address used in this command will be the destination IP
address of all BGP updates and should be the loopback interface of
the other router.
• The update-source command is normally used only with IBGP
neighbors.
• The address of an EBGP neighbor must be directly connected by
default. The loopback of an EBGP neighbor is not directly connected.
154
2-eBGP multihop
• Due to eBGP neighbors must be directly connected, so using
multiple links between the two neighbors, or using loopback
as source of update will cause a problem for BGP open
message and the advertised updates, as all eBGP messages
by default are sent with TTL=1 (non routable messages)
we can use the following command
(config-router)#neighbor <neighbor ip> ebgp-multihop [no.
of hops]
but to reach that hop there will never be an IGP or connected
that could do that, so a static route is required to reach that
hop , default hop =255 if we used ebgp-multihop, in fact no.
of hops is a TTL, and default hop (TTL)=1 if that command is
not used.
156
Ahmed Nabil
Phase 2: Routes Discovery
BGP considerations for updates
4-Advertise routes in BGP updates (populate BGP table)
4.1-Redistribute IGP routes into BGP
4.2-Use Network command (Recommended)
(config)#router bgp <as#>
(config-router)#network <network address> [mask <subnet
mask>]
Note: If no mask is specified, default masks is assumed
Note: There must be an exact match for that route in IP routing
table learned by IGP (non-BGP) so as for BGP to populate
that route in BGP table and advertise it to eBGP neighbors.
158
Method 2:
(config)#router bgp <as#>
(config-router)#network <address> [mask <mask>]
This command was not designed to perform summarization by
itself.
The aggregate-address command was designed for
summarization.
• To use the network statement for summarization, the
network number and mask used must already exist exactly
in the routing table.
• If the route was already summarized by EIGRP or OSPF,
that summarization can be announced into BGP with the
network and mask commands.
• If the route was not already summarized, a null static route
must be created for BGP to announce this summarization.
(config)#ip route <address> <mask> null0
159
Ahmed Nabil
Cautions about Network Statement
• If a network statement is used for
summarization,
do not use the more specific entries and the
summarized route as shown here.
• If both are used, the
summarized route and the
more specific routes will
be announced.
• 192.168.24.0/22 does not
exist in the IP routing table
without the null route.
• BGP will not announce the network unless
the summarized route
is already present in the
routing table.
160
Understanding BGP Requirements for transit AS
1-BGP runs on borders of AS but no IGP
Update
11.0.0.0 About
11.0.0.0
161
Ahmed Nabil
2-BGP run on borders and IGP inside AS
4-Routing Table
No BGP
3-Update 11.0.0.0
4-Routing Table
No BGP
• Conclude:
BGP must run on all transit AS routers to avoid black holes, or otherwise
redistribution from BGP into IGP must take place
• Synchronization rule: (To avoid Black Holes)
Router cannot advertise routes to eBGP neighbor unless it exist in IP
routing table by an IGP (non-BGP)
To avoid synchronization problems (black holes):
1-redistribute BGP routes into IGP protocol (big headache for IGPs, due
to BGP table is very large and IGP is not designed for that scalable
networks)
2-run BGP on all transit AS routers and disable synchronization
(config-router)#no-synchronization
162
3-BGP and IGP run on all routers of transit AS
• Conclude:
BGP must run in full mesh fashion (sessions between all
BGP neighbors) to avoid split horizon rule
163
Ahmed Nabil
4-BGP must run in full mesh fashion
-Router A advertises
network 172.16.0.0 to
router B in EBGP, with
a next hop of 10.10.10.3.
-Router B advertises
172.16.0.0 in IBGP to
router C, keeping 10.10.10.3
as the next-hop address.
-So C see the next hop to reach
172.16.0.0 is 10.10.10.3
(next AS entry point)
To override that behaviour
(config-router)#neighbor <neighbor ip> next-hop-self
So if B has written
(config-router)# neighbor 172.20.10.2 next-hop-self
So C will see 172.16.0.0 with next hop 172.20.10.1
165
Next Hop on a Multiaccess Network
The following takes place in a
multiaccess network:
• Router B advertises
network 172.30.0.0 to
router A in EBGP with
a next hop of 10.10.10.2,
not 10.10.10.1. This avoids
an unnecessary hop.
• BGP is being efficient by
informing AS 64520 of the
best entry point into AS 65000
for network 172.30.0.0.
• Router B in AS 65000 also advertises to AS 64520 that
the best entry point for each network in AS 64600 is the
next hop of router C because that is the best pathway to
transit AS 65000 to AS 64600 from AS 64520.
Example: next-hop-self Configuration
166
BGP Synchronization (old rule – not needed now)
•Synchronization rule:
Do not use or advertise to any BGP neighbor (iBGP or eBGP)
a route learned by iBGP until a matching route has been
learned from an IGP.
• Ensures consistency of information throughout the AS
• Avoids black holes within the AS
• Safe to turn off if all routers in the AS are running full-mesh
IBGP, default.
Router(config-router)# no synchronization
• Disables BGP synchronization so a router can advertise
routes in BGP without learning them in IGP, but make
sure that you make all restrictions to avoid black holes
170
Ahmed Nabil
BGP Attributes
1-AS path attribute
• The AS path attribute is Well known mandatory, transitive
171
Ahmed Nabil
2-Next hop attribute
172
Ahmed Nabil
3-Origin attribute
173
Ahmed Nabil
4-Local preference attribute
174
Ahmed Nabil
5-Weight attribute
• Cisco attribute
175
Ahmed Nabil
6-Multi Exit Discriminator (MED) attribute
176
7-Atomic aggregate attribute
• Well known discretionary
• It informs the routers that the originating router has
performed aggregation (summarization) for routes,
list of ASs that contain these routes can be
advertised (aggregate-address command)
8-Aggregator attribute
• Optional transitive
• It specifies the BGP router ID & AS no. of the
router that perform the route aggregation
9- Community attribute
• Optional transitive
• It is the grouping of routes and tag them for
filtration actions and applying policies to group
of routes belonging to certain community.
• All routes by default are members in a
community called the Internet
177
BGP route selection process
• The BGP forwarding table usually has multiple pathways
from which to choose for each network.
• BGP is not designed to perform load balancing:
• Paths are chosen because of policy.
• Paths are not chosen based upon bandwidth.
• The BGP selection process eliminates any multiple
pathways through attrition until a single best pathway is
left.
• That best pathway is submitted to the routing table
manager process and evaluated against the methods of
other routing protocols for reaching that network
(administrative distance).
• The routing protocol with the lowest administrative
distance will be installed in the routing table.
Best (>) pathways for networks 172.16.0.0/16 and 172.24.0.0/16 have not changed.
Best (>) pathway for network 172.30.0.0 has changed to a new next hop of 192.168.28.1
due to the next hop of 192.168.28.1 having a higher local preference, 400.
180
• MED is used when multiple pathways exist between two ASs
• A lower MED value is preferred.
• The default setting for Cisco is MED = 0.
• The metric is nontransitive.
• By default, MED is shared only between two Autonomous
Systems that have multiple EBGP connections with each other.
(config-router)#default-metric <value>
or
(config)#route-map <name> {permit/deny} [<seq no.>]
(config-route-map)#match ip address <acl #>
(config-route-map)#set metric <MED value>
• MED is considered the metric of BGP.
• All routes advertised to an EBGP neighbor are set to the
value specified using this command.
RouterZ# show ip bgp
BGP table version is 7, local router ID is 122.30.1.1
Status codes: s suppressed, d damped, h history, * valid,
> best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i192.168.24.0 172.20.50.2 100 100 0 65001 i
* i 192.168.28.2 200 100 0 65001 i
* i192.168.25.0 172.20.50.2 200 100 0 65001 i
*>i 192.168.28.2 100 100 0 65001 i
* i192.168.26.0 172.20.50.2 200 100 0 65001 i
*>i 192.168.28.2 100 100 0 65001 i
•For all networks: Weight is equal (0); local preference is equal (100); routes are not originated
in this AS; AS path is equal (65001); origin code is equal (i).
• 192.168.24.0 has a lower metric (MED) through 172.20.50.2 (100) than 192.168.28.2 (200).
• 192.168.25.0 has a lower metric (MED) through 192.168.28.2 (100) than 172.20.50.2 (200).
• 192.168.26.0 has a lower metric (MED) through 192.168.28.2 (100) than 172.20.50.2 (200).
181
Route maps for BGP policy implementation
1-Create route map:
(config)#route-map <name> <permit/deny> [seq. no.]
(config-route-map)#match <conditions>
(config-route-map)#set <condition>
2-Activate route map:
(config-router)#neigbhor <ip/peer group> route-map <name>
<in/out>
-Match conditions:
match ip address <acl#>
match community <community name>
-Set conditions:
set local-preference <no.>
set weight <no.>
set metric <no.>
set as-prepend <path list>
Set community community id
182
Ahmed Nabil
Verification and Troubleshooting
#sh ip bgp
#sh ip bgp summary
#sh ip route
#debug ip bgp [events/updates/keepalives]
#clear ip bgp <*/address>
(config-router)#[no] neighbor <ip/peer group> shutdown
183
Clearing the BGP Session
• When policies such as access lists, timers, or attributes are
changed, the BGP session must be reset.
• The change takes effect immediately, and the next time a
prefix or pathway is advertised or received, the new policy will
be used. It can take a long time for the policy to be applied to
all networks.
• The session should be reset to ensure the policy is
immediately applied to all affected prefixes and pathways.
• You must trigger an update to ensure that the policy is
immediately applied to all affected prefixes and paths.
• Ways to trigger an update:
– Hard reset
– Soft reset
Router# clear ip bgp {*|neighbor-address}
[soft {in | out}]
• Resets all BGP connections with this router using * or Resets
only a single neighbor
• If not using soft option (hard reset):
- Entire BGP forwarding table is discarded
- BGP session transitions from established to idle; everything
must be relearned
Using Soft Reset option:
• Routes learned from this neighbor are not lost.
• This router resends all BGP information to the neighbor without
resetting the connection.
• The connection remains established.
• This option is highly recommended when you are changing
outbound policy.
• The soft out option does not help if you are changing inbound
policy. 184
RouterA# show ip bgp neighbors
185
Enhanced Interior
Gateway Routing
Protocol
(EIGRP)
186
Ahmed Nabil
• EIGRP features:
1- Advanced D.V protocol:
Classless, no periodic updates, multicast updates, manual
summarization, triggered partial updates at change
2- Rapid convergence
Use DUAL (Diffusion Update Algorithm) that keep a backup route
for each best route, if available
4- Easy configuration
Its origin is D.V
7- Efficient updating
Incremented updates, triggered & partial updates
187
Ahmed Nabil
• EIGRP terminologies :
1- Neighbor table
(list of all neighbors)
#show ip eigrp neighbors
2- Topology table
(list of all routes to all destination network, as a matter of fact, it is
routing tables of all neighbors)
#show ip eigrp topology [all-links]
3- Routing table
(best routes to all destination networks)
#show ip route [eigrp]
4- Successor ‘S’
(the best route)
5- Feasible successor ‘FS’
(the backup route)
6- Feasible distance ‘FD’
(the metric from source to destination)
7- Advertised distance ‘AD’
(the metric from my neighbor to destination)
188
Ahmed Nabil
• EIGRP packet types:
1- Hello packet:
- Used for neighbor discovery and maintains neighbor
relationship
- Sent periodically on 224.0.0.10
- Period of Hello:
5 sec. On fast links ( > 1.54 Mbps) & point to point links
60 sec. On slow links (<or= 1.54 Mbps)
Dead interval = 3 * hello interval (15sec for fast links, 180
sec for slow links)
2- Update packet:
- Contain the RTG table at startup (sent unicast).
- Contain partial update in case of change (sent multicast
on 224.0.0.10)
3- Query packet:
- It is sent if the S is lost and there is no FS in the
topology table on multicast 224.0.0.10, it is used to
declare the failure of a link & requesting information
about another path from the neighbor
4- Reply packet:
- It is the reply for the query, sent on unicast address
5- Ack packet:
- Acknowledges all EIGRP packets except Hello packet
189
Ahmed Nabil
• EIGRP components:
190
Ahmed Nabil
• Operation :
At startup:
Every router discover its neighbors (begin establishing
adjacency) using hello protocol.
EIGRP routers to be neighbors:
1- they must have the same AS no.
2- they must have the same K-values.
191
Ahmed Nabil
Then the router exchanges its routing table with its neighbors.
From the RTG tables of neighbors the router forms
the topology table.
192
Ahmed Nabil
The command below #debug eigrp packets
Will display that operation
RouterA# debug eigrp packets
At convergence:
- no periodic updates, only hello packets
• Hellos sent periodically every 5 seconds on the following
links:
- Broadcast media: Ethernet
- Point-to-point serial links: (PPP), (HDLC)
- Point-to-point subinterface: Frame Relay, ATM
- Multipoint circuits with bandwidth greater than T1:
Frame Relay, ATM
• Hellos sent every 60 seconds on the following links:
- Multipoint circuits with bandwidth less than or equal
to T1: Frame Relay, ATM, and X.25
• Hold time by default is three times the hello time 193
Ahmed Nabil
At change:
• 1- If there is a FS:
• If the router has a FS in its topology table, it will use it in case
of the S failure and it will send update to indicate that it uses a
new route.
• 2- If there is no FS:
• The router sends a query packet to ask for another route to
the destination network.
• The other routers will reply the query
194
Ahmed Nabil
• Route selection:
- By applying DUAL on the topology table to get the RTG table.
- DUAL:
1- Track all routes advertised by neighbors.
2- Select a loop free path using a successor ‘S’ and ‘FS’.
3- If a S is lost, FS is used.
4- If no FS available, it queries neighbors and recalculate S.
5- It can hold up to 4 routes by default and 16 or more as max. for
the same destination network in the RTG table.
6- It can differentiate between different types of paths :
- internal path (Admin. Dist.=90 & symbol in RTG table is ‘D’.
- summary path (Admin. Dist.=5 & symbol in RTG table is ‘D’
out of interface null 0.
-external path (Admin. Dist. =170 & symbol in RTG table is
‘DEX’.
• How to choose S?
- S is the route that have the least metric.
Metric = 256* [k1*BW + (k2*BW / 256-load) + k3*delay + (k5 /
reliability+k4)]
By default,
7
k1=k3=1 , k2=k4=k5=0
BW=10 /BWi, BWi=Bandwidth of interface in units of Kbps
Delay=delayi * 10, delayi=delay of interface in microseconds
These values can be observed from the #show interface
command
• How to choose FS?
“This is called the feasibility condition”
The route that satisfy that inequality FD (S) > AD ( FS) , is
eligible to be the FS
195
Ahmed Nabil
Example on EIGRP route calculation
Which path from A to D is better when using EIGRP protocol?
All delays
in units of tens of
microseconds
• Delay is the sum of all the delays of the links along the
paths:
Delay = [delay in tens of microseconds] x 256
• BW is the lowest bandwidth of the links along the
paths:
BW = [10,000,000 / (bandwidth in kbps)] x 256
ABCD Least Bandwidth 64 kbps, Total Delay
6,000
7
Metric= [10 /64 + 6000] x 256=41,536,000
A X Y Z D Least BW 256 kbps, Total Delay 8,000
7
Metric= [10 /256 + 8000] x 256=12,048,000
Stable Network
Replies returns to D,
So D can finally take a decision
198
Ahmed Nabil
Timers :
Hello & dead timers
(config-if)# ip hello-interval eigrp <AS> <sec>
(config-if)# ip hold-time eigrp <AS> <sec>
EIGRP Offset Lists, the final tool for manipulating the EIGRP
metrics , allow an engineer to simply add a value–an offset, if
you will-to the calculated integer metric for a given prefix. To
do so, an engineer can create and enable an EIGRP Offset
List that defines the value to add to the metric, plus some
rules regarding which routes should be matched and
therefore have the value added to their computed FD.
An Offset List can perform the following functions:
■ Match prefixes/prefix lengths using an IP ACL, so that the
offset is applied only to routes matched by the ACL with a
permit clause
■ Match the direction of the Update message, either sent
(out) or received (in)
■ Match int interface on which the Update is sent or received
■ Set the integer metric added to the calculation for both the
FD and RD calculations for the route
The configuration itself uses the following command in
EIGRP configuration mode, in addition to any referenced IP
ACLs:
(config-roiuter)#offset-list {access-list-number | access-list-
name} {in | out} offset [interfacetype interface-number]
Example:
WAN1(config)#access-list 11 permit 10.11.1.0
WAN1(config)#router eigrp 1
WAN1(config-router)#offset-list 11 in 3 Serial0/0/0.1
WAN1(config-router)#end
Mar 2 11:34:36.667: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1:
Neighbor 10.1.1.2
(Serial0/0/0.1) is resync: peer graceful-restart
200
Ahmed Nabil
Before using the offset list
WAN1#show ip eigrp topo 10.11.1.0/24
IP-EIGRP (AS 1): Topology entry for 10.11.1.0/24
State is Passive, Query origin flag is 1, 1 Successor(s), FD is
2172416
Routing Descriptor Blocks:
10.1.1.2 (Serial0/0/0.1), from 10.1.1.2, Send flag is 0x0
Composite metric is (2172416/28160), Route is Internal
Ahmed Nabil
• Configuration:
(config)# router eigrp <AS no.>
! Up to 32 process (AS) can be configured on the same
router !
(config-router)# network <ip> [<w.c.m>]
Example 1
Example 2
202
Ahmed Nabil
Auto and Manual summary:
(config-router)# no auto-summary
(config-if)# ip summary-address eigrp <AS> <ip> <mask>
[admin distance]
172.16.2.0
• Point-to-point links
Treats bandwidth as T1 by default, so it is better to
manually configure bandwidth as the real BW, using
(config-if)#bandwidth <BW in units of kbps>
• NBMA
- Point-to-point links
Treats bandwidth as T1 by default, so it is better to
manually configure bandwidth as the CIR of the PVC
-Multipoint links (Frame Relay, ATM)
EIGRP uses the bandwidth on the main interface divided
by the number of neighbors on that interface to get the
bandwidth information per neighbor,
So for Multipoint interfaces with non-uniform CIRs
Convert to point-to-point configuration or
manually configure bandwidth by multiplying the lowest
CIR by the number of PVCs
204
Ahmed Nabil
NBMA point to point links, need to configure BW of PVC
on each subinterface
206
Ahmed Nabil
The previous figure on the left illustrates what would
happen before this feature was introduced. Router A
sends a query for network 10.1.1.0/24 to router B.
Router B has no entry for this network, so it queries
router C. If problems exist between router B and C, the
reply packet from router C to router B may be delayed
or lost. Router A has no visibility of downstream
progress and
assumes that the lack of response indicates problems
with router B. After the router A 3-minute active timer
expires, the neighbor relationship with router B is
reset, along with all known routes from router B.
By contrast, with the active process enhancement
feature, router A queries downstream router B (with an
SIA-Query) at the midway point of the active timer (1.5
minutes by default) about the status of the route.
Router B responds (with an SIA-Reply) that it is
searching for a replacement route. Upon receiving this
SIA-Reply response packet, router A validates the
status of router B and does not terminate the neighbor
relationship.
Meanwhile router B sends up to three SIA-Queries to
router C. If they go unanswered, router B
terminates the neighbor relationship with router C.
Router B then updates router A with an
SIA-Reply indicating that the network 10.1.1.0/24 is
unreachable. Routers A and B remove the
active route from their topology tables. The neighbor
relationship between routers A and B
remains intact.
207
Ahmed Nabil
Defining stub networks
If network 10.1.1.0/24 in a topology like the one shown below
fails, all routers will Stuck In waiting for each others replies
208
Ahmed Nabil
Example: eigrp stub Parameters
If stub connected is
configured:
• B will advertise
10.1.2.0/24 to A.
• B will not advertise
10.1.2.0/23, 10.1.3.0/23, or
10.1.4.0/24.
If stub summary is
configured:
• B will advertise
10.1.2.0/23 to A.
• B will not advertise
10.1.2.0/24, 10.1.3.0/24,
or 10.1.4.0/24.
If stub static is
configured:
• B will advertise
10.1.4.0/24 to A.
• B will not advertise
10.1.2.0/24, 10.1.2.0/23,
or 10.1.3.0/24.
If stub receive-only is
configured:
• B will not advertise
anything
to A, so A needs to have a
static route to the
networks
behind B to reach them. 209
Ahmed Nabil
Router Authentication
• Many routing protocols support authentication such that a
router authenticates the source of each routing update
packet that it receives.
• Simple password authentication is supported by:
– IS-IS
– OSPF
– RIPv2
• MD5 authentication is supported by:
– OSPF
– RIPv2
– BGP
– EIGRP
Simple Password vs. MD5 Authentication
• Simple password authentication:
– Router sends packet and key.
– Neighbor checks whether key matches its key.
– Process not secure.
• MD5 authentication:
– Configure a key (password) and key ID; router generates a
message digest, or hash, of the key, key ID and message.
– Message digest is sent with packet; key is not sent.
– Process OS secure.
EIGRP MD5 authentication:
• Router generates a message digest, or hash, of the key,
key ID, and message.
• EIGRP allows keys to be managed using key chains.
• Specify key ID (number), key, and lifetime of key.
• First valid activated key, in order of key numbers, is used.
210
Ahmed Nabil
Configuring EIGRP MD5 Authentication
Router(config-if)#
ip authentication mode eigrp autonomous-system md5
• Specifies MD5 authentication for EIGRP packets
Router(config-if)#
ip authentication key-chain eigrp autonomous-system
name-of-chain
• Enables authentication of EIGRP packets using key in the
Keychain
Router(config-keychain-key)#
accept-lifetime start-time {infinite | end-time | duration
seconds}
• Optional: Specifies when key will be accepted for received
packets
Router(config-keychain-key)#
send-lifetime start-time {infinite | end-time | duration
seconds}
• Optional: Specifies when key can be used for sending packets
211
Ahmed Nabil
EIGRP Authentication Configuration Checklist
The EIGRP authentication configuration process requires several
commands, which are summarized as follows:
Step 1. Create an (authentication) key chain:
Create the chain and give it a name with the key chain name global
command (also puts the user into key chain config mode). The name
does not have to match on the neighboring routers.
Create one or more key numbers using the key number command in
key chain configuration mode. The key numbers do not have to
match on the neighboring routers.
Define the authentication key’s value using the key-string value
command in key configuration mode. The key strings must match on
the neighboring routers.
(Optional) Define the lifetime (time period) for both sending and
accepting each key string.
Step 2. Enable EIGRP MD5 authentication on an interface, for a
particular EIGRP ASN, using the ip authentication mode eigrp asn
md5 interface subcommand.
Step 3. Refer to the correct key chain to be used on an interface
using the ip authentication key-chain eigrp asn name-of-chain
interface subcommand.
The configuration at Step 1 is fairly detailed, but Steps 2 and 3 are
relatively simple. Essentially, IOS configures the key values
separately (Step 1) and then requires an interface subcommand
to refer to the key values. To support the ability to have multiple
keys, and even multiple sets of keys, the configuration includes the
concept of a key chain and multiple keys on each key chain.
Key Chain Time-Based Logic The key chain configuration concept,
as outlined in Step 1, allows the engineer to migrate from one key
value to another over time. Just like a real key chain that has
multiple keys, the IOS key chain concept allows the configuration of
multiple keys—each identified with a number. If no lifetime has been
configured for a key, it is considered to be
valid during all time frames. However, when a key has been
defined with a lifetime, the key is valid only during the valid
lifetime.
The existence of multiple keys in a key chain, and the existence
of valid lifetimes for each key, can cause some confusion about
when the keys are used. The rules can be summarized
as follows:
■ Sending EIGRP messages: Use the lowest key number among
all currently valid keys.
■ Receiving EIGRP message: Check the MD5 digest using ALL
currently valid keys.
R1 R2
<output omitted> <output omitted>
key chain R1chain key chain R2chain
key 1 key 1
key-string firstkey key-string firstkey
accept-lifetime 04:00:00 Jan 1 2006 accept-lifetime 04:00:00 Jan 1 2006
infinite infinite
send-lifetime 04:00:00 Jan 1 2006 send-lifetime 04:00:00 Jan 1 2006
04:01:00 Jan 1 2006 infinite
key 2 key 2
key-string secondkey key-string secondkey
accept-lifetime 04:00:00 Jan 1 2006 accept-lifetime 04:00:00 Jan 1 2006
infinite infinite
send-lifetime 04:00:00 Jan 1 2006 send-lifetime 04:00:00 Jan 1 2006
infinite infinite
<output omitted> <output omitted>
interface FastEthernet0/0 interface FastEthernet0/0
ip address 172.16.1.1 255.255.255.0 ip address 172.17.2.2 255.255.255.0
! !
interface Serial0/0/1 interface Serial0/0/1
bandwidth 64 bandwidth 64
ip address 192.168.1.101 ip address 192.168.1.102 255.255.255.224
255.255.255.224 ip authentication mode eigrp 100 md5
ip authentication mode eigrp 100 md5 ip authentication key-chain eigrp 100
ip authentication key-chain eigrp 100 R2chain
R1chain !
! router eigrp 100
router eigrp 100 network 172.17.2.0 0.0.0.255
network 172.16.1.0 0.0.0.255 network 192.168.1.0
network 192.168.1.0 auto-summary
auto-summary
Note: R1 key id 1 will expire after 1 minute for sent updates
R1#debug eigrp packets
EIGRP Packets debugging is on
(UPDATE, REQUEST, QUERY, REPLY, HELLO, IPXSAP, PROBE, ACK, STUB, SIAQUERY, SIAREPLY)
*Jan 21 16:38:51.745: EIGRP: received packet with MD5 authentication, key id = 1
*Jan 21 16:38:51.745: EIGRP: Received HELLO on Serial0/0/1 nbr 192.168.1.102
*Jan 21 16:38:51.745: AS 100, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 pe
erQ un/rely 0/0
215
Ahmed Nabil
• Troubleshooting:
#show ip route
216
Ahmed Nabil
#show ip protocols
RouterA# show ip protocols
218
Ahmed Nabil
Verifying EIGRP Operations:
Unstable Network
RouterA# debug ip eigrp
219
Ahmed Nabil
Verifying EIGRP Operations:
Unstable Network
RouterA# debug ip eigrp
220
Ahmed Nabil
EIGRP for IPv6
Cisco originally created EIGRP to advertise routes for IPv4, IPX, and
AppleTalk. This original EIGRP architecture easily allowed for yet
another Layer 3 protocol, IPv6, to be added. As a result, Cisco did
not have to change EIGRP significantly to support IPv6, so
many similarities exist between the IPv4 and IPv6 versions of EIGRP.
223
#sh ip route
D 2005::/64 [90/2684416]
via FE80::11FF:FE11:1111, Serial0/0/0.1
via FE80::22FF:FE22:2222, Serial0/0/0.2
D 2012::/64 [90/2172416]
via FE80::22FF:FE22:2222, Serial0/0/0.2
via FE80::11FF:FE11:1111, Serial0/0/0.1
D 2014::/64 [90/2681856]
via FE80::11FF:FE11:1111, Serial0/0/0.1
D 2015::/64 [90/2681856]
via FE80::11FF:FE11:1111, Serial0/0/0.1
! lines omitted for brevity...
D 2099::/64 [90/2174976]
via FE80::22FF:FE22:2222, Serial0/0/0.2
via FE80::11FF:FE11:1111, Serial0/0/0.1
! show ipv6 protocols displays less info than its IPv4 cousin.
R3# show ipv6 protocols
IPv6 Routing Protocol is “eigrp 9”
EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
EIGRP maximum hopcount 100
EIGRP maximum metric variance 1
Interfaces:
FastEthernet0/0
Serial0/0/0.1
Serial0/0/0.2
Redistribution:
None
Maximum path: 16
Distance: internal 90 external 170
243
Ahmed Nabil
VRF-Lite/EVN
Service providers often need to allow their customers’ traffic to pass through
their cloud without one customer’s traffic (and corresponding routes) exposed to
another customer. Similarly, enterprise networks might need to segregate various
application types, such as keeping voice and video traffic separate from data.
These are just a couple of scenarios that could benefit from the Cisco Virtual
Routing and Forwarding (VRF) feature. VRF allows a single physical router to
host multiple virtual routers, with those virtual routers logically isolated from one
another, each with its own IP routing table.
EVN Compnents:
-EVN tag (as route-target in vrf), but use dot1q tag .
-EVN Trunk
- Route replication (for cpmplex VRFs or Shared Services VRF as DHCP, DNS
and Server farm that required multiple VRF to use the servers VRF)
An EVN uses a Virtual Network Trunk (VNET Trunk) to carry traffic for each
virtual network, and eliminates the need to manually configure a subinterface for
each virtual network on all routers (which was a requirement with VRF-Lite).
Traffic flowing over a VNET Trunk is tagged with a VNET tag, identifying the
virtual network to which the traffic belongs. An EVN router connects to a Cisco
Catalyst switch through an 802.1Q trunk, with the different VLANs on the
802.1Q trunk carrying traffic for the different virtual networks.
R1 (config)#interface Gi0/0.1
(config-subif)# encapsulation dot1q 100
(config-subif)# vrf forwarding data
(config-subif)#ip address ip mask
R1 (config)#interface Gi0/0.2
(config-subif)# encapsulation dot1q 200
(config-subif)# vrf forwarding voice
(config-subif)#ip address ip mask
245
Ahmed Nabil
VRF (Virtual Routing and Forwarding):
a new technology used for network infrastructure virtualization
In recent years, virtualization has become a hot topic in the IT industry. Today’s
data centers commonly use virtualization technologies (for example, VMware
and Hyper-V) to allow multiple server instances (possibly running different
operating systems) to run on a single physical server. This can make for a much
more efficient use of hardware resources.
Interestingly, in addition to virtualizing server instances, you can virtualize
networks. Cisco supports a technology called Virtual Routing and Forwarding
(VRF), which allows a single router to run multiple virtual router instances. Each
virtual router instance can have its own configuration and its own IP routing
process.
VRF is therefore able t o segment networks and isolate paths as needed. The
capability to completely isolate one network from another (even though the
networks use the same infrastructure devices) has obvious security benefits.
Note: Finally VRF allow single physical router tohost multiple virtual
routers with those virtual routers logically isolated with their own routing
tables.
This is mainly used by providers to separate customers data and routes.
so, VRF benefits are:
- Simplified L3 network Virtualization
- Improve shared service
- enhance management and troubleshooting
246
Ahmed Nabil
VRF Configuration:
(config)#ip vrf A
(config-vrf)#route-target 1:1
(config)#int S0/1
(config-if)#ip vrf forwarding A
(config-if)#ip address ip mask
(config)#ip vrf B
(config-vrf)#route-target 1:2
(config)#int S0/2
(config-if)#ip vrf forwarding B
(config-if)#ip address ip mask
Route targets can me mapped with either MPLS Label or dot1q Ethernet tag
for incoming data to the required VRF
247
Ahmed Nabil
Remote Connectivity Overview
The voice, video, and data commonly sent between remote offices and
central sites often demand low latency and easy provisioning, all while
maintaining a low cost. Traditional WAN solutions (for example, leased
lines, Frame Relay, and ATM) typically fail to simultaneously meet all these
requirements. Fortunately, a variety of VPN technologies fit nicely into such
a design.
This section categorizes various VPN technologies. Then, the remainder of
this chapter examines these technologies in a bit more detail.
MPLS-Based Virtual Private Networks
Multiprotocol Label Switching (MPLS) is a technology commonly used by
service providers, although many large enterprises also use MPLS for their
backbone network. MPLS makes forwarding decisions based on labels rather
than IP addresses. Specifically, a 32-bit label is inserted between a frame’s
Layer 2 and Layer 3 headers. As a result, an MPLS header is often called a
shim header, because it is stuck in between two existing headers.
MPLS-based VPNs can be grouped into one of two primary categories:
Layer 2 MPLS VPNs
Layer 3 MPLS VPNs
These two approaches are discussed in another course :)
GRE
As its name suggests, a Generic Routing Encapsulation (GRE) protocol
number 47, tunnel can encapsulate nearly every type of data that you could
send out of a physical router interface. In fact, GRE can encapsulate any
Layer 3 protocol, which makes it very flexible.
GRE by itself does not provide any security for the data it transmits;
however, a GRE packet can be sent over an IPsec VPN, causing the GRE
packet (and therefore its contents) to be protected. Such a configuration is
commonly used, because IPsec can only protect unicast IP packets. This
limitation
causes issues for routing protocols that use IP multicasts. Fortunately, a
GRE tunnel can encapsulate IP multicast packets. The resulting GRE
packet is an IP unicast packet, which can then be protected by an IPsec
tunnel.
249
Ahmed Nabil
As an example, consider Routers R1 and R2 need to form an Open
Shortest Path First (OSPF) neighborship across the service provider’s
cloud. Additionally, traffic between these two routers needs to be
protected. While IPsec can protect unicast IP traffic, OSPF
communicates through IP multicasts. Therefore, all traffic between
Routers R1 and R2 (including the OSPF multicasts) is encapsulated
inside of a GRE tunnel. Those GRE packets, which are unicast IP
packets, are then sent across, and protected by, an IPsec tunnel.
R1
interface Tunnel1
ip address 192.168.0.1 255.255.255.252
tunnel source Loopback0
tunnel destination 4.4.4.4
tunnel mode gre ...default tunnel mode
R4
interface Tunnel1
ip address 192.168.0.2 255.255.255.252
tunnel source Loopback0
tunnel destination 1.1.1.1
tunnel mode gre
250
Ahmed Nabil
DMVPN
252
Ahmed Nabil
NHRP
DMVPNs require that routers run Next Hop Resolution Protocol (NHRP), which
uses a client-server model. A router designated as a hub router acts as a server.
The remaining routers, designated as spokes, act as clients. NHRP spokes are
configured with the IP address of the NHRP hub, and when a spoke comes
online, it informs the hub of both a physical IP address (assigned to its physical
interface) and a logical IP address (assigned to its virtual tunnel interface) that are
going to be used for its tunnels.
the Headquarters router is acting as the hub, and the Branch A, Branch B, and
Branch C routers are acting as spokes. When the spokes come online, they
each advertise the IP address of their physical interface that is going to be used
for tunnel formation, along with the IP address of the virtual tunnel interface.
For example, the Branch A router informs the Headquarters router that the IP
address of its virtual tunnel interface is 10.0.0.1, and it is available at a
physical interface’s IP address of 192.0.2.1. The Branch B and Branch C
routers send similar advertisements to the Headquarters router. As a result, the
Headquarters router populates its NHRP database.
253
Ahmed Nabil
the Branch C router needs to dynamically form a GRE tunnel with the Branch B
router. The Branch C router knows that the other end of the tunnel it wants to
form has an IP address of 10.0.0.2. However, the Branch C router does not know
the IP address of the physical interface on the Branch B router that corresponds to
the virtual tunnel’s IP address. The process of discovering the remote physical IP
address and the formation of the tunnel is as follows:
Step 1. The Branch C router sends an NHRP query to the hub router asking what
physical interface’s IP address is associated with a tunnel interface’s IP address of
10.0.0.2.
BR(config)int tunnel 0
BR(Config-if)#ip nhrp nhs 10.0.0.100 ip of nhrp server
BR(config-if)#ip nhrp map 10.0.0.100 private tunnel IP 100.1.1.1 real IP
BR (config-if )#ip nhrp map multicast 100.1.1.1 real IP ..to collect rest of
enteries from server
Step 2. The hub router (that is, the Headquarters router) checks its NHRP
database and responds to the query, telling the Branch C router that the physical
interface’s IP address corresponding to the tunnel interface IP address of 10.0.0.2
is 203.0.113.1, which is the IP address of the Branch B router.
HQ (config-if )#ip nhrp map multicast dynamic
Step 3. Having dynamically learned the IP address of the physical interface in the
Branch B router, the Branch C router sets up a GRE tunnel with the Branch B .
Router# show ip nhrp
192.168.0.2 255.255.255.255, tunnel 100 created 0:00:44 expire 1:59:15
Type: dynamic Flags: authoritative
NBMA address: 192.168.0.1 255.255.255.255, Tunnel10 created 0:10:04 expire
1:49:56
Type: static Flags: authoritative 254
Ahmed Nabil
IPsec
Security in a DMVPN is provided by IPsec.
(config)int tunnel 0
(config-if)#tunnel protection ipsec crypto map name
The following four security features are offered by IPsec:
Confidentiality: Data confidentiality is provided by encrypting data. If an
intruder intercepts the encrypted data, he would not be able to interpret the data.
Integrity: Data integrity ensures that data is not modified in transit. For example,
routers at each end of a tunnel could calculate a checksum value or a hash value
for the data, and if both routers calculate the same value, the data has most likely
not been modified in transit.
Authentication: Data authentication allows parties involved in a conversation to
verify that the other party is the party it claims to be.
Antireplay: IPsec uses antireplay protection to ensure that packets being sent are
not duplicate packets. For example, an attacker might capture packets that make
up a valid login to a host and attempt to play those packets back, so that he can
gain access to the host. However, IPsec uses sequence numbers to determine
whether a packet is to be considered a duplicate packet, and any duplicate
packets are not transmitted.
Of these IPsec services, encryption and authentication are particularly helpful in
a DMVPN network.
For example, encryption can help protect traffic flowing between sites (either over the
Internet or through a service provider’s cloud). Also, authentication can make sure that
GRE tunnels are not dynamically set up with undesired spokes.
IPsec uses a collection of protocols to provide its features. One of the primary
protocols used by IPsec is the Internet Key Exchange (IKE) protocol. Specifically,
IPsec can provide encryption between authenticated peers using encryption keys,
which are periodically changed. IKE does, however, allow an administrator to
manually configure keys.
There are two phases to establish an IPsec tunnel. During IKE Phase 1, a secure
Internet Security Association and Key Management Protocol (ISAKMP) session is
established. As part of this phase, the IPsec endpoints establish transform sets (that is, a
collection of encryption and authentication protocols), hash methods, and other
parameters needed to establish a secure ISAKMP session (sometimes called an
ISAKMP tunnel or an IKE Phase 1 tunnel). This collection of parameters is called a
security association (SA). With IKE Phase 1, the SA is bidirectional, meaning that the
255
same key exchange is used for data flowing across the tunnel in either direction. Ahmed Nabil
IKE Phase 2 occurs within the protection of an IKE Phase 1 tunnel. A session
formed during IKE Phase 2 is sometimes called an IKE Phase 2 tunnel, or simply
an IPsec tunnel. However, unlike IKE Phase 1, IKE Phase 2 performs
unidirectional SA negotiations, meaning that each data flow uses a separate key
exchange.
In addition to IKE, which establishes the IPsec tunnel, IPsec also relies on either
the Authentication Header (AH) protocol (IP protocol number 51) or the
Encapsulating Security Payload (ESP) protocol (IP protocol number 50). Both
AH and ESP offer origin authentication and integrity services, which ensure that
IPsec peers are who they claim to be and that data was not modified in transit.
The main distinction between AH and ESP, however, is encryption support. ESP
encrypts the original packet, while AH does not offer any encryption. As a result,
ESP is far more popular on today’s networks.
Step 1. PC1 sends traffic destined for PC2. Router1 classifies the traffic as
“interesting” traffic, which initiates the creation of an IPsec tunnel.
Step 2. Router1 and Router2 negotiate a security association (SA) used to form
an IKE Phase 1 tunnel, which is also known as an ISAKMP tunnel.
Step 3. Within the protection of the IKE Phase 1 tunnel, an IKE Phase 2 tunnel is
negotiated and set up. An IKE Phase 2 tunnel is also known as an IPsec tunnel.
Step 4. After the IPsec tunnel is established, interesting traffic (for example,
traffic classified by an ACL) flows through the protected IPsec tunnel. Note that
traffic not deemed interesting can still be sent between PC1 and PC2. However,
the noninteresting traffic is transmitted outside of the protection of the IPsec
tunnel.
Step 5. After no interesting traffic has been seen for a specified amount of time,
or if the IPsec SA is deleted, the IPsec tunnel is torn down. 256
Ahmed Nabil
R1# show crypto ipsec sa
interface: FastEthernet0/0
Crypto map tag: test, local addr. 30.1.1.1
local ident (addr/mask/prot/port): (20.1.1.0/255.255.255.0/0/0)
remote ident (addr/mask/prot/port): (10.1.1.0/255.255.255.0/0/0)
current_peer: 30.1.1.2
PERMIT, flags=
{origin_is_acl,}
#pkts encaps: 7647918, #pkts encrypt: 7647918, #pkts digest 7647918
#pkts decaps: 7640382, #pkts decrypt: 7640382, #pkts verify 7640382
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0,
#pkts decompress failed: 0, #send errors 1, #recv errors 0
local crypto endpt.: 30.1.1.1, remote crypto endpt.: 30.1.1.2
path mtu 1500, media mtu 1500
current outbound spi: 3D3
inbound esp sas:
spi: 0x136A010F(325714191)
transform: esp-3des esp-md5-hmac
,
in use settings ={Tunnel, }
slot: 0, conn id: 3442, flow_id: 1443, crypto map: test
sa timing: remaining key lifetime (k/sec): (4608000/52)
IV size: 8 bytes
replay detection support: Y
inbound ah sas:
inbound pcp sas:
inbound pcp sas:
outbound esp sas:
spi: 0x3D3(979)
transform: esp-3des esp-md5-hmac
257
Ahmed Nabil
The End
Finally I would like to thank all of my beloved
friends whom read that book and I hope you all
get the full benefit from that training, you are
the future, please make our future reaches its
best, don't forget our famous rule “one is none,
two are one”, by respect & keeping morals we
will be all together over the top.
Always Remember me with the best
God bless you All
Ahmed Nabil
DoN
Cisco ip routing
(Route Course)
Eng.Ahmed Nabil
DoN
259
Ahmed Nabil