3 IP Routing
3 IP Routing
COM/C/NETWORKJOURNEY
TOPICS COVERED:
IP ROUTING ESSENTIALS
Dynamic IP routing protocols distribute network topology information between routers and provide
updates without intervention when a topology change in the network occurs.
Design requirements or hardware limitations may restrict IP routing to static routes, which do not
accommodate topology changes very well and can burden network engineers, depending on the size
of the network. With dynamic routing protocols, routers try to select the best loop-free path on
which to forward a packet to its destination IP address.
The common dynamic routing protocols found on most routing platforms today are as follows:
• Routing Information Protocol Version 2 (RIPv2)
• Enhanced Interior Gateway Routing (EIGRP)
• Open Shortest Path First (OSPF)
• Intermediate System-to-Intermediate System (IS-IS)
• Border Gateway Protocol (BGP)
With the exception of BGP, the protocols in this list are designed and optimized for routing within an
autonomous system and are known as Interior Gateway Protocols (IGPs).
BGP is an EGP protocol but can also be used within an autonomous system. If BGP exchanges routes
within an autonomous system, it is known as an interior BGP (iBGP) session. If it
exchanges routes between different autonomous systems, it is known as an exterior BGP (eBGP)
session.
Distance vector routing protocols, such as RIP {Routing Information Protocol}, advertise routes as
vectors, where distance is a metric (or cost) such as hop count, and vector is the next-hop router’s IP
used to reach the destination:
• Distance: The distance is the route metric to reach the network.
• Vector: The vector is the interface or direction to reach the network.
When a router receives routing information from a neighbor, it stores it in a local routing database
as it is received, and the distance vector algorithm (such as the Bellman-Ford and Ford-Fulkerson
algorithms) is used to determine which paths are the best loop-free paths to each reachable
destination. When the best paths are determined, they are installed into the routing table and are
advertised to each neighbor router.
Routers running distance vector protocols advertise the routing information to their neighbors from
their own perspective, modified from the original route received.
Therefore, a distance vector protocol does not have a complete map of the whole network; instead,
its database reflects that a neighbor router knows how to reach the destination network and how
far the neighbor router is from the destination network.
The advantage of distance vector protocols is that they require less CPU and memory and can run on
low-end routers.
A distance vector protocol selects paths purely based on distance. It does not account for link speeds
or other factors.
The link between R1 and R7 is a serial link with only 64 Kbps of bandwidth, and all of the other links
are 1 Gbps Ethernet links. RIP does not take this into consideration and forwards traffic across this
link, which will result in packet loss when that link is oversubscribed.
The diffusing update algorithm (DUAL) is an Advanced distance vector algorithm that EIGRP uses to
calculate the shortest path to a destination within a network.
EIGRP advertises network information to its neighbors as other distance vector protocols do, but it
has some enhancements, as its name suggests. The following are some of the enhancements
introduced into this algorithm compared to other distance vector algorithms:
• It offers rapid convergence time for changes in the network topology.
• It sends updates only when there is a change in the network. It does not send full routing
table updates in a periodic fashion, as distance vector protocols do.
• It uses hellos and forms neighbor relationships just as link-state protocols do.
• It uses bandwidth, delay, reliability, load, and maximum transmission unit (MTU) size instead
of hop count for path calculations.
• It has the option to load balance traffic across equal- or unequal-cost paths.
EIGRP is sometimes referred to as a hybrid routing protocol because it has characteristics of both
distance vector and link-state protocols.
R3 is trying to forward packets to the 192.168.1.0/24 network. If the routing domain used a distance
vector routing protocol, it would take the R3→R1→R7 path, which is only two hops away, rather
than the path R3→R1→R2→R7 path, which is three hops away. But the R3→R1→R7 path cannot
support traffic over 64 kbps. While the R3→R1→R2→R7 path is longer, it provides more bandwidth
and does not have as much delay (because of the serialization process on lower-speed interfaces)
and is the path selected by EIGRP.
Link-State Algorithms
A link-state dynamic IP routing protocol advertises the link state and link metric for each of its
connected links and directly connected routers to every router in the network.
OSPF and IS-IS are two link-state routing protocols commonly used in enterprise and service
provider networks. OSPF advertisements are called link-state advertisements (LSAs), and IS-IS
uses link-state packets (LSPs) for its advertisements.
As a router receives an advertisement from a neighbor, it stores the information in a local database
called the link-state database (LSDB) and advertises the link-state information on to each of its
neighbor routers exactly as it was received. The link-state information is essentially flooded
throughout the network, unchanged, from router to router, just as the originating router advertised
it. This allows all the routers in the network to have a synchronized and identical map of the
network.
Using the complete map of the network, every router in the network then runs the Dijkstra shortest
path first (SPF) algorithm to calculate the best shortest loop-free paths. The link-state algorithm then
populates the routing table with this information.
Due to having the complete map of the network, link-state protocols usually require more CPU and
memory than distance vector protocols, but they are less prone to routing loops and make better
path decisions.
A path vector protocol such as BGP is similar to a distance vector protocol; the difference is that
instead of looking at the distance to determine the best loop-free path, it looks at various BGP path
attributes.
BGP path attributes include autonomous system path (AS_Path), multi-exit discriminator (MED),
origin, next hop, local preference, atomic aggregate, and aggregator.
A path vector protocol guarantees loop-free paths by keeping a record of each autonomous system
that the routing advertisement traverses.
Any time a router receives an advertisement in which it is already part of the AS_Path, the
advertisement is rejected because accepting the AS_Path would effectively result in a routing loop.
1. R1 (AS 1) advertises the 10.1.1.0/24 network to R2 (AS 2). R1 adds the AS 1 to theAS_Path during the
network advertisement to R2.
2. R2 advertises the 10.1.1.0/24 network to R4 and adds AS 2 to the AS_Path during the network
advertisement to R4.
3. R4 advertises the 10.1.1.0/24 network to R3 and adds AS 4 to the AS_Path during the network
advertisement to R3.
4. R3 advertises the 10.1.1.0/24 network back to R1 and R2 after adding AS 3 to the AS_Path during the
network advertisement.
5. As R1 receives the 10.1.1.0/24 network advertisement from R3, it discards the route advertisement
because R1 detects its AS (AS 1) in the AS_Path “3 4 2 1” and considers the advertisement as a loop.
R2 discards the 10.1.1.0/24 network advertisement from R3 as it detects its AS (AS 2) in the AS_Path
“3 4 2 1” and considers it a loop, too.
The RIB is composed of routes presented from the routing protocol processes. Path selection has
three main components:
1. Longest Match: The prefix length represents the number of leading binary bits in the subnet
mask that are in the on position.
2. Administrative distance: Administrative distance (AD) is a rating of the trustworthiness of a
routing information source. If a router learns about a route to a destination from more than
one routing protocol, and all the routes have the same prefix length, then the AD is
compared.
3. Metrics: A metric is a unit of measure used by a routing protocol in the best-path
calculation. The metrics vary from one routing protocol to another.
1. Longest match
In the figure, a packet is destined for 172.16.0.10. The router has three possible routes that
match this packet: 172.16.0.0/12, 172.16.0.0/18, and 172.16.0.0/26.
Of the three routes, 172.16.0.0/26 has the longest match and is therefore chosen to forward the
packet.
Remember, for any of these routes to be considered a match there must be at least the number
of matching bits indicated by the subnet mask of the route.
2. Administrative distance
Administrative distance is what is used to select the best path when a router has two different paths
to the same destination via two different routing protocols.
Most routing protocols are not compatible with other protocols.
In a network with multiple routing protocols, being able to select the best path between multiple
protocols is critical.
Administrative distance defines the reliability of a routing protocol.
Each routing protocol is prioritized in order of most to least reliable (believable) with the help of an
administrative distance value.
IPv6 uses the same distances as IPv4.
Connected 0
Static 1
EIGRP (internal) 90
OSPF 110
IS-IS 115
RIP 120
3. Metric
The metric is a value produced by the routing protocol's algorithm. The metric value determines the
best path to a destination network within a routing protocol.
To determine the metric:
• RIP uses hop count
• EIGRP uses 256*(Bandwidth + Delay) for calculating cost(metric)
• OSPF uses {Reference bandwidth/Interface BW}
Reference BW=100Mbps
Metric is used to compare routes to a destination by the same routing protocol.
Lower values indicate preferred routes.
STATIC ROUTING
Static routes provide precise control over routing but may create an administrative burden as the
number of routers and network segments grow.
Using static routing requires zero network bandwidth because implementing manual route entries
does not require communication with other routers.
Unfortunately, because the routers are not communicating, there is no network intelligence. If a link
goes down, other routers will not be aware that the network path is no longer valid. Static routes are
useful when
• Dynamic routing protocols cannot be used on a router because of limited router CPU or
memory
• Routes learned from dynamic routing protocols need to be superseded
R1 indicates that the 10.22.22.0/24 network is reachable via the S1/0 interface, and R2 indicates that
the 10.11.11.0/24 network is reachable via the S1/0 interface.
The recursive lookup occurs when the router queries the RIB to locate the route toward the next-
hop IP address (connected, static, or dynamic) and then cross-references the adjacency table.
Recursive static routes are configured with the command ip route network subnet-mask next-hop-ip.
Recursive static routes require the route’s next-hop address to exist in the routing table to install the
static route into the RIB.
Advantage:
Static route recursion can simplify topologies if a link fails because it may allow the static route to
stay installed while it changes to a different outbound interface in the same direction as the
destination.
Disadvantage:
However, problems arise if the recursive lookup resolves to a different interface pointed in the
opposite direction.
To correct this issue, the static route configuration should use the outbound interface and the next-
hop IP address. A static route with both an interface and a next-hop IP address is known as a fully
specified static route.
If the interface listed is not in an up state, the router removes the static route from the RIB.
Specifying the next-hop address along with the physical interface removes the recursive lookup and
does not involve the ARP processing problems that occur when using only the outbound interface.
Fully specified static routes are configured with the command ip route network subnet-mask
interface-id next-hop-ip.
The AD is set on a static route by appending the AD as part of the command structure.
Using a floating static route is a common technique for providing backup connectivity for prefixes
learned via dynamic routing protocols.
A floating static route is configured with an AD higher than that of the primary route. Because the
AD is higher than that of the primary route, it is installed in the RIB only when the primary route is
withdrawn.
1. For example, a computer on the Internet sends a packet to 172.16.5.5, and the
172.16.5.0/24 network is not allocated on R1 or R2.
2. The ISP sends the packet to R1 because of the 172.16.0.0/20 static route; R1 looks into
the RIB, and the longest match for that prefix is the default route back to the ISP, so R1
sends the packet back to the ISP, creating the routing loop.
3. The service provider places a static route for the 172.16.0.0/20 network to R1’s interface
(192.168.1.1). R1 uses a static default route pointed toward the service provider
(192.168.1.2) and a static route to the 172.16.3.0/24 network via R2 (172.16.1.2).
Because R2 accesses all other networks through R1, a static default route points toward
R1’s interface (172.16.1.1).
To prevent the routing loop, a static route is added for 172.16.0.0/20, pointed to the Null0 interface
on R1.
Any packets matching the 172.16.0.0/20 network range that do not have a longer match in R1’s RIB
are dropped.
R1
ip route 0.0.0.0 0.0.0.0 Gi0/0 192.168.1.2
ip route 172.16.3.0 255.255.255.0 Gi0/2 172.16.1.2
ip route 172.16.0.0 255.255.240.0 Null0
1 172.16.1.1 * * *
2 172.16.1.1 * * *
! Output omitted for brevity
QUIZ
4. interface cost
5. path attributes
6. A router uses _________ as the first criterion for forwarding packets.
1. path metric
2. administrative distance
3. longest match
4. hop count
7. A router uses _________ as the second criterion for forwarding packets.
1. path metric
2. administrative distance
3. longest match
4. hop count
8. The ability to install multiple paths from the same routing protocol with the same path metric into
the RIB is known as ______.
1. per-packet load balancing
2. round-robin load balancing
3. equal-cost multipathing
4. parallel link forwarding
9. Which static route should be used to avoid unintentional forwarding paths with an Ethernet link
failure?
1. A directly attached static route
2. A recursive static route
3. A fully specified static route
4. A static null route
10. Virtual routing and forwarding (VRF) is useful with _____ addresses.
1. MAC
2. IPv4
3. IPv6
4. IPv4 and IPv6
• very low usage of network resources during normal operation; only hello packets are
transmitted on a stable network
• when a change occurs, only routing table changes are propagated, not the entire routing
table; this reduces the load the routing protocol itself places on the network
• rapid convergence times for changes in the network topology (in some situations
convergence can be almost instantaneous)
EIGRP is an advanced distance vector protocol, relying on the Diffused Update Algorithm (DUAL) to
calculate the shortest path to a destination within a network.
There are two major revisions of EIGRP, versions 0 and 1. Cisco IOS versions earlier than 10.3(11),
11.0(8), and 11.1(3) run the earlier version of EIGRP; some explanations in this paper may not apply
to that earlier version. We highly recommend using the later version of EIGRP, as it includes many
performance and stability enhancements.
Basic Theory
- Since the path through Router Three is three hops, and the path through Router One is two
hops, Router Two chooses the path through One and discards the information it learned
through Three.
- In case of R1 failure, it will take 15 seconds for Router Two to switch the path from Router
One to Router Three.
- EIGRP, instead of counting on full periodic updates to re-converge, builds a topology table
from each of its neighbor's advertisements (rather than discarding the data), and converges
by either looking for a likely loop-free route in the topology table, or, if it knows of no other
route, by querying its neighbors.
- Router Two saves the information it received from both Routers One and Three.
- It chooses the path through One as its best path (the successor) and the path through Three
as a loop-free path (a feasible successor).
- When the path through Router One becomes unavailable, Router Two examines its topology
table and, finding a feasible successor, begins using the path through Three immediately.
EIGRP FACTS:
- The rate at which EIGRP sends hello packets is called the hello interval, and you can adjust it
per interface with the ip hello-interval eigrp command.
- The hold time is the amount of time that a router will consider a neighbor alive without
receiving a hello packet.
- The hold time is typically three times the hello interval, by default, 15 seconds (5-second
hello) and 180 seconds (60-second hello). You can adjust the hold time with the ip hold-time
eigrp command.
- Note that if you change the hello interval, the hold time is not automatically adjusted to
account for this change - you must manually adjust the hold time to reflect the configured
hello interval.
- It is possible for two routers to become EIGRP neighbors even though the hello and hold
timers do not match.
- The hold time is included in the hello packets so each neighbor should stay alive even
though the hello interval and hold timers do not match.
- To check EIGRP hello and hold timers
- EIGRP does not build peer relationships over secondary addresses. All EIGRP traffic is sourced
from the primary address of the interface.
There are no limitations on the number of neighbors that EIGRP can support. The actual number of
supported neighbors depends on the capability of the device, such as:
1. memory capacity
2. processing power
3. amount of exchanged information, such as the number of routes sent
4. topology complexity
5. network stability
Neighbor Discovery:
The basic problem with sending only routing updates is that you may not know when a path through
a neighboring router is no longer available. You cannot time out routes, expecting to receive a new
routing table from your neighbors. EIGRP relies on neighbor relationships to reliably propagate
routing table changes throughout the network; two routers become neighbors when they see each
other's hello packets on a common network. Command: show ip eigrp neighbor
Topology Table:
EIGRP, unlike RIP and IGRP, does not rely on the routing (or forwarding) table in the router to hold
all of the information it needs to operate. Instead, it builds a second table, the topology table, from
which it installs routes in the routing table.
To see the basic format of the topology table on a router running EIGRP, issue the show ip eigrp
topology command. The topology table contains the information needed to build a set of distances
and vectors to each reachable network, including:
• lowest bandwidth on the path to this destination as reported by the upstream neighbor
• total delay
• path loading
• path reliability
• minimum path maximum transmission unit (MTU)
• feasible distance
• reported distance
• route source (external routes are marked)
EIGRP Metrics:
EIGRP uses the minimum bandwidth on the path to a destination network and the total delay to
compute routing metrics.
Although you can configure other metrics, we do not recommend it, as it can cause routing loops in
your network.
The bandwidth and delay metrics are determined from values configured on the interfaces of
routers in the path to the destination network.
It starts with the two advertisements for this network: one through Router Four, with a minimum
bandwidth of 56 and a total delay of 2200; and the other through Router Three, with a minimum
bandwidth of 128 and a delay of 1200. Router One chooses the path with the lowest metric.
Let us compute the metrics. EIGRP calculates the total metric by scaling the bandwidth and delay
metrics. EIGRP uses the following formula to scale the bandwidth:
where bandwidth(i) is the least bandwidth of all outgoing interfaces on the route to the
destination network represented in kilobits.
where delay(i) is the sum of the delays configured on the interfaces, on the route to the
destination network, in tens of microseconds. The delay as shown in the show ip eigrp
topology or show interface commands is in microseconds, so you must divide by 10 before
you use it in this formula. Throughout this paper, we use delay as it is configured and shown
on the interface.
EIGRP uses these scaled values to determine the total metric to the network:
• metric = ([K1 * bandwidth + (K2 * bandwidth) / (256 - load) + K3 * delay] * [K5 / (reliability +
K4)]) * 256
Note: These K values should be used after careful planning. Mismatched K values prevent a neighbor
relationship from being built, which can cause your network to fail to converge.
Note: If K5 = 0, the formula reduces to Metric = ([k1 * bandwidth + (k2 * bandwidth)/(256 - load) +
k3 * delay]) * 256.
The default values for K are: These K values are only numbers to scale numbers in the metric
calculation
• K1 = 1
• K2 = 0
• K3 = 1
• K4 = 0
• K5 = 0
So, to reach Network A, Router One chooses the route through Router Three.
EIGRP Tables:
EIGRP maintains three tables. 1) Neighbor Table, 2) Topology Table and 3) Routing Table.
Neighbor Table:
Neighbor table includes all neighbors that is directly connected to router using EIGRP. In simple
words, next hop router and the interfaces.
Topology Table:
EIGRP uses this table to store all routes, which it learned from neighbors. It contains a list of all
destinations and routes advertised by neighboring routers. The EIGRP Topology table contains
everything that EIGRP has learned.
Routing Table:
EIGRP stores single best (Successor) route for each destination in this table. Router uses this table to
forward the packet. There is a separate routing table for each routed protocol.
H (Handle) Lists the neighbors in the order this router was learned
Address The IP address of the neighbors
Interface The interface of the local router on which this Hello packet was received
Hold The amount of time left before neighbor is considered in “down” status
Uptime How long the neighbor has been up
SRTT (Smooth Round Trip Time): The number of milliseconds it takes to send an EIGRP
packet to neighbor and receive an acknowledgment packet back
RTO (Retransmission Timeout): if a multicast has failed, then a unicast is sent to that
particular router, the RTO is the time in milliseconds that the router waits for an
acknowledgement of that unicast.
Q Cnt (Q Count): Shows the number of queued EIGRP packets. It is usually 0
Seq Num The sequence number of the last update EIGRP packet received
EIGRP uses metric to select the best route from all available routes for destination. Metric has five
components.1.Bandwidth, 2.Load, 3.Delay, 4.Reliability and 5.MTU. From these only bandwidth and
delay are by default enabled.
K Value Component Description
K1 Bandwidth Lowest bandwidth of route
K2 Load Worst load on route based on packet rate
K3 Delay Cumulative interface delay of route
K4 Reliability Worst reliability of route based on keep alive
K5 MTU Smallest MTU in path [Not used in route calculation]
Bandwidth (K1):
EIGPR picks lowest bandwidth from all outing-going interfaces of route to the destination network.
Bandwidth is amount of data that can be transmitted in a fixed amount of time.
Load (K2):
Load is a dynamic value that changes frequently. It is based on packet rate and bandwidth of
interface. It calculates the volume of traffic passing through the interface in comparison of maximum
capacity. It is expressed on a scale of 255 where 1 represent that an interface is empty and 255
represent that an interface is fully utilized. Since data flows from both directions, router maintains
two separate metric counters; Txload for outgoing traffic and Rxload for incoming traffic.
Delay (K3):
Delay reflects the time taken by a packet in crossing the interface. It is measured in fractions of
seconds.
Reliability (K4):
Just like load, reliability is also a dynamic value. It compares all successfully received frames against
all received frames. 100 % reliability indicates that all the frames, which we received, were good. We
do not have any issue with physical link. If we have any issue with physical link, this value will be
decrease.
MTU (K5):
MTU stands for Maximum Transmission Unit. It is advertised with routing update but it does not
actively participate in metric calculation.
Where Bandwidth = 10000000/bandwidth (i), where bandwidth (i) is the least bandwidth of all
outgoing interfaces on the route to the destination network represented in kilobits.
Delay = delay (i) where delay (i) is the sum of the delays configured on the interfaces, on the route to
the destination network, in tens of microseconds.
Commands Description
R6#show ip route eigrp First verify both routes in routing table
D 7.7.7.7 [90/156160] via 192.168.76.7, F0/1 Equal path load balancing
[90/156160] via 192.168.67.7, F0/0
R6(config)#interface FastEthernet 0/0 Enter interface mode
R6(config-if)# bandwidth 10000 Decrease the bandwidth to 10000
R6#show ip route eigrp Verify again only one path now
R6(config)#interface FastEthernet 0/0 Enter interface mode
R6(config-if)#no bandwidth 10000 Make the default bandwidth again
R6#show ip route eigrp Check again both path back
R6(config)#interface FastEthernet 0/0 Enter interface mode
R6(config-if)#delay 200 Increase the delay this time
R6#show ip route eigrp Verify again only one path now
R6(config)#interface FastEthernet 0/0 Enter interface mode
R6(config-if)#no delay 200 Make the default delay again
R6#show ip route eigrp First verify both routes in routing table
D 7.7.7.7 [90/156160] via 192.168.76.7, F0/1 Equal path load balancing
[90/156160] via 192.168.67.7, F0/0
R6(config)#router eigrp 1 Enter EIGRP mode
R6(config-router)#metric weights 0 1 1 1 1 1 Change k Values
R7(config)#router eigrp 1 Enter EIGRP mode
R7(config-router)#metric weights 0 1 1 1 1 1 Change K values
R6#show ip route eigrp Verify the eigrp routes different FD
D 7.7.7.7 [90/610]
R6(config)#interface FastEthernet 0/0 Enter interface mode
R6(config-if)# bandwidth 10000 Decrease the bandwidth to 10000
R6(config-if)#delay 200 Increase the delay Change metric
EIGRP uses five packet types in communication with its neighbors. The packet types are below.
Packet Description
Hello Used to identify neighbors. They are sent as periodic multicasts.
Update Used to advertise routes, only sent as multicasts when something is changed.
Ack Acknowledges receipt of an update.
Query Used to find alternate paths when all paths to a destination have failed.
Reply Used to response to query packets about routing information.
Hello:
Hello packets are used for neighbor discovery. As soon as the hello packets send and receive EIGRP
routers will try to form the neighbor adjacency. They are multicast to 224.0.0.10. By default, EIGRP
sends hello packets every 5 seconds.
Update:
Update packets contain routing information for destinations. EIGRP unicasts update packets to
newly discovered neighbors; otherwise, it multicasts update packets to 224.0.0.10 when a link or
metric changes. Update packets are acknowledged to ensure reliable transmission.
Query:
EIGRP sends query packets used to find alternate paths when all paths to a destination have failed.
Query packets are always multicast.
Reply:
EIGRP sends reply packets to respond to query packets. Reply packets provide a feasible successor to
the sender of the query. Reply packets are unicast to the sender of the query packet.
ACK:
ACK packets are used to acknowledge the receipt of update, query and reply packets. ACK packets
are sent by using unicast.
EIGRP Terminologies:
Advertised Distance (AD)/Reported Distance (RD): The cost from the neighbor to the destination.
Feasible Distance (FD): The total cost to reach a destination network.
Successor: The primary route used to reach a destination. The successor route is kept in the routing
table. Notice that successor is the best route to that destination.
Feasible Successor: The backup route. To be a feasible successor, the route must have an AD less
than the FD of the current successor route.
Router One sees that it has two routes to Network A: one through Router Three and another
through Router Four.
• The route through Router Four has a cost of 46277376 and a reported distance of 307200.
• The route through Router Three has a cost of 20307200 and a reported distance of 307200.
EIGRP Summarization:
Commands Description
R1(config)#router eigrp 1 Enter EIGRP mode
R1(config-router)#network 0.0.0.0 Advertise all networks
R1(config-router)#no auto-summary Disable auto summary feature
R2(config)#router eigrp 1 Enter EIGRP mode
R2(config-router)#network 0.0.0.0 Advertise all network
R2(config-router)#no auto-summary Disable auto summary feature
R1#show ip route eigrp View routing table for EIGRP all four networks of
172 present in table
Advantages of Summarization:
Saves Memory Routing tables will be smaller which reduces memory requirements.
Saves Bandwidth There are less routes to advertise so we save some bandwidth.
Saves CPU Cycles Less packets to process and smaller routing tables to work on.
Stability Prevents routing table instability due to flapping networks.
Manual Summarization:
The manual summarization is a process of creating a summary route that will be used to represent
multiple routes and can be used to reduce the sizes of routing tables in a network. Manual
summarization is configured differently on different protocols.
By default, EIGRP has auto summary feature enabled. Because of this, EIGRP automatically
summarizes networks at the classful boundary.
Advantages of EIGRP over other routing protocol like, OSPF doesn't support automatic
summarization and also OSFP can summarize routes only on ABRs and ASBRs.
EIGRP, where you can summarize routes on every router in an EIGRP network. Manual
summarization is configured on a per-interface basis on EIGRP.
Commands Description
R1(config)#router eigrp 1 Enter EIGRP mode
R1(config-router)#network 0.0.0.0 Advertise all networks
R1(config-router)#no auto-summary Disable auto summary feature
R2(config)#router eigrp 1 Enter EIGRP mode
R2(config-router)#network 1.0.0.0 Advertise only 1 network
R2(config-router)#no auto-summary Disable auto summary feature
R2#show ip route eigrp View routing table for EIGRP all four networks of
192.168. present
R1(config)#interface f0/0 Enter interface mode facing R2
R1(config-if)#ip summary-address eigrp 1 Enter summary route to send
192.168.0.0 255.255.248.0
R2#show ip route eigrp Check again routing table only summary route
192.168.0.0/21 only
Commands Description
(config)#router eigrp 1 Apply this on both R6 and R7
(config-router)#no auto-summary Disable auto summary
(config-router)#network 0.0.0.0 Enable EIGRP for all networks
R6#show ip route eigrp Check routing table for EIGRP equal 2 paths
R6#show ip eigrp topology Check EIGRP topology table for all paths
R6(config)#router eigrp 1 Enters EIGRP routing mode
R6(config‐router)# maximum-paths 1 To disable equal cost load balancing set 1
R6#show ip route eigrp Check routing table for EIGRP now 1 path
R6(config)#router eigrp 1 Enters EIGRP routing mode
R6(config‐router)# maximum-paths 4 Enable back equal cost load balancing
and 128, used for load balancing. The default is 1, which means equal-cost load balancing. The
multiplier defines the range of metric values that are accepted for load balancing.
Commands Description
(config)#router eigrp 1 Apply this on all R1,R2,R3,R4 & R5
(config-router)#no auto-summary Disable auto summary
(config-router)#network 0.0.0.0 Enable EIGRP for all networks
R1#show ip route eigrp Check routing table for EIGRP one path only
R1#show ip eigrp topology Check EIGRP topology table for all paths
412160 / 158720 = 2.6 Need variance 3 to install Ethernet1/0 path
R1(config)#router eigrp 1 Enters EIGRP routing mode
R1(config‐router)#variance 3 Set variance 3 to install other route
R1#show ip route eigrp Check routing table for EIGRP two path now
2300416 /158720 = 14.5 Need variance 15 to install S2/0 path
R1(config)#router eigrp 1 Enters EIGRP routing mode
R1(config‐router)#variance 15 Set variance 15 to install other route
R1#show ip route eigrp Check routing table for EIGRP three path now
R1#show ip route 5.5.5.5 EIGRP is sharing traffic f0/1 240, S2/0 17 and E1/0 92
proportion
R1#traceroute 5.5.5.5 Apply many time to check path changing
Let us do basic configuration of EIGRP protocols on cisco routers. Wildcard mask is 32 bits long. It is
inverted subnet masks, with the zero bits indicating that the corresponding bit position must match
the same bit position in the IP address. The one bits indicate that the corresponding bit position
does not have to match the bit position in the IP address.
To form a neighborship, EIGRP has these requirements:
1) Interface’s primary IP addresses must be on the same subnet.
2) Connected interface must not be passive.
3) Routers must use the same AS number.
4) Must pass authentication.
5) K-values must match.
Commands Description
R1(config)#router eigrp 1 Enter EIGRP mode
R1(config-router)#network 192.168.12.0 Advertise 192.168.12.0 network
R1(config-router)#network 1.1.1.0 Advertise 1.1.1.0 network
R1#show run | sec eigrp To verify by running configuration
router eigrp 1 EIGRP with AS 1
network 1.0.0.0 Its convert 1.1.1.0 network class A
network 192.168.12.0
R1(config)#router eigrp 1 Enter EIGRP mode
R1(config-router)#no network 1.1.1.0 Remove network
R1(config-router)#network 1.1.1.0 0.0.0.255 Advertise again with wild card
R1#show run | sec eigrp Verify by running configuration
router eigrp 1 EIGRP with AS 1
network 1.1.1.0 0.0.0.255 This time it’s not converted
R1(config)#router eigrp 1 Enter EIGRP mode
R1(config-router)#no network 1.1.1.0 0.0.0.255 Remove network
R1(config-router)#network 1.1.1.0 255.255.255.0 With subnetmask not with wildcard
R1#show run | sec eigrp Verify by running configuration
router eigrp 1 EIGRP with AS 1
network 1.1.1.0 0.0.0.255 IOS converted subnetmask to wildcard
R1(config)#router eigrp 1 Enter EIGRP mode with AS 1
R1(config-router)#network 0.0.0.0 Advertise all networks
R2(config)#router eigrp 100 Enter EIGRP mode with AS 100
R2(config-router)#network 0.0.0.0 Advertise all networks, no neighbor
adjacency because of different AS
R1(config)#router eigrp 1 Enter EIGRP mode with AS 1
R1(config-router)#network 0.0.0.0 Advertise all networks
R1(config-router)# metric weights tos 1 1 1 1 1 Changing Metric Weights Again no neighbor
adjacency, K value mismatch
EIGRP Commands:
Commands Description
R1(config-router)#auto-summary Enable auto summarization feature
R1(config-router)#no auto-summary Disable auto summarization feature
R1(config-router)# metric weights tos k1 k2 k3 Adjusting the EIGRP Metric Weights
k4 k5
R1(config-router)# metric maximum-hops <1- Advertise greater than hops
255>
R1(config-router)#maximum-paths <1-32> Set the maximum equal paths
R1(config-router)#variance <1-128> Control unequal load balancing
R1(config-if)# ip hello-interval eigrp <asn> Changing EIGRP hello interval
<interval>
R1(config-if)# ip hold-time eigrp <asn> Changing EIGRP hold time interval
<interval>
R1#show ip eigrp neighbors Display the neighbor table in brief
R1#show ip eigrp neighbors detail Display the neighbor table in detail. To verify the
neighbor is configured as stub router
R1#show ip eigrp interfaces Display info about all EIGRP interfaces
R1#show ip eigrp interfaces s0/0 Display info EIGRP interface
R1#show ip eigrp interfaces 20 Display info EIGRP interfaces AS 20
R1#show ip eigrp topology Displays the topology table
R1#show ip eigrp traffic Displays EIGEP different packets
R1#show ip route eigrp Display EIGRP route from routing table
R1#debug eigrp fsm Displays the events related to FSM
R1#debug eigrp packet Displays EIGRP event packets
R1#no debug eigrp fsm Turn off FSM debug
R1#no debug eigrp packet Turn off EIGRP packets debug
OSPF hello packets are responsible for discovering and maintaining neighbors.
In most instances, a router sends hello packets to the AllSPFRouters address (224.0.0.5).
ROUTER ID
The OSPF router ID (RID) is a 32-bit number that uniquely identifies an OSPF router.
In some OSPF output commands, neighbor ID refers to the RID; the terms are synonymous.
The RID must be unique for each OSPF process in an OSPF domain and must be unique between
OSPF processes on a router.
The command clear ip ospf process restarts the OSPF process on a router so that OSPF can use the
new RID.
OSPF routers discover other neighbors via the OSPF hello packets.
An adjacent OSPF neighbor is an OSPF neighbor that shares a synchronized OSPF database between
the two neighbors.
Each OSPF process maintains a table for adjacent OSPF neighbors and the state of each router.
State Description
This is the first OSPF neighbor state. It means that no information (hellos) has
been received from this neighbor, but hello packets can still be sent to the
neighbor in this state.
1) Down During the fully adjacent neighbor state, if a router doesn't receive hello
packet from a neighbor within the RouterDeadInterval time
(RouterDeadInterval = 4*HelloInterval by default) or if the manually
configured neighbor is being removed from the configuration, then the
neighbor state changes from Full to Down.
This state specifies that the router has received a hello packet from its
neighbor, but the receiving router's ID was not included in the hello packet.
2) Init When a router receives a hello packet from a neighbor, it should list the
sender's router ID in its hello packet as an acknowledgment that it received a
valid hello packet.
At the end of this stage, the DR and BDR for broadcast and non-broadcast
multiacess networks are elected.
Once the DR and BDR are elected, the actual process of exchanging link state
information can start between the routers and their DR and BDR.
In this state, the routers and their DR and BDR establish a master-slave
relationship and choose the initial sequence number for adjacency formation.
The router with the higher router ID becomes the master and starts the
4) ExStart exchange, and as such, is the only router that can increment the sequence
number. Note that one would logically conclude that the DR/BDR with the
highest router ID will become the master during this process of master-slave
relation. Remember that the DR/BDR election might be purely by virtue of a
higher priority configured on the router instead of highest router ID. Thus, it
is possible that a DR plays the role of slave. And also note that master/slave
election is on a per-neighbor basis.
In the exchange state, OSPF routers exchange database descriptor (DBD)
packets. Database descriptors contain link-state advertisement (LSA) headers
only and describe the contents of the entire link-state database. Each DBD
packet has a sequence number which can be incremented only by master
5) Exchange which is explicitly acknowledged by slave. Routers also send link-state
request packets and link-state update packets (which contain the entire LSA)
in this state. The contents of the DBD received are compared to the
information contained in the routers link-state database to check if new or
more current link-state information is available with the neighbor.
In this state, the actual exchange of link state information occurs. Based on
the information provided by the DBDs, routers send link-state request
packets. The neighbor then provides the requested link-state information in
6) Loading
link-state update packets. During the adjacency, if a router receives an
outdated or missing LSA, it requests that LSA by sending a link-state request
packet. All link-state update packets are acknowledged.
In this state, routers are fully adjacent with each other. All the router and
network LSAs are exchanged and the routers' databases are fully
synchronized.
7) Full
Full is the normal state for an OSPF router. If a router is stuck in another
state, it is an indication that there are problems in forming adjacencies. The
only exception to this is the 2-way state, which is normal in a broadcast
network. Routers achieve the FULL state with their DR and BDR in
Multi-access networks such as Ethernet (LANs) and Frame Relay allow more than two routers to
exist on a network segment.
Such a setup could cause scalability problems with OSPF as the number of routers on a segment
increases.
Additional routers flood more LSAs on the segment, and OSPF traffic becomes excessive as OSPF
neighbor adjacencies increase.
If four routers share the same multi-access network, six OSPF adjacencies form, along with six
occurrences of database flooding on a network.
The number of edges formula, n(n – 1) / 2, where n represents the number of routers, is used to
identify the number of sessions in a full mesh topology.
If 5 routers were present on a segment, 5(5 – 1) / 2 = 10, then 10 OSPF adjacencies would exist for
that segment.
Continuing the logic, adding 1 additional router would makes 15 OSPF adjacencies on a network
segment.
Having so many adjacencies per segment consumes more bandwidth, more CPU processing, and
more memory to maintain each of the neighbor states.
DESINGATED ROUTER:
OSPF overcomes this inefficiency by creating a pseudonode (virtual router) to manage the adjacency
state with all the other routers on that broadcast network segment.
A router on the broadcast segment, known as the designated router (DR), assumes the role of the
pseudonode.
The DR reduces the number of OSPF adjacencies on a multi-access network segment because
routers only form a full OSPF adjacency with the DR and not each other.
The DR is responsible for flooding updates to all OSPF routers on that segment as the updates occur.
1. All OSPF routers (DR, BDR, and DROTHER) on a segment form full OSPF adjacency with the
DR and BDR.
2. As an OSPF router learns of a new route, it sends the updated LSA to the AllDRouters
(224.0.0.6) address, which only the DR and BDR receive and process, as illustrated in step 1.
The DR sends a unicast acknowledgment to the router that sent the initial LSA update, as
illustrated in step 2.
The DR floods the LSA to all the routers on the segment via the AllSPFRouters (224.0.0.5) address,
as shown in step 3.
OSPF CONFIGURATION
The configuration process for OSPF resides mostly under the OSPF process, but some OSPF options
go directly on the interface configuration submode. The command router ospf process-id defines
and initializes the OSPF process. The OSPF process ID is locally significant but is generally kept the
same for operational consistency. OSPF is enabled on an interface using two methods:
The OSPF network statement identifies the interfaces that the OSPF process will use and the area
that those interfaces participate in. The network statements match against the primary IPv4 address
and netmask associated with an interface.
A common misconception is that the network statement advertises the networks into OSPF; in
reality, though, the network statement is selecting and enabling OSPF on the interface. The
interface is then advertised in OSPF through the LSA. The network statement uses a wildcard
mask, which allows the configuration to be as specific or vague as necessary. The selection of
interfaces within the OSPF process is accomplished by using the command network ip-address
wildcard-mask area area-id.
The concept is similar to the configuration of Enhanced Interior Gateway Routing Protocol (EIGRP),
except that the OSPF area is specified. If the IP address for an interface matches two network
statements with different areas, the most explicit network statement (that is, the longest match)
preempts the other network statements for area allocation.
The connected network for the OSPF-enabled interface is added to the OSPF LSDB under the
corresponding OSPF area in which the interface participates. Secondary connected networks are
added to the LSDB only if the secondary IP address matches a network statement associated with
the same area.
router ospf 1
network 10.0.0.10 0.0.0.0 area 0
network 10.0.10.10 0.0.0.0 area 0
network 192.0.0.10 0.0.0.0 area 0
network 192.10.0.10 0.0.0.0 area 0
Interface-Specific Configuration
The second method for enabling OSPF on an interface for IOS is to configure it specifically on an
interface with the command ip ospf process-id area area-id [secondaries none]. This method also
adds secondary connected networks to the LSDB unless the secondaries none option is used.
This method provides explicit control for enabling OSPF; however, the configuration is not
centralized and increases in complexity as the number of interfaces on the routers increases. If a
hybrid configuration exists on a router, interface-specific settings take precedence over the network
statement with the assignment of the areas.
PASSIVE INTERFACES
Enabling an interface with OSPF is the quickest way to advertise a network segment to other OSPF
routers.
However, it might be easy for someone to plug in an unauthorized OSPF router on an OSPF-enabled
network segment and introduce false routes, thus causing havoc in the network.
Making the network interface passive still adds the network segment into the LSDB but prohibits the
interface from forming OSPF adjacencies.
A passive interface does not send out OSPF hellos and does not process any received OSPF packets.
The command passive interface-id under the OSPF process makes the interface passive, and the
command passive interface default makes all interfaces passive. To allow for an interface to process
OSPF packets, the command no passive interface-id is used.
The following list of requirements must be met for an OSPF neighborship to be formed:
• RIDs must be unique between the two devices. They should be unique for the entire OSPF
routing domain to prevent errors.
• The interfaces must share a common subnet. OSPF uses the interface’s primary IP address
when sending out OSPF hellos. The network mask (netmask) in the hello packet is used to
extract the network ID of the hello packet.
• The MTUs (maximum transmission units) on the interfaces must match. The OSPF protocol
does not support fragmentation, so the MTUs on the interfaces should match.
• The area ID must match for the segment.
• The DR enablement must match for the segment.
• OSPF hello and dead timers must match for the segment.
• Authentication type and credentials (if any) must match for the segment.
• Area type flags must match for the segment (for example, Stub, NSSA). (These are not
discussed in this book.)
A. Confirmation of Interfaces
It is a good practice to verify that the correct interfaces are running OSPF after making changes to
the OSPF configuration. The command show ip ospf interface [brief | interface-id] displays the
OSPF-enabled interfaces.
Field Description
Interface Interfaces with OSPF enabled
PID The OSPF process ID associated with this interface
Area The area that this interface is associated with
IP
The IP address and subnet mask for the interface
Address/Mask
Cost The cost metric assigned to an interface that is used to calculate a path metric
State The current interface state, which could be DR, BDR, DROTHER, LOOP, or Down
Nbrs F The number of neighbor OSPF routers for a segment that are fully adjacent
The number of neighbor OSPF routers for a segment that have been detected and
Nbrs C
are in a 2-Way state
The DROTHER is a router on the DR-enabled segment that is not the DR or the BDR; it is simply the
other router. DROTHERs do not establish full adjacency with other DROTHERs.
State
The second field is the DR, BDR, or DROTHER role if the interface requires a DR. For non-
DR network links, the second field shows just a hyphen (-).
Dead Time The time left until the router is declared unreachable.
Address The primary IP address for the OSPF neighbor.
Interface The local interface to which the OSPF neighbor is attached.
The next step is to verify the OSPF routes installed in the IP routing table. OSPF routes that install
into the Routing Information Base (RIB) are shown with the command show ip route ospf.
DAY#3 OSPF
ADVANCE OSPF
OSPF Networks Types
1. Broadcast
- This type of Network is by default enabled on every Ethernet interfaces
- Elects DR/BDR
- Uses Multicast 224.0.0.5
- Allows more than 2 routers on a link
- Timers: Hello = 10sec, Dead = 40sec
2. Point-to-Point
- Default for Serial and Tunnel interfaces
- Do not Elects DR/BDR
- Uses Multicast 224.0.0.5
- Only 2 routers allowed on a link
- Timers: Hello = 10sec, Dead = 40sec
3. Point-to-Multipoint Broadcast
- Do not Elects DR/BDR
- Multicast 224.0.0.5
- Allows more than 2 routers on a link
- Timers: Hello = 30sec, Dead = 120sec
- Automatic neighbor discovery so no need to configure OSPF neighbors yourself.
- No DR/BDR election since OSPF sees the network as a collection of point-to-point
links.
- Only a single IP subnet is used in the topology below.
- Make sure your frame-relay network is configured with the broadcast keyword.
4. Point-to-Multipoint Non-Broadcast
- Do not Elects DR/BDR
- Uses Unicast (neighbor statements)
- Allows more than 2 routers on a link
- Timers: Hello = 30sec, Dead = 120sec
- No Automatic neighbor discovery so you need to configure OSPF neighbors yourself!
- No DR/BDR election since OSPF sees the network as a collection of point-to-point
links.
- Only a single IP subnet is used in the topology above.
5. Non-Broadcast
- DR/BDR
- Timers: Hello = 30sec, Dead = 120sec
- Non-broadcast network type assume you are running a multi-access network.
- Couple of key things to remember here:
• Multi-access means we have to select a DR and BDR.
• Non-broadcast means that OSPF expects us to configure neighbors ourselves
6. Loopback
- Default enabled for loopback interfaces
- When used in OSPF, /32 is considered always
- To override this limitation, set network type to “point-to-point”
❖ Not-so-stubby area (NSSA) : The motivation behind NSSA is to allow OSPF Stub areas to
carry External routes (routes learned using other routing protocols like RIP, EIGRP, BGP, etc).
Stub areas are defined as areas that are not capable of importing routes external to OSPF.
Allows LSA Types: 1, 2, 3, 7 (No External Type-5’s, ASBR
allowed)
- NSSA Configuration:
router ospf 1
area 100 nssa
Area Restriction
Normal None
Stub No Type 5 AS-external LSA allowed
Totally Stub No Type 3, 4 or 5 LSAs allowed except the default summary route
No Type 5 AS-external LSAs allowed, but Type 7 LSAs that convert to Type 5 at the NSSA ABR
NSSA can traverse
NSSA Totally No Type 3, 4 or 5 LSAs except the default summary route, but Type 7 LSAs that convert to Type
Stub 5 at the NSSA ABR are allowed
DAY#4 OSPF
OSPF PATH SELECTION:
1. Intra-area
2. Interarea
3. External routes (which involves additional logic not covered in CCNP)
1. Intra-area
Routes advertised via a type 1 LSA for an area are always preferred over type 3 LSAs.
If multiple intra-area routes exist, the path with the lowest total path metric is installed in the OSPF
Routing Information Base (RIB), which is then presented to the router’s global RIB.
If there is a tie in metric, both routes install into the OSPF RIB.
In below diagram,
Best Route: R1–R3–R4
Not preferred: R1–R2–R4 (inter-area)
2. Inter-area
The next priority for selecting a path to a network is selection of the path with the lowest total path
metric to the destination.
If there is a tie in metric, both routes install into the OSPF RIB.
In below diagram:
R1 uses the path R1–R3–R5–R6 because its total path metric is 35
R1–R2–R4–R6 path NOT preferred, with a metric of 40
Equal-Cost Multipathing
If OSPF identifies multiple paths in the path selection algorithms, those routes are installed into the
routing table as equal-cost multipathing (ECMP) routes.
The default ECMP setting can be overwritten with the command maximum-paths maximum-paths
under the OSPF process to modify the default setting.
METRIC: (COST)
>router(config)#
router ospf 1
auto-cost reference-bandwidth 1000 (equals to 1000 Mbps)
Example:
ROUTER4(config)#int e0/1
ROUTER4(config-if)#ip ospf cost 1
Summarization of Routes:
Route scalability is a large factor for the IGP routing protocols used by service providers because
there can be thousands of routers running in a network.
Before Summarization:
MUMBAIR6(config-if)#do sh ip rout | i 192.
O IA 192.168.23.0/24 [110/20] via 10.100.100.1, 00:00:17, Ethernet0/0
192.168.24.0/32 is subnetted, 1 subnets
O IA 192.168.24.1 [110/21] via 10.100.100.1, 00:00:17, Ethernet0/0
192.168.25.0/32 is subnetted, 1 subnets
O IA 192.168.25.1 [110/21] via 10.100.100.1, 00:00:17, Ethernet0/0
192.168.26.0/32 is subnetted, 1 subnets
O IA 192.168.26.1 [110/21] via 10.100.100.1, 00:00:17, Ethernet0/0
CONFIG:
MUMBAIR2(config)#
interface Loopback24
ip address 192.168.24.1 255.255.255.0
end
interface Loopback25
ip address 192.168.25.1 255.255.255.0
end
interface Loopback26
ip address 192.168.26.1 255.255.255.0
end
MUMBAIR2(config)#
router ospf 100
network 192.168.24.0 0.0.0.255 area 0
network 192.168.25.0 0.0.0.255 area 0
network 192.168.26.0 0.0.0.255 area 0
After Summarization:
MUMBAIR6(config-if)#do sh ip rout | begin 192.
O IA 192.168.0.0/16 [110/21] via 10.100.100.1, 00:01:14, Ethernet0/0
DAY#5 OSPF
ROUTE FILTERING:
Route filtering is a method for selectively identifying routes that are advertised or received from
neighbor routers.
Route filtering may be used to manipulate traffic flows, reduce memory utilization, or improve
security.
One of the easiest methodologies for filtering routes is to use the not-advertise keyword during
prefix summarization.
Using this keyword prevents creation of any type 3 LSAs for any networks in that range, thus making
the subordinate routes visible only within the area where the route originates.
RESULTS:
MUMBAIR6#show ip route | i 192.
No 192.x.x.x routes found
Area Filtering
if the 172.16.1.0/24 network needs to be present in Area 0 but removed in Area 34, it is not possible
to filter the route using summarization.
R2
ip prefix-list PREFIX-FILTER seq 5 deny 172.16.1.0/24
ip prefix-list PREFIX-FILTER seq 10 permit 0.0.0.0/0 le 32
!
router ospf 1
router-id 192.168.2.2
network 10.12.1.0 0.0.0.255 area 12
network 10.23.1.0 0.0.0.255 area 0
RESULT:
R3# show ip route ospf | begin Gateway
Gateway of last resort is not set
MUMBAIR4(config)#
ip prefix-list PREFIX-FILTER seq 5 deny 192.168.24.1/32
ip prefix-list PREFIX-FILTER seq 10 permit 192.168.0.0/16
router ospf 1
area 40 filter-list prefix PREFIX-FILTER in
OSPF is a link-state protocol that requires all routers in the same area to maintain an identical copy
of the LSDB for that area.
A route can exist in the OSPF LSDB, but it could be prevented from being installed in the local RIB.
This is accomplished by using a Distribute List.
MUMBAIR4(config)#
MUMBAIR4(config)#ip access-list standard ACL-OSPF
MUMBAIR4(config-std-nacl)#10 deny 192.168.24.0 0.0.0.255
MUMBAIR4(config-std-nacl)#20 permit any
router ospf 1
distribute-list ACL-OSPF in
MUMBAIR6#ping 192.168.24.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.24.1, timeout is 2 seconds:
UUUUU
A common situation is where you have some internet-facing routers running BGP with some ISP,
probably receiving full routes, and you want to send a default route to the internal routers, so they
will use the "nearest" router (in terms of metric) to send traffic destined outside the AS.
To generate a default external route into an Open Shortest Path First (OSPF) routing domain. The
topology is something like this:
R1(config)#router ospf 1
R1(config-router)#default-information originate ?
If you use the default-information originate you can advertise a default route in OSPF. OSPF won’t
advertise a default route if you don’t already have it in your routing table.
If you add the always keyword it will advertise the default route even if you don’t have it in the
routing table. Once you have advertised the default route it will look like this on other routers:
EXAMPLE:
MUMBAIR6
hostname MUMBAIR6
!
interface FastEthernet0/1
ip address 192.168.12.1 255.255.255.0
!
router ospf 1
network 192.168.12.0
default-information originate always
!
end
VIRTUAL LINKS:
All areas in an Open Shortest Path First (OSPF) autonomous system must be physically
connected to the backbone area (Area 0). In some cases, where this is not possible, you can
use a virtual link to connect to the backbone through a non-backbone area.
You can also use virtual links to connect two parts of a partitioned backbone through a non-
backbone area.
The area through which you configure the virtual link, known as a transit area, must have
full routing information.
router ospf 1
area 1 virtual-link 3.3.3.3
router ospf 1
area 1 virtual-link 1.1.1.1
Notice that adjacencies over virtual links are not displayed in the show ip ospf neighbor
command output. The only way to see them is to look at the router LSA and observe debug
commands as the adjacency comes up, or issue the show ip ospf virtual-links command.
OSPF QUIZ#
1. OSPF uses the protocol number ___________ for its inter-router communication.
87
88
89
90
three
four
five
six
seven
3. What destination addresses does OSPF use, when feasible? (Choose two.)
IP address 224.0.0.5
IP address 224.0.0.10
IP address 224.0.0.8
4. True or false: OSPF is only enabled on a router interface by using the command network ip-
address wildcard-mask area area-id under the OSPF router process.
True
False
5. True or false: The OSPF process ID must match for routers to establish a neighbor adjacency.
True
False
6. True or false: A default route advertised with the command default information-originate in OSPF
will always appear as an OSPF inter-area route.
True
False
7. True or false: The router with the highest IP address is the designated router when using a serial
point-to-point link.
True
False
100 Mbps
1 Gbps
10 Gbps
40 Gbps
9. What command is configured to prevent a router from becoming the designated router for a
network segment?
10. What is the advertised network for the loopback interface with IP address 10.123.4.1/30?
10.123.4.1/24
10.123.4.0/30
10.123.4.1/32
10.123.4.0/24
1C
2C
3 A, D
4B
5B
6B
7B
8A
9A
10 C
When BGP was created, the primary design consideration was for IPv4 inter-organization
connectivity on public networks like the Internet and on private dedicated networks.
BGP is the only protocol used to exchange networks on the Internet, which has more than 780,000
IPv4 routes and continues to grow.
Due to the large size of the BGP tables, BGP does not advertise incremental updates or refresh
network advertisements as OSPF and IS-IS do.
BGP’s purpose is for routing (layer 3); exchanging layer 3 information. It’s a routing protocol.
BGP uses TCP port 179 (layer 4: transport), but the application is what does the processing of the
logic (routing policy).
An organization requiring connectivity to the Internet must obtain an autonomous system number
(ASN).
ASNs were originally 2 bytes (16-bit range), which made 65,535 ASNs possible.
Due to exhaustion, RFC 4893 expanded the ASN field to accommodate 4 bytes (32-bit range).
This allows for 4,294,967,295 unique ASNs, providing quite an increase from the original 65,535
ASNs.
Exterior routing protocols are used to exchange routing information between Autonomous
Systems.
AS numbers are assigned in blocks by Internet Assigned Numbers Authority (IANA) to regional
Internet registries (RIRs).
The appropriate RIR then assigns ASNs to entities within its designated area from the block assigned
by IANA.
Entities wishing to receive an ASN must complete the application process of their RIR, LIR or
upstream service provider and be approved before being assigned an ASN.
Current IANA ASN assignments to RIRs can be found on the IANA website.
What is ASN?
A public AS has a globally unique number, an AS Number, associated with it. This number is used
both in the exchange of exterior routing information (between neighboring Autonomous Systems)
and as an identifier of the AS itself.
• Public AS Numbers
• Private AS Numbers
ASN TABLE:
ASN FAQs
An AS needs to be created if a network connects to more than one AS with different routing policies.
A Public AS Number is required only when an AS is exchanging routing information with other
Autonomous Systems on the public Internet. That is, all routes originating from an AS is visible on
the Internet.
• it is currently multihomed, or
• it has the need to interconnect with another AS
A Private AS Number should be used if an AS is only required to communicate via Border Gateway
Protocol with a single provider. As the routing policy between the AS and the provider will not be
visible in the Internet, a Private AS Number can be used for this purpose.
IANA has reserved, for Private Use, a contiguous block of 1023 Autonomous System numbers from
the “16-bit Autonomous System Numbers” registry, namely 64512 – 65534 inclusive.
IANA has also reserved, for Private Use, a contiguous block of 94,967,295 Autonomous System
numbers from the “32-bit Autonomous System Numbers” registry, namely 4200000000 –
4294967294 inclusive.
This depends on how you received that AS Number. If you got it directly from APNIC, then it is
portable and you can take it with you to whichever providers you choose.
However, if you got your AS Number from a Local Internet Registry (LIR), you can only use it while
you continue to receive connectivity from the LIR. That is, if you decide to no longer use the LIR as
one of your upstream providers, then you have to return the AS Number.
It is imperative to use only the ASN assigned by IANA, the ASN assigned by your service provider,
or a private ASN. Using another organization’s ASN without permission could result in traffic loss
and cause havoc on the Internet.
4-byte ASNs provide 232 or 4,294,967,296 autonomous system numbers ranging from 0 to
4294967295.
The first thing to notice about these numbers is that they include all of the older 2-byte ASNs, 0
through 65535
That greatly helps with interoperability between autonomous systems using 2-byte ASNs and those
using 4-byte ASNs.
A 4-byte ASN between 0 and 65535 is called a mappable ASN, because it can be represented in just 2
bytes; the first 16 bits are in every case all zeroes.
All five of the RIRs (Regional Internet Registries) (AfriNIC, APNIC, ARIN, LACNIC, and RIPE NCC) have
the same assignment policies for 4-byte ASNs:
· 4-byte ASNs have been available since 1 January 2007. The default assignment, if you request an
ASN, is to give you a 2-byte ASN and only assign a 4-byte ASN if you specifically request it.
· Beginning on 1 January 2009 that policy reverses: A 4-byte ASN will be the default. You can still
get a 2-byte ASN, but only if you specifically request it.
· A year later, on 1 January 2010, all ASN assignments will be 4-byte. The ASN you receive might
be of the form 0.XX (where the high-order 16 bits are all 0 and the low-order 16 bits are not), but the
RIRs will make no distinction between those numbers and any other 4-byte ASN. And although it
won't effect your network in any way, the 16-bit ASN you've had maybe for years will, in the eyes of
the RIRs, be a mapable 32-bit ASN. For instance, Level3 Communications' AS3356 becomes in the
eyes of the RIRs, at the beginning of 2010, 0.3356.
• Connect: remote peer trying to initiate TCP connection with local peer process
➢ The BGP process is waiting for the TCP connect to be established.
➢ BGP is waiting for the TCP three-way handshake to complete.
➢ If successful, it will continue to the OpenSent State.
➢ If fails, it will continue to the Active State.
➢ If BGP reset is, send it will move back to the Idle State.
• Active: local BGP process is trying to establish TCP session with its remote peer
➢ The TCP connection failed, and the Connect-Retry timer is running.
➢ BGP will try another TCP three-way handshake to establish a connection.
➢ BGP is listening for an incoming TCP connection.
➢ If it is successful, it will move to the OpenSent State.
➢ If BGP reset is, send it will move back to the Idle State.
• OpenSent: TCP session is up, Open message has been sent to establish peering
➢ The TCP connection exists, and the router has sent a BGP Open Message.
➢ The matching Open Message has not been received from peer.
➢ BGP will be waiting for an Open message from the remote BGP neighbor.
• OpenConfirm: Router has sent keepalives to peer and wait to receive a keepalive message in
return
➢ Both routers have sent & received an Open Message.
➢ BGP waits for a Keepalive message from the remote BGP neighbor.
➢ If Keepalive message is received, it move to the Established State.
➢ BGP will keep sending Keepalive messages.
LAB#1:
CONFIGURATIONS:
R26(config)#
hostname ATT26
int e0/2
ip add 209.165.201.1 255.255.255.252
no shut
int loopback 1
ip add 209.209.209.1 255.255.255.0
no shut
R27(config)#
hostname VODAFONER27
int e0/2
ip add 209.165.201.2 255.255.255.252
no shut
int e0/1
ip add 10.172.13.1 255.255.255.0
no shut
int loopback 1
ip add 29.29.29.1 255.255.255.0
no shut
BGP table version Local BGP table increases when the BGP table changes
Local router ID The IP address representing this router
Network Learn network with subnet masks
* This is a valid route and that BGP is able to use it
> This entry has been selected as the best path
Next Hop 0.0.0.0 means that this network originated on this router
R1 learn about this network from 192.168.12.2
Metric BGP attributes that are used to select the best path
LocPrf BGP attributes that are used to select the best path
Weight BGP attributes that are used to select the best path
Path A sequence of Autonomous Systems in the path from Left to Right
Path i Network was advertised using the network command
Path 2 AS path 2
Path ? Redistributed Networks
ROUTING TABLE:
ATT26#show ip route
<!—output omitted--!>
DEBUG:
VODAFONER27#
*Jun 2 15:25:04.814: BGP: 209.165.201.1 connection timed out 180187ms (last update) 180000ms
(hold time)
*Jun 2 15:25:04.814: BGP: 209.165.201.1 went from Established to Closing
*Jun 2 15:25:04.814: %BGP-3-NOTIFICATION: sent to neighbor 209.165.201.1 4/0 (hold time
expired) 0 bytes
*Jun 2 15:25:04.814: BGP: ses global 209.165.201.1 (0xF1B0F408:1) Send NOTIFICATION 4/0 (hold
time expired) 0 bytes
*Jun 2 15:25:04.814: BGP: 209.165.201.1 local error close after sending NOTIFICATION
*Jun 2 15:25:04.814: %BGP-5-NBR_RESET: Neighbor 209.165.201.1 reset (BGP Notification sent)
*Jun 2 15:25:04.814: BGP: nbr_topo global 209.165.201.1 IPv4 Unicast:base (0xF1B0F408:1) NSF
delete stale NSF not active
*Jun 2 15:25:04.815: BGP: 209.165.201.1 closing
*Jun 2 15:25:04.815: BGP: ses global 209.165.201.1 (0xF1B0F408:1) Session close and reset
neighbor 209.165.201.1 topostate
BGP LOGS:
*Jun 2 15:29:25.144: BGP: 209.165.201.2 passive open to 209.165.201.1
CONFIGURATIONS
R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.12.2 transport connection-mode passive
R2(config)#router bgp 2
R2(config-router)#neighbor 192.168.12.1 transport connection-mode active
BGP Timers:
Last read 00:00:23, last write 00:00:28, hold time is 180, keepalive interval is 60 seconds
CONFIGURATIONS:
R2(config)#router bgp 2
R2(config-router)#timers bgp 50 150
R2(config-router)#neighbor 192.168.23.3 timers 20 60
R2#clear ip bgp *
After changing the time for neighbor R3 new hold time is 60 and Keepalive is 20 seconds now.
After changing default, timers for all other new hold time is 150 & Keepalive is 50 seconds now.
BGP Next-Hop-Self:
The BGP nexthop attribute is the next hop IP address that is going to be used to reach a certain
destination.
iBGP does not modify the next hop, leaving it at its original value. Therefore, when the router
performs a route recursion / lookup it can fail if there is no IGP route to the next-hop address which
is advertised with the BGP prefix.
CONFIGURATIONS:
VODAFONER28#traceroute 209.209.209.1
Type escape sequence to abort.
Tracing the route to 209.209.209.1
VRF info: (vrf in name/id, vrf out name/id)
1 10.172.13.1 0 msec 1 msec 0 msec
2
BGP Flavors:
There are two flavors of BGP Internal BGP and External BGP.
IBGP (Interior Border Gateway Protocol):
o If the peers are in the same AS called Internal BGP (iBGP).
o Internal BGP (IBGP) is between same Autonomous System Number.
o Routes learned from IBGP peer will not be advertised to other IBGP peers (to avoid loop)
o By default, Internal BGP (IBGP) peers are set with TTL value = 255
o Internal BGP (IBGP) routes have Administrative Distance of 200.
o Next hop remains unchanged when route is advertised to IBGP peer.
o Internal BGP (IBGP) peers do not need to be directly connected.
BGP MULTIHOP
• EBGP routers use a TTL value of one for their BGP packets.
• BGP neighbor away more than one hop TTL decrement to 0 & discarded.
• The solution is to use to Multihop command.
• Use the ebgp-multihop command to increase the TTL value.
• Multihop command does not apply to Internal BGP.
• If source EBGP from the loopback interfaces, then require Multihop.
• If source EBGP from the loopback interfaces also require update-source loopback.
• Using a loopback interface as update source, BGP session will not go down.
• Update source can be configured per neighbor or per peer-group.
• Static route is required to ensure that the loopback is reachable from both ends (optional),
however, we have used eBGP in our scenario.
• Multihop enables the peers to pass through the other routers to form peer relationships.
GNS LAB
1st HOP
2nd HOP
BGP UPDATE-SOURCE
For BGP, a neighbor relationship to be established, source IP address of BGP packets sent by
a router must be the same as neighbor ip-address set on the neighboring router. By default,
packet’s source IP address is outgoing interface.
• BGP router may have many neighbors that require the same BGP policies.
• BGP peer groups are used to simplify configuration and to improve performance.
• Peer group can be used when router has a group of neighbors with the same policies.
• Update is generated once per group rather than for each neighbor.
• BGP peer group requires less CPU resources rather send separately.
• Peer groups saves a lot of time and typing.
• Peer groups make updating more efficient and improve performance
• BGP sends update packet to a peer with path attributes associated with prefix.
• BGP selects the best path based on a list of attributes.
• BGP attributes are similar to metrics in OSPF and EIGRP.
• BGP use path attributes to pick the best route to a destination.
• BGP store multiple paths to a destination in BGP table.
• BGP only install one best route in the routing table.
• BGP path algorithm decides best path to install in the IP routing table.
• BGP path algorithm decides best path to use for traffic forwarding.
• BGP goes through the following steps to select the best path route.
BGP Attributes:
BGP uses path attributes (PAs) associated with each network path. The PAs provide BGP with
granularity and control of routing policies within BGP. The BGP prefix PAs are classified as follows:
• Well-known mandatory
• Well-known discretionary (pron: duh·skri·shuh·nuh·ree)
• Optional transitive
• Optional non-transitive
Well-Known Mandatory:
• As the name suggests it is mandatory and must.
• These attribute must appear in every Update message.
• Must be recognized & supported by all BGP speakers.
• If these attributes are missing a Notification, error is generated.
• If these attributes are missing the session will be closed.
• Well-Known mandatory attributes are AS Path, Next Hop Address, & Origin.
Optional Transitive:
• May or may not be supported by all BGP speakers.
• Will be passed on if not recognized by the receiver.
• The attribute should be accepted and passed along to other peers.
• Optional Transitive attributes are Aggregator and Community.
• Transitive, these attributes are across AS boundaries.
Optional Non-Transitive:
• May or may not be supported by all BGP speakers.
In BGP, the Network Layer Reachability Information (NLRI) is a routing update that consists of the
network prefix, prefix length, and any BGP PAs for the specific route. (Update packet)
BGP weight attribute is a Cisco proprietary path attribute that is local to the router and is used to
influence local path selection on a certain router.
BGP weight is the first tie breaker for best path selection on a Cisco router, the attribute is not
propagated to other routers in the BGP updates and only found on Cisco routers.
The path with the highest weight is selected as the best toward a destination.
The weight can be a number from 0 to 65,535. Paths that the router originates have a weight of
32,768 by default, and other paths have a weight of 0. As we mentioned earlier the path with the
highest weight value wins.
Summary:
• Weight is Cisco-Proprietary value.
• Weight is only local on the router.
• Weight is not exchanged between BGP routers.
• Weight is never advertised to other routers.
• The path with the highest weight is preferred.
• Weight for a route originated on the local router is 32768.
BGP weight can be set using one of three ways on a Cisco router.
1. Assigned per neighbor using the neighbor {ip-address | peer-group} weight weight. This
command will influence all routes received from a certain neighbor by assigning the configured
value to all these routes.
2. Using AS-Path access lists. ip as-path access-list access-list-number {permit | deny} as-regular-
expression neighbor ip-address filter-list access-list-number weight weight. This method will
apply the weight value to As-paths defined in the access list.
3. Using route-maps for more complex definitions.
BGP weight is the easiest way to manipulate the BGP path selection on a single Cisco router for
outbound traffic. The attribute is local and will not be propagated to other routers in the network
within the BGP update messages.
Weight values can be assigned to routes using the neighbor command, IP AS-PATH or route maps for
complex policies.
GNS3 LAB
R1 Configuration R2 Configuration
interface f0/0 interface f0/0
ip add 192.168.12.1 255.255.255.0 ip add 192.168.23.2 255.255.255.0
no shutdown no shutdown
interface f0/1
interface f0/1 ip add 192.168.12.2 255.255.255.0
ip add 192.168.13.1 255.255.255.0 no shutdown
no shutdown interface loopback3
ip add 23.23.23.2 255.255.255.0
R3 Configuration
interface f0/0 interface f0/1
ip add 192.168.23.3 255.255.255.0 ip add 192.168.13.3 255.255.255.0
no shutdown no shutdown
interface loopback3
ip add 23.23.23.3 255.255.255.0
First, let us check BGP weight attribute value for internal and external routes. It is 0 for external
routes and 32768 default for internal routes.
Router R1 decided to use 192.168.12.2 as the next hop. All the BGP attributes are the same so it
came down to the router ID to select a winner.
Note: Router ID. Prefer the path with the lowest BGP neighbor router ID.
R1 Weight Configuration
router bgp 1
neighbor 192.168.13.3 weight 500
To apply the path attribute changes to BGP prefix, always clear the process
clear ip bgp *
show ip bgp
After changing the weight, R1 Now selected 192.168.13.3 as the next hop address.
This is another way of choosing outbound path with BGP. Why would we need yet another way?
Well, for starters, weight is Cisco proprietary attribute, which means there is no weight on, say
Juniper. And weight has only local significance. This means we may have to apply it on several or all
routers.
Local preference comes right after weight in BGP path selection, so it is still strong mechanism of
preferring a path. It is not limited to a local router, but spans the entire autonomous system. This
means that we can set a local pref on one router for some prefixes, and it is sent to all internal
neighbours along with prefix updates. It is removed on eBGP sessions, so it stays within a local AS.
Local pref can range from 0-4294967295 with a default of 100. The higher the better.
The local preference has to be set inbound on routes being received to influence the outbound
routing behaviour.
Summary:
• Local Preference is the second BGP attribute.
• Use local preference to choose the outbound external BGP path.
• Local Preference is sent to all Internal BGP routers in AS.
• Local Preference is not exchanged between external BGP routers.
• Local preference is a Well-Known Discretionary BGP attribute.
• Local Preference Default value is 100.
• The path with the highest Local Preference is preferred.
GNS3:
CE2(config)#
router bgp 1
bgp default local-preference 150
OR
CE2(config)#
route-map LOCAL-PREF-150
set local-preference 150
CE2(config)#router bgp 1
neighbor 10.1.3.2 route-map LOCAL-PREF-150 in
end
CE2#clear ip bgp *
Clear ip bgp *
Or
Clear ip bgp 10.1.2.2 soft (preferable) [keeps the tcp session, only refreshes route changes]
SHOW COMMANDS:
1st Method to Verify:
CORE#sh ip bgp 8.8.8.8 bestpath
BGP routing table entry for 8.8.8.0/24, version 51
Paths: (2 available, best #2, table default)
Not advertised to any peer
Refresh Epoch 1
245
192.168.12.2 from 192.168.12.2 (192.168.14.1)
Origin IGP, metric 0, localpref 250, valid, internal, best
rx pathid: 0, tx pathid: 0x0
If you see the local preference attribute has been applied to all routes coming in from PE1, if
we just wanted to do it for 8.8.8.8 then we could match this network in a prefix-list and add
that to the route-map.
CE2(config)#
ip prefix-list 8.8.8.8 seq 5 permit 8.8.8.0/24
4. AS Path:
• AS Path is the fourth BGP attribute.
• AS path is a mandatory attribute, describe path taken on the way to destination.
• BGP prefers the shortest AS path to get to a destination.
• BGP AS Path is a Well-Known mandatory attribute.
• Ordered list of ASNs through which the update has passed.
• The main purpose of the AS Path is to avoid loops.
• AS-Path prepending is to make received prefix "Less Attractive".
• Add own AS number multiple times so the as path becomes longer.
• AS-Path prepending is a way to manipulate the AS-Path attribute of a BGP route.
• AS-Path prepending used to influence inbound direction traffic.
• AS path 1 2 3 is preferred over AS path 1 2 3 4 5.
GNS3
CE1(config)#
route-map PREPEND permit 10
set as-path prepend 40000 40000
CE1(config-route-map)#
router bgp 1
neighbor 10.1.2.2 route-map PREPEND out
end
Show commands:
GOOGLE-SERVER#show ip bgp
*> 0.0.0.0 0 32768 i
*> 101.101.101.0/24 10.4.5.1 0431i
*> 192.168.12.0 10.4.5.1 0 4 2 1 40000 40000 i
*> 192.168.13.0 10.4.5.1 0431i
*> 192.168.14.0 10.4.5.1 0431i
*> 192.168.102.0 10.4.5.1 0 04i
*> 192.168.103.0 10.4.5.1 0 04i
Network Next Hop Metric LocPrf Weight Path
*> 192.168.104.0 10.4.5.1 04i
.
6. MED:
o MED (Multi-Exit Discriminator) is the sixth BGP attribute.
o Multi-Exit Discriminator (MED) is optional non-transitive attribute.
o The lowest MED is the preferred path.
GNS3
Basically use this attribute for influencing traffic between two directly connected autonomous
systems.
AS1
CE1(config)#
route-map MED permit 10
set metric 50
exit
router bgp 1
neighbor 10.1.2.2 route-map MED out
end
CE1#clear ip bgp *
3. Originate:
o Originate is the third BGP attribute.
o Prefer the path that the local router originated.
o In the BGP table, Local router originated see next hop 0.0.0.0.
o Routes with weight set to “32768” is considered as local routes.
o BGP router will prefer routes that it installed into BGP itself to another router installed.
5. Origin Code:
o BGP prefer the lowest Origin Code.
o There are three origin codes: IGP, EGP & Incomplete.
o IGP is lower than EGP and EGP is lower than Incomplete.
o IGP (shows up as i) use the network command for BGP.
o EGP (shows up as e) is an old routing protocol no more.
o Incomplete (shows up as ?) means redistributed something into BGP.
o Origin is a Well-known mandatory attribute.
9. Oldest Path:
o Prefer the path that received first, in other words, the oldest path.
o The oldest route in the routing table is preferred over the new ones.
If a BGP speaker selects a less specific route, when a more specific route is available, it must attach
the Atomic Aggregate attribute when propagating the route. The Atomic Aggregate attribute lets the
BGP peers know that the BGP speaker used an aggregated route.
When you use the Atomic Aggregate attribute, the BGP speaker has the option to send the
Aggregator attribute. The Aggregator attribute includes the AS number and the IP address of the
router that originated the aggregated route. In Cisco routers, the IP address is the RID of the router
that performs the route aggregation. Atomic Aggregate is a well-known attribute and Aggregator is
an optional, transitive attribute.
BGP Communities
A BGP community is bit of “extra information” that you can add to one of more prefixes which is
advertised to BGP neighbors.
This extra information can be used for things like traffic engineering or dynamic routing policies.
BGP communities provide additional capability for tagging routes and for modifying BGP routing
policy on upstream and downstream routers. BGP communities can be appended, removed, or
modified selectively on each attribute as the route travels from router to router.
BGP communities are an optional transitive BGP attribute that can traverse from autonomous
system to autonomous system. A BGP community is a 32-bit number that can be included with a
route. A BGP community can be displayed as a full 32-bit number (0-4,294,967,295) or as two 16-bit
numbers (0-65535):(0-65535) commonly referred to as new-format.
BGP QUIZ
1. 64,512–65,535
2. 65,000–65,535
3. 4,200,000,000–4,294,967,294
4. 4,265,000–4,265,535,016
2. Which BGP attribute must be recognized by all BGP implementations and advertised to
other autonomous systems?
1. Well-known mandatory
2. Well-known discretionary
3. Optional transitive
4. Optional non-transitive
1. True
2. False
4. True or false: A BGP session is always one hop away from a neighbor.
1. True
2. False
5. True or false: The IPv4 address family must be initialized to establish a BGP session with
a peer using IPv4 addressing.
1. True
2. False
6. Which command is used to view the BGP neighbors and their hello intervals?
1. One
2. Two
3. Three
4. Four
8. True or false: BGP advertises all its paths for every prefix so that every neighbor can build
its own topology table.
1. True
2. False
10. True or false: The IPv6 address family must be initialized to establish a BGP session with
a peer using IPv6 addressing.
1. True
2. False
1 A, C
2A
3B
4B
5B
6B
7C
8B
9B
10 A
REDISTRIBUTION
The source protocol provides the network prefixes that are to be redistributed, and the destination
protocol receives the injected network prefixes.
The redistribution configuration exists under the destination protocol and identifies the source
protocol.
Using a route map allows for the filtering or modification of route attributes during the injection into
the destination protocol.
KEY POINTS:
A route must exist in the RIB in order for it to be redistributed into the destination protocol.
In addition to the route being in the RIB, the source protocol that redistributes into the destination
protocol must be the source for the route in the RIB.
REMEMBER!!!
In other words, when a router redistributes protocol 1 into protocol 2, and protocol 2 redistributes
into protocol 3, the routes from protocol 1 does not redistribute into protocol 3.
router eigrp
redistribute ospf
router ospf
redistribute eigrp
redistribute bgp
router bgp
redistribute ospf
For routes to be exchanged between all three routing protocols, mutual redistribution must be
configured between all three protocols
router eigrp
redistribute ospf
redistribute bgp
router ospf
redistribute eigrp
redistribute bgp
router bgp
redistribute ospf
redistribute eigrp
Seed Metrics
Every routing protocol uses a different methodology for calculating the best path for a route, EIGRP
can use bandwidth, delay, load, and reliability for calculating its best path, whereas OSPF primarily
uses the path metric for calculating the shortest path first (SPF) tree (SPT).
OSPF cannot calculate the SPT using EIGRP path attributes, and EIGRP cannot run diffusing update
algorithm (DUAL) using only the total path metric.
The destination protocol must be provided with relevant metrics to the destination protocols so that
the destination protocol can calculate the best path for the redistributed routes.
Every protocol provides a seed metric at the time of redistribution that allows the destination
protocol to calculate a best path.
EIGRP Infinity. Routes set with infinity are not installed into the EIGRP topology table.
OSPF All routes are Type 2 external. Routes sourced from BGP use a seed metric of 1, and all other protocols
uses a seed metric of 20.
BGP Origin is set to incomplete, the multi-exit discriminator (MED) is set to the IGP metric, and the weight is
set to 32,768.
PROTOCOL-SPECIFIC CONFIGURATION
Redistribution commonly uses route maps to manipulate or filter routes on the redistributing
router.
SELECTIVE REDISTRIBUTION:
BGP is designed to handle a large routing table, whereas IGPs are not. Redistributing BGP into an IGP
on a router with a larger BGP table (for example, the Internet table with 800,000+ routes) should use
selective route redistribution. Otherwise, the IGP can become unstable in the routing domain, which
can lead to packet loss.
1. EIGRP
2. OSPF
3. BGP
Redistributing routes into BGP does not require a seed metric because BGP is a path vector protocol.
VODAFONER27
hostname VODAFONER27
int fa2/0
ip add 209.165.201.1 255.255.255.252
no shutdown
int fa1/0
ip add 10.172.13.1 255.255.255.252
no shutdown
int loop 1
ip add 27.27.27.1 255.255.255.0
router ospf 1
network 10.172.13.0 0.0.0.255 area 0
network 27.27.27.0 0.0.0.255 area 0
VODAFONER28
hostname VODAFONER28
int fa1/0
ip add 10.172.13.2 255.255.255.252
no shutdown
int loop 1
ip add 28.28.28.1 255.255.255.0
router ospf 1
network 10.172.13.0 0.0.0.255 area 0
network 28.28.28.0 0.0.0.255 area 0
=============
REDISTRIBUTION CLI COMMAND EGRP<-->OSPF
=============
VODAFONER27(config)#
router eigrp 100
redistribute ospf 1 metric 100000 510 255 1 1500
router ospf 1
redistribute eigrp 100 subnet
VODAFONER28
no change as above
router ospf 1
redistribute bgp 1 subnets
!
end
!
clear ip bgp *
=============
REDISTRIBUTION CLI COMMAND iBGP<-->OSPF
=============
ATTR26
no router bgp 2
router bgp 1
neighbor 209.165.201.1 remote-as 1
network 26.26.26.0 mask 255.255.255.0
VODAFONER27
router bgp 1
neighbor 209.165.201.2 remote-as 1
network 27.27.27.0 mask 255.255.255.0
router bgp 1
redistribute ospf 1
!
router ospf 1
redistribute bgp 1 subnets
!
end
!
clear ip bgp *
VODAFONER27(config-router)#
router bgp 1
bgp redistribute-internal
exit
!
#in order to prevent routing loops from being formed.
=====================
ISSUES OF REDISTRIBUTIONS:
• Suboptimal routing
• Routing loops
Therefore, overall network visibility is lost or hidden from the destination routing source.
This is not an issue when there is only one point of redistribution between two sources. However, if
there are multiple points of redistribution between two sources.
SOLUTION:
You can solve this issue by providing different seed metrics on the boundary routers
OSPF E2
SOLUTION:
To redistribute a route from one routing source to another (EIGRP into OSPF, for example), that
route must be in the routing table as an entry for the routing source that you are redistributing the
route from.
QUIZ: PART 1
1. R1 learns the 10.11.11.0/24 prefix from EIGRP. EIGRP is redistributed into OSPF on R1, and OSPF is
redistributed into BGP on R1. R1 advertises all the BGP network prefixes to R3. Does R3 receive the
10.11.11.0/24 prefix?
1. Yes
2. No
2. What is the administrative distance for external EIGRP routes?
1. 90
2. 110
3. 170
4. 200
3. What is the default seed metric for OSPF?
1. 20
2. 100
3. 32,768
4. infinity
4. R1 learns the 10.11.11.0/24 prefix from EIGRP. EIGRP is redistributed into OSPF on R1. R1 has an
OSPF adjacency with R2. R2 redistributes OSPF into BGP. R2 advertises all BGP network prefixes to
R3. Does R3 receive the 10.11.11.0/24 prefix?
1. Yes
2. No
5. What is the administrative distance for external OSPF routes?
1. 150
2. 110
3. 180
4. 200
6. What is the default seed metric for EIGRP?
1. 20
2. 100
3. 32,768
4. infinity
7. Which additional command is needed to redistribute external OSPF routes into EIGRP?
1. ospf-external-prefixes redistributable
2. eigrp receive external source networks
3. ospf redistribute-internal
4. None
8. Which additional command is needed to redistribute external OSPF routes in to BGP?
1. ospf-external-prefixes redistributable
2. match external
3. bgp redistribute-internal
4. none
ANSWERS:
1. b. Route redistribution is not transitive on a single router.
2. c. The AD for external EIGRP routes is 170.
3. a. The default seed metric for OSPF is 20.
4. a. Sequential redistribution is allowed.
5. b. The AD for external OSPF routes is 110, which is the same as the AD for internal OSPF routes.
6. d. The default seed metric for EIGRP is infinity.
7. d. External OSPF routes redistribute into EIGRP with the basic redistribution command.
8. c. External OSPF routes are not redistributed into BGP with the basic redistribution command; the
command match external must also be used.
QUIZ PART2:
1. Which of the following are methods that can be used to solve routing issues caused by multipoint
redistribution? (Choose all that apply.)
1. Modify the seed metrics of the redistributed routes.
2. Modify the administrative distances of redistributed routes.
3. Tag routes as they are redistributed and then deny them from being redistributed back into
the originating routing source.
4. Modify the metric used to reach the boundary routers.
2. Which of the following methods can be used to solve suboptimal routing issues caused by
redistribution?
1. Modify the seed metrics of the redistributed routes.
2. Modify the administrative distances of redistributed routes.
3. Redistribute only classless networks.
4. Modify the metrics of the routes before redistribution.
4. The EIGRP command distance 165 10.1.1.1 0.0.0.0 changes the AD to 165 for external EIGRP
routes learned from neighbor 10.1.1.1.
4. What must be true for a route from one routing source to be redistributed into a different routing
source?
1. The routing sources must have similar metrics.
2. The routing sources must have similar administrative distances.
3. The route must be in the routing table on the router performing redistribution.
4. The route must be a directly connected route on the router performing redistribution.
5. Which of the following routing protocols have a default seed metric of unreachable? (Choose
two.)
1. RIP
2. EIGRP
3. OSPF
4. BGP
6. Which of the following routing protocols has a default seed metric of 20?
1. RIPng
2. EIGRP for IPv6
3. OSPFv3
4. BGP
7. When redistributing, you have four options for the seed metric: accepting the default value,
specifying it with the default-metric command, using the metric option with
the redistribute command, and using a route map. If all four of these are configured with different
values, which will be preferred?
1. Default values
2. default-metric command
3. Metric option with the redistribute command
4. Route map attached to the redistribute command
10. Which option is mandatory when redistributing classless networks into OSPF?
1. metric
2. metric type
3. subnets
4. match
11. Which of the following is not included when redistributing from one IPv6 routing protocol into
another IPv6 routing protocol?
1. A prefix
2. A seed metric
3. A directly connected route participating in the routing process
4. An administrative distance
12. During redistribution that uses route maps, what occurs to a route that matches a deny entry in
the route map?
1. It is redistributed with default values.
2. It is redistributed with the values in the set clause.
3. It is redistributed only if there is a routing table entry for it.
4. It is not redistributed.
ANSWERS:
1. a, b, and c
2. a
3. c
4. c
5. a and b
6. c
7. d
9. a
10. c
11. c
12. d
This can be useful to overrule your routing table for certain traffic types. I will show you how to
configure policy-based routing.
GNS3 LAB:
TOKYOR7(config)#
interface Ethernet0/1
ip address 192.168.10.1 255.255.255.0
no shutdown
interface Ethernet0/2
ip address 192.168.40.1 255.255.255.0
no shutdown
interface Ethernet0/3
ip address 192.168.20.1 255.255.255.0
no shutdown
TOKYOR10(config)#
interface Ethernet0/1
TOKYOR29(config)#
interface Ethernet0/0
ip address 192.168.50.2 255.255.255.0
no shutdown
interface Ethernet0/2
ip address 192.168.40.2 255.255.255.0
no shutdown
TOKYOR12(config)#
interface Ethernet0/2
ip address 192.168.60.2 255.255.255.0
no shutdown
interface Ethernet0/3
ip address 192.168.20.2 255.255.255.0
no shutdown
TOKYOR30(config)#
interface Loopback1
ip address 4.4.4.4 255.255.255.0
no shutdown
interface Ethernet0/0
ip address 192.168.50.1 255.255.255.0
no shutdown
interface Ethernet0/2
ip address 192.168.60.1 255.255.255.0
no shutdown
interface Ethernet0/3
ip address 192.168.30.1 255.255.255.0
no shutdown
conf t
router ospf 1
network 0.0.0.0 0.0.0.0 area 0
end
PRE-CHECKS HERE
OSPF support equal load-sharing, hence, all 3 routes are placed in RIB:
TOKYOR7#show ip route 4.4.4.4
Routing entry for 4.4.4.4/32
Known via "ospf 1", distance 110, metric 21, type intra area
Last update from 192.168.10.2 on Ethernet0/1, 00:00:01 ago
Routing Descriptor Blocks:
192.168.40.2, from 4.4.4.4, 00:00:01 ago, via Ethernet0/2
Route metric is 21, traffic share count is 1
* 192.168.20.2, from 4.4.4.4, 00:00:01 ago, via Ethernet0/3
Route metric is 21, traffic share count is 1
192.168.10.2, from 4.4.4.4, 00:00:01 ago, via Ethernet0/1
Route metric is 21, traffic share count is 1
Traceroute (udp packets) to 4.4.4.4 is successful (Note: traceroute in router generates udp packet)
TOKYOR7#traceroute 4.4.4.4 probe 1
Type escape sequence to abort.
Tracing the route to 4.4.4.4
VRF info: (vrf in name/id, vrf out name/id)
1 192.168.10.2 0 msec
2 192.168.60.1 1 msec
Username:
Now let’s say that I want to use the link in between TOKYOR7 and TOKYOR12 to reach 4.4.4.4. I
could influence the metric for OSPF, but this applies to all traffic. What if I wanted to use this link for
certain traffic only?
TOKYOR7(config)#
int e0/3
ip ospf cost 1000
end
All traffic is impact due to manipulating the OSPF COST on TOKYOR7_E0/3. The route is removed
from RIB as well:
TOKYOR7#show ip route 4.4.4.4
Routing entry for 4.4.4.4/32
Known via "ospf 1", distance 110, metric 21, type intra area
Last update from 192.168.40.2 on Ethernet0/2, 00:06:41 ago
Routing Descriptor Blocks:
* 192.168.40.2, from 4.4.4.4, 00:06:41 ago, via Ethernet0/2
Route metric is 21, traffic share count is 1
192.168.10.2, from 4.4.4.4, 00:06:41 ago, via Ethernet0/1
Route metric is 21, traffic share count is 1
We could use the link in between TOKYOR7 / TOKYOR10 & TOKYOR29 for the majority of our traffic
and use the link between TOKYOR7/ TOKYOR12 only for certain traffic. This can be very useful. For
example, imagine that the link between TOKYOR7/ TOKYOR12 is a dedicated link that offers QoS for
VoIP traffic.
This is something we can achieve with PBR (Policy Based Routing) Let me show you how!
Now let’s say that we want all ICMP traffic from TOKYOR7 destined for 4.4.4.4 to cross the link
between TOKYOR7/TOKYOR12. Here’s how to do this:
First, I create an access-list that matches my traffic. Now we have to create a route-map:
TOKYOR7(config)#
ip access-list extended ONLY_ICMP_TOKYOR12
permit icmp host 192.168.10.1 host 4.4.4.4
Whenever the traffic matches the access-list, we will change the next hop to 192.168.20.2
(TOKYOR12) using route-map.
TOKYOR7(config)#
route-map PBR_TOKYOR12 permit 5
match ip address ONLY_ICMP_TOKYOR12
set ip next-hop 192.168.20.2
TOKYOR7#debug ip policy
Policy routing debugging is on
*Aug 19 16:21:58.327: IP: s=192.168.40.1 (local), d=4.4.4.4, len 100, policy match
*Aug 19 16:21:58.327: IP: route map PBR_TOKYOR12, item 5, permit
*Aug 19 16:21:58.327: IP: s=192.168.40.1 (local), d=4.4.4.4 (Ethernet0/3), len 100, policy routed
*Aug 19 16:21:58.327: IP: local to Ethernet0/3 192.168.20.2
Above you can see that it has been policy routed towards 192.168.20.2. We can also verify this by
looking at the route-map:
TOKYOR7#show route-map PBR_TOKYOR12
route-map PBR_TOKYOR12, permit, sequence 5
Match clauses:
ip address (access-lists): ONLY_ICMP_TOKYOR12
Set clauses:
ip next-hop 192.168.20.2
Nexthop tracking current: 0.0.0.0
192.168.20.2, fib_nh:0,oce:0,status:0
Let’s try some traffic that doesn’t match our access-list. Telnet for example:
TOKYOR7#tracer 4.4.4.4 prob 1
Type escape sequence to abort.
Tracing the route to 4.4.4.4
VRF info: (vrf in name/id, vrf out name/id)
1 192.168.10.2 1 msec
2 192.168.50.1 1 msec
OR
TOKYOR7#telnet 4.4.4.4
Trying 4.4.4.4 ... Open
As you can see above, this traceroute (udp) / telnet traffic (TCP) is routed using the normal path.
There is one more thing I’d like to show you. With policy-based routing, there is a difference
between traffic that is originated from the router and going through the router.
The example above is for traffic originated from the router (TOKYOR7). What if we want to policy
route traffic that is routed viaTOKYOR7?
TOKYOR7#
interface Ethernet0/0
ip address 192.168.1.100 255.255.255.0
end
TOKYOR7(config)#
ip access-list extended ONLY_ICMP_TOKYOR12_HOST
permit icmp host 192.168.1.1 host 4.4.4.4
Whenever the traffic matches the access-list, we will change the next hop to 192.168.20.2
(TOKYOR12).
TOKYOR7#
*Aug 19 15:59:59.801: IP: s=192.168.1.10 (Ethernet0/0), d=4.4.4.4, len 84, FIB policy match
*Aug 19 15:59:59.801: IP: s=192.168.1.10 (Ethernet0/0), d=4.4.4.4, len 84, PBR Counted
*Aug 19 15:59:59.801: IP: s=192.168.1.10 (Ethernet0/0), d=4.4.4.4, g=192.168.20.2, len 84, FIB
policy routed
Above you can see that it has been policy routed towards 192.168.20.2. We can also verify this by
looking at the route-map:
Summary:
Policy-based routing allows us to overrule the global routing table for traffic that matches our
access-list. This can be a great way to redirect traffic for certain applications. To activate PBR, there
is a difference for traffic that is going through the router or that is originated by the router:
• Use the ip policy command under the interface for traffic that is going through the router.
• Use the ip policy local command globally for traffic that is originated by the router.
Networks that use real-time traffic like VoIP require fast convergence times. Routing protocols like
OSPF or EIGRP are able to quickly select another path once they lose a neighbor but it takes a while
for them to realize that something is wrong.
We can tune timers for fast convergence, for example OSPF can be configured to use a dead interval
of only one second. The problem however is that all of these protocols were never really designed
for sub-second failover. Hello packets and such are processed by the control plane so there is quite
some overhead. BFD was designed to be fast; its packets can be processed by some interface
modules or line cards so there isn’t much overhead.
BFD runs independent from any other (routing) protocols. Once it’s up and running, you can
configure protocols like OSPF, EIGRP, BGP, HSRP, MPLS LDP etc. to use BFD for link failure detection
instead of their own mechanisms. When the link fails, BFD will inform the protocol. Here’s how you
can visualize this:
R1 and R2 are configured to use BFD and will send control packets to each other. OSPF remains the
same, it’s sending its OSPF packets. Once the link fails, this will happen:
When BFD doesn’t receive its control packets anymore it realizes we have a link failure and it will
report this to OSPF. OSPF will then tear down the neighbor adjacency.
There are two operating modes to BFD, asynchronous mode and demand mode. The asynchronous
mode is similar to the hello and holddown timers, BFD will keep sending hello packets (called BFD
control packets) and when you don’t receive some of them, the session is teared down.
The demand mode is different, once BFD has found a neighbor it won’t continuously send control
packets but only uses a polling mechanism. Another method has to be used to check reachability, for
example it could check the receive and transmit statistics of the interface. Right now, Cisco (or any
other vendor I know of) doesn’t support BFD demand mode.
Both modes also support something called echo mode. When a device sends BFD echo packets then
the receiver will return them without processing them. When the sender doesn’t get the echo
packets back, it knows something is wrong and will tear down the session.
• Control packets are mandatory and processed by the CPU. They set up the initial BFD
session, where parameters are negotiated, such as timers.
• Echo packets use UDP to send an echo to a peer and are not received by the CPU. The is
because they contain the source and destination IP/MAC of the sender. Therefore, when the
peer gets the echo packet, the CEF/FIB tables (which do not touch the CPU) simplify forward
the packet straight back to the sending peer. These are optional (but is on by default) if
disabled only the control packets are used to determine that the peer is alive.
GNS3:
TOKYOR7(config)#
interface Ethernet0/2
ip address 192.168.40.1 255.255.255.0
no shutdown
TOKYOR29(config)#
interface Ethernet0/0
ip address 192.168.50.2 255.255.255.0
no shutdown
interface Ethernet0/2
ip address 192.168.40.2 255.255.255.0
no shutdown
TOKYOR30(config)#
interface Ethernet0/0
ip address 192.168.50.1 255.255.255.0
no shutdown
conf t
router ospf 1
network 0.0.0.0 0.0.0.0 area 0
end
router ospf 1
bfd all-interfaces
TOKYOR29(config)#
interface Eth0/2
bfd interval 50 min_rx 50 multiplier 3
router ospf 1
bfd all-interfaces
TOKYOR30(config)#
interface Eth0/2
bfd interval 50 min_rx 50 multiplier 3
router ospf 1
bfd all-interfaces
• The BFD interval is to specify how often we will send BFD packets, this is similar to the hello
packet that protocols like OSPF, EIGRP, HSRP, etc. use.
• The second value to configure is the minimum receive interval. This is how often we expect to
receive a BFD packet from our neighbor.
• The last value to configure is for the holddown. This is similar to the dead interval in OSPF or the
holddown time that other protocols use.
PRE-CHECKS:
IPv4 Sessions
NeighAddr LD/RD RH/RS State Int
IPv4 Sessions
NeighAddr LD/RD RH/RS State Int
192.168.40.1 1/1 Up Up Et0/2
Session state is UP and using echo function with 50 ms interval.
Session Host: Software
OurAddr: 192.168.40.2
Handle: 1
Local Diag: 0, Demand mode: 0, Poll bit: 0
MinTxInt: 1000000, MinRxInt: 1000000, Multiplier: 3
Received MinRxInt: 1000000, Received Multiplier: 3
Holddown (hits): 0(0), Hello (hits): 1000(24)
Rx Count: 26, Rx Interval (ms) min/max/avg: 1/1002/839 last: 715 ms ago
Tx Count: 26, Tx Interval (ms) min/max/avg: 1/992/836 last: 796 ms ago
Elapsed time watermarks: 0 0 (last: 0)
Registered protocols: OSPF
Uptime: 00:00:21
Last packet: Version: 1 - Diagnostic: 0
State bit: Up - Demand bit: 0
Poll bit: 0 - Final bit: 0
C bit: 0
Multiplier: 3 - Length: 24
My Discr.: 1 - Your Discr.: 1
Min tx interval: 1000000 - Min rx interval: 1000000
Min Echo interval: 50000
Now, let us “shutdown” down the interface to see the BFD convergence speed and its working:
TOKYOR7
interface Eth 0/2
shutdown
Within a second, BFD reports to OSPF that there is a link failure and the neighbor adjacency has
been dropped. Now that’s pretty quick!
VRF-LITE
By default, a router uses a single global routing table that contains all the directly connected
networks and prefixes that it learned through static or dynamic routing protocols.
VRFs are like VLANs for routers, instead of using a single global routing table we can use multiple
virtual routing tables. Each interface of the router is assigned to a different VRF.
VRFs are commonly used for MPLS deployments, when we use VRFs without MPLS then we call it
VRF lite.
GNS3:
Interface Configurations:
ISP(config)#
interface GigabitEthernet0/0
no switchport
ip address 12.1.1.1 255.255.255.0
no negotiation auto
duplex full
no shutdown
interface GigabitEthernet0/1
no switchport
ip address 14.1.1.1 255.255.255.0
no negotiation auto
duplex full
no shutdown
interface GigabitEthernet0/2
no switchport
ip address 13.1.1.1 255.255.255.0
no negotiation auto
duplex full
no shutdown
AUSTRALIAR16(conf t)#
interface Ethernet0/0
no switchport
ip address 12.1.1.2 255.255.255.0
duplex full
no shutdown
CHINAR17(conf t)#
interface Ethernet0/0
no switchport
ip address 13.1.1.2 255.255.255.0
duplex full
no shutdown
JAPANR15(conf t)#
interface Ethernet0/0
no switchport
ip address 14.1.1.2 255.255.255.0
duplex full
no shutdown
In the topology above we have one ISP router and three customers called “JAPAN”, “AUSTRALIA”
and “CHINA”. Each customer is connected to the ISP router. The ISP router has only one global
routing table so if we connect everything like the topology above, this is what the routing table will
look like:
The ISP router has a single global routing table that has all 3 directly connected networks. Let’s use
VRFs to change this, I want to create a separate routing table for customer “JAPAN”, “AUSTRALIA”
and “CHINA”. First, we have to create these VRFs:
ISP(config)#
ip vrf AUSTRALIA
exit
ip vrf CHINA
exit
ip vrf JAPAN
exit
Globally we create the VRFs, one for each customer. Our next step is to add the interfaces of the ISP
router to the correct VRF. Here’s how:
ISP(conf t)#
ISP(config)#interface GigabitEthernet0/0
ISP(config-if)# ip vrf forwarding AUSTRALIA
% Interface GigabitEthernet0/0 IPv4 disabled and address(es) removed due to enabling VRF
AUSTRALIA
ISP(config-if)#interface GigabitEthernet0/1
ISP(config-if)# ip vrf forwarding JAPAN
% Interface GigabitEthernet0/1 IPv4 disabled and address(es) removed due to enabling VRF
JAPAN
ISP(config-if)#interface GigabitEthernet0/2
ISP(config-if)# ip vrf forwarding CHINA
% Interface GigabitEthernet0/2 IPv4 disabled and address(es) removed due to enabling VRF
CHINA
On the interface level we use the ip vrf forwarding command to assign the interface to the correct
VRF. Once you do this, you’ll have to add the IP address again. Let’s configure the remaining
interfaces:
ISP(conf t)#
interface GigabitEthernet0/0
ip address 12.1.1.1 255.255.255.0
interface GigabitEthernet0/1
ip address 14.1.1.1 255.255.255.0
interface GigabitEthernet0/2
ip address 13.1.1.1 255.255.255.0
All interfaces are now configured. There’s a useful command you can use to see all the VRFs and
their interfaces:
ISP#show ip vrf
Name Default RD Interfaces
AUSTRALIA <not set> Gi0/0
CHINA <not set> Gi0/2
JAPAN <not set> Gi0/1
ISP#
Our VRFs are configured, let’s take a look at the global routing table of the ISP router:
ISP#show ip route connected
ISP#
The global routing table has no entries, this is because all interfaces were added to a VRF. Let’s check
the VRF routing tables:
We use the show ip route command but you’ll need to specify which VRF you want to look at. As you
can see, each VRF has its own routing table with the interfaces that we configured earlier.
If you want to do something on the router like sending a ping then you’ll have to specify which VRF
you want to use. By default, it will use the global routing table. Here’s an example how to send a
ping:
That’s easy enough, just don’t forget to specify the correct VRF.
Below table compares both the VRF and VRF Lite and shares their differences:
VRF is VRF with MPLS and MPBGP VRF-lite is normally VRF without MPLS and
MPBGP
Full VRF is useful in Service Provider WAN environment where VRF lite is generally used in enterprise and Data
multiple customers are required to be routes across Center environment.
overlapping IP address space. Commonly limited to PE
(Provider edge) equipment.
May require Route target as part of configuration in service Doesn’t need Route target as part of
provider domain. configuration
(route target is like bgp extended community.
route target appears in a field in the update
messages)
VRF detail is shared between devices running VRF VRFs are locally significant and detail is not shared
between devices running VRF lite
Scope – Useful in Service Provider environment for Scope – Useful in Customer Enterprise / Data
segregating Customer Routing Table on the WAN (MPLS) side. Center environment for segregating Customer
Security Zones in routing tables on the LAN side of
IT setup.