Ccie en Part 01 Switch & Router
Ccie en Part 01 Switch & Router
Overview
OSPF (Open Shortest Path First)
OSPF is a standardized Link-State routing protocol, designed to scale efficiently to
support larger networks.
OSPF adheres to the following Link State characteristics:
OSPF employs a hierarchical network design using Areas.
OSPF will form neighbor relationships with adjacent routers in the same
Area.
Instead of advertising the distance to connected networks, OSPF advertises
the
status of directly connected links using Link-State Advertisements (LSAs).
OSPF sends updates (LSAs) when there is a change to one of its links, and
will only
send the change in the update. LSAs are additionally refreshed every 30
minutes.
OSPF traffic is multicast either to address 224.0.0.5 (all OSPF routers) or
224.0.0.6 (all Designated Routers).
OSPF uses the Dijkstra Shortest Path First algorithm to determine the
shortest
path.
OSPF is a classless protocol, and thus supports VLSMs.
Build the Protocol Run Routing
Database Algorithm
R1 R2
{
Hello
RID =10.1.1.1 Init on R2
• Init
Hello
RID =10.2.2.2 Init on R1
{
Hello
RID =10.1.1.1
2-Way on R2
N =10.2.2.2
• 2-
Way Hello
RID =10.2.2.2
2-Way on R1
N =10.1.1.1
OSPF Neighbour Adjacency Process
10.1.1.1 10.2.2.2
R1 R2
DBD
• EXSTAR MTU = 1500
T Flag = 0x7
Seq = 0x2499
DBD
• EXCHANGE MTU = 1500
Flag = 0x3
Seq = 0x837
OSPF Neighbour Adjacency Process
10.1.1.1 10.2.2.2
R1 R2
LS Request
LS Type
• LOADIN Link State
G ID
Advertising Router
LS Update
# LSA’s
• FULL LSA’s
LSA ..
•3.2.a Compare routing concepts of EIGRP and
OSPF (advanced distance vector vs. linked state,
load balancing, path selection, path operations,
metrics)
Type Cost
It is possible to control which router interfaces will participate in the OSPF process. Just as
with EIGRP and RIP, we can use the passive-interface command.
However, please note that the passive-interface command works differently with OSPF
than with RIP or IGRP. OSPF will no longer form neighbor relationships out of a “passive”
interface, thus this command prevents updates from being sent or received out of this
interface:
RouterC(config)# router ospf 1
RouterC(config-router)# network 10.4.0.0 0.0.255.255 area 0
RouterC(config-router)# network 10.2.0.0 0.0.255.255 area 0
RouterC(config-router)# passive-interface s0
Router C will not form a neighbor adjacency with Router
B.
It is possible to configure all interfaces to be passive using the passive- interface default
command, and then individually use the no passive- interface command on the interfaces
that neighbors should be formed on:
RouterC(config)# router ospf 1
RouterC(config-router)# network 10.4.0.0 0.0.255.255 area 0
RouterC(config-router)# network 10.2.0.0 0.0.255.255 area 0
RouterC(config-router)# passive-interface default
RouterC(config-router)# no passive-interface e0
Always remember, that the passive-interface command will prevent OSPF (and EIGRP)
from forming neighbor relationships out of that interface. No routing updates are passed in
either direction.
OSPF Authentication & Virtual Link
OSPF
Authentication
of
authentication must be identical (clear-text or MD5). The authentication keys do
not
need to be the same on every router in the OSPF area, but must be the same on
interfaces connecting two neighbors.
Please note: if authentication is enabled for Area 0, the same authentication must
be
configured on Virtual Links, as they are “extensions” of Area 0.
OSPF Virtual Links
Earlier in this guide, it was stated that all areas must directly connect into Area 0, as a
rule. In the above example, Area 2 has no direct connection to Area 0, but must transit
through Area 1 to reach the backbone area. In normal OSPF operation, this shouldn’t be
possible.
There may be certain circumstances that may prevent an area from directly connecting into
Area 0. Virtual links can be used as a workaround, to logically connect separated areas to
Area 0. In the above example, a virtual link would essentially create a tunnel from Area 2
to Area 0, using Area 1 a transit area. One end of the Virtual Link must be connected to
Area 0.
Configuration occurs on the Area Border Routers (ABRs) connecting Area 1 to Area 2
(Router B), and Area 1 to Area 0 (Router C). Configuration on Router B would be as
follows:
RouterB(config)# router ospf 1
RouterB(config-router)# router-id 2.2.2.2
RouterB(config-router)# area 1 virtual-link 3.3.3.3
The first command enables the ospf process. The second command manually sets the
router-id for Router B to 2.2.2.2.
The third command actually creates the virtual-link. Notice that it specifies area 1, which is
the transit area. Finally, the command points to the remote ABR’s Router ID of 3.3.3.3.
Configuration on Router C would be as follows:
RouterC(config)# router ospf 1
RouterC(config-router)# router-id 3.3.3.3
RouterC(config-router)# area 1 virtual-link 2.2.2.2
OSPF Virtual Links (continued)
It is also possible to have two separated (or discontiguous) Area 0’s. In order for OSPF to
function properly, the two Area 0’s must be connected using a virtual link.
Again, configuration occurs on the transit area’s ABRs:
RouterB(config)# router ospf 1
RouterB(config-router)# router-id 2.2.2.2
RouterB(config-router)# area 1 virtual-link 3.3.3.3
RouterC(config)# router ospf 1
RouterC(config-router)# router-id 3.3.3.3
RouterC(config-router)# area 1 virtual-link 2.2.2.2
Always remember: the area specified in the virtual-link command is
the
transit
As area.
stated Additionally,
earlier, the transit
if authentication area cannot
is enabled be a0,stub
for Area thearea.
same authentication must be
configured on Virtual Links, as they are “extensions” of Area 0:
RouterB(config)# router ospf 1
RouterB(config-router)# area 1 virtual-link 3.3.3.3 message-digest-key 1 md5 MYKEY
RouterC(config)# router ospf 1
RouterC(config-router)# area 1 virtual-link 2.2.2.2 message-digest-key 1 md5 MYKEY
OSPF Summarization |
Area Types | Default
Routes
Inter-Area OSPF Summarization
Consider the above example. OSPF is a classless routing protocol, thus all of the listed
networks would be advertised individually. This increases the size of the topology
databases and routing tables on routers in the domain, and may be undesirable. Advertising
only a summary route for inter-area communication can reduce the load on router CPUs.
For example, all of the networks in Area 1 can be summarized as 10.1.0.0/21. Similarly,
all of the networks in Area 2 can be summarized as 10.1.8.0/21.
Inter-area summarization is configured on Area Border Routers (ABRs).
Configuration on Router A would be as follows:
RouterA(config)# router ospf 1
RouterA(config-router)# network 10.1.0.0 0.0.7.255 area 1
RouterA(config-router)# area 1 range 10.1.0.0 255.255.248.0
The network statement includes all of the 10.1.x.0 networks into Area 1. The
area 1 range command creates a summary route for those networks, which is
then advertised into Area 0, as opposed to each route individually.
Proper design dictates that a static route be created for the summarized
network, pointing to the Null interface. This sends any traffic destined
specifically to the summarized address to the bit-bucket in the sky, in order to
prevent routing loops:
RouterA(config)# ip route 10.1.0.0 255.255.248.0 null0
In IOS versions 12.1(6) and later, this static route is created automatically.
External OSPF
Summarization
The first summary-address command summarizes the 15.0.0.0/16 and 15.1.0.0/16 networks
to 15.0.0.0/15, and advertises the summary as normal in the OSPF domain. The next two
summary-address commands specifically reference the 15.2.0.0/16 and 15.3.0.0/16
networks, with the not-advertise parameter. As implied, these networks will not be
advertised in OSPF.
OSPF Area Types
In order to control the propagation of LSAs in the OSPF domain, several area types
were developed.
Standard Area – A “normal” OSPF area.
Routers within a standard area will share Router (Type 1) and Network (Type 2)
LSAs to build their topology tables. Once fully synchronized, routers within an
area will all have identical topology tables.
Standard areas will accept Network Summary (Type 3) LSAs, which contain the
routes to reach networks in all other areas.
Standard areas will accept ASBR Summary (Type 4) and External (Type
5) LSAs, which contain the route to the ASBR and routes to external networks,
respectively.
Configuration of standard areas is straight forward:
Router(config)# router ospf 1
Router(config-router)# network 10.1.0.0 0.0.7.255 area 1
Stub Area – Prevents external routes from flooding into an
area. Like Standard areas, Stub area routers will share Type 1 and Type 2 LSAs to build
their topology tables.
Stub areas will also accept Type 3 LSAs to reach other areas.
Stub areas will not accept Type 4 or Type 5 LSAs, detailing routes to external
networks.
The purpose of Stub areas is to limit the number of LSAs flooded into the area, to
conserve
bandwidth and router CPUs. The Stub’s ABR will automatically inject a default
route into
the Stub area, so that those routers can reach the external networks. The ABR will be
the
next-hop for the default route.
Configuration of stub areas is relatively simple:
Router(config)# router ospf 1
Router(config-router)# network 10.1.0.0 0.0.7.255 area 1
Router(config-router)# area 1 stub
The area 1 stub command must be configured on all routers in the Stub area.
OSPF Area Types (continued)
Totally Stubby Area – Prevents both inter-area and external routes from flooding into
an area.
Like Standard and Stub areas, Totally Stubby area routers will share Type 1 and
Type 2 LSAs to build their topology tables.
Totally Stubby areas will not accept Type 3 LSAs to other areas.
Totally Stubby areas will also not accept Type 4 or Type 5 LSAs, detailing routes
to external networks.
Again, the purpose of Totally Stubby areas is to limit the number of LSAs flooded into
the area, to conserve bandwidth and router CPUs. The Stub’s ABR will instead
automatically inject a default route into the Totally Stubby area, so that those routers
can reach both inter-area networks and external networks. The ABR will be the next-hop
for the default route.
Configuration of totally stubby areas is relatively
simple: Router(config)# router ospf 1
Router(config-router)# network 10.1.0.0 0.0.7.255 area 1
Router(config-router)# area 1 stub no-summary
The area 1 stub no-summary command is configured only on the ABR of the
Totally Stubby area; other routers within the area are configured with the area 1
stub command. No ASBRs are allowed in a Totally Stubby area.
In the above example, if we were to configure Area 1 as a Totally Stubby area, it
would not accept any external routes originating from the ASBR (Router G). It
also would not accept any Type 3 LSAs containing route information about
Area 0 and Area 2. Instead, Router C (the ABR) will inject a default route into
Area 1, and all routers within Area 1 will use Router C as their gateway to all
other networks.
OSPF Area Types (continued)
External
Networks
More External
Networks
Area 1 Area 2
Router G
Router A Router E
Router C Router D
Area 1 Area 2
Router G
Router A Router E
Router C Router D
Totally Not So Stubby Area (TNSSA) – Similar to a Totally Stubby area; prevents both
inter-area and external routes from flooding into an area, unless those external routes
originated from an ASBR within the NSSA area.
Like Standard and Stub areas, TNSSA area routers will share Type 1 and Type 2
LSAs to build their topology tables.
TNSSA areas will not accept Type 3 LSAs to other areas.
TNSSA areas will not accept Type 4 or Type 5 LSAs, detailing routes to external
networks.
If an ASBR exists within the TNSSA area, that ASBR will generate Type 7
LSAs.
With the exception of not accepting inter-area routes, TNSSA areas are identical in
function to NSSA areas.
Configuration of TNSSA areas is relatively simple:
Router(config)# router ospf 1
Router(config-router)# network 10.1.0.0 0.0.7.255 area 1
Router(config-router)# area 1 nssa no-summary
The area 1 nssa no-summary command is configured only on the ABR of the TNSSA area;
other routers within the area are configured with the area 1 nssa command.
OSPF and Default Routes
We have learned about four types of OSPF areas:
Standard areas Totally Stubby areas
Stub areas Not So Stubby areas (NSSA)
The ABRs and ASBRs of Standard areas do not automatically generate (or inject)
default routes into the area. Consider the following example:
Area 1 Area 0
External
Networks
Router A Router C
Router B
Assume that Area 1 is configured as a Standard area. Router C will forward Type 3 LSAs
from all other areas into Area 1, allowing Router A and Router B to reach inter-area
networks.
Notice also that Router A is an ASBR, connecting to an external Autonomous System.
Thus, Router A will generate Type 5 LSAs, detailing the routes to these external networks.
To additionally force Router A to generate a default route (indicating itself as the next
hop) for the external networks, and inject this into Area 1. This default route will be
advertised as a Type 5 LSA to all other areas:
RouterA(config)# router ospf 1
RouterA(config-router)# default-information originate
Router A must have a default route in its routing table in order for the above command to
function. Router A’s default route would point to some upstream router in the external
Autonomous System.
If a default route does not exist in its routing table, Router A can still be forced
to advertise a default route using the always parameter:
RouterA(config)# router ospf 1
RouterA(config-router)# default-information originate always
OSPF and Default Routes (continued)
The ABRs of Stub and Totally Stubby areas automatically generate (and inject) a default
route (0.0.0.0/0) into the area. Routers in Stub areas use this default route to reach external
networks, while routers in Totally Stubby areas use the default route to reach both inter-
area and external networks.
To control the “cost” metric of the default route in Stub or Totally Stubby areas
(configured on the ABR):
Router(config)# router ospf 1
Router(config-router)# area 1 stub
Router(config-router)# area 1 default-cost 10
The ABRs of NSSA areas must be manually configured to generate (and inject) a
default route into the area:
Router(config)# router ospf 1
Router(config-router)# area 1 nssa default-information-originate
EIGRP
Overview
EIGRP
Basics
• Advanced distance vector, TLV based
protocol
• Uses DUAL algorithm
• Runs directly on top of IP/IPv6 protocol
88
• Uses multicast capabilities(Neighbour
relationship &Updates) EIGRP AS
1
• Support unequal cost path load
balancing
• Metric is based on the
bandwidth and
delay
EIGRP (Enhanced Interior Gateway Routing Protocol)
The above command allows us to change the hello timer to 7 seconds for Autonomous
System 10.
In addition to the Hello timer, EIGRP neighbors are stamped with a Hold timer. The
Hold timer indicates how long a router should wait before marking a neighbor inactive, if
it stops receiving hello packets from that neighbor.
By default, the Hold timer is three times the Hello timer. Thus, on high- speed links the
timer is set to 15 seconds, and on slower WAN links the timer is set to 180 seconds.
The Hold timer can also be adjusted on a per interface basis:
Router(config-if)# ip hold-interval eigrp 10 21
The above command allows us to change the hold timer to 21 seconds for Autonomous
System 10.
Changing the Hello timer does not automatically change the Hold timer. Additionally,
Hello and Hold timers do not need to match between routers for an EIGRP neighbor
relationship to form.
EIGRP Neighbors (continued)
A neighbor table is constructed from the EIGRP Hello packets, which includes the
following information:
The IP address of the neighboring router.
The local interface that received the neighbor’s Hello packet.
The Hold timer.
A sequence number indicating the order neighbors were learned.
Adjacencies will not form unless the primary IP addresses on connecting interfaces are on
the same subnet. Neighbors cannot be formed on secondary addresses.
If connecting interfaces are on different subnets, an EIGRP router will log the following
error to console when a multicast Hello is received:
00:11:22: IP-EIGRP: Neighbor 172.16.1.1 not on common subnet for Serial0
Always ensure that primary IP addresses belong to the same subnet between EIGRP
neighbors.
To log all neighbor messages and errors to console, use the following two
commands: Router(config)# router eigrp 10
Router(config-router)# eigrp log-neighbor-changes
Router(config-router)# eigrp log-neighbor-warnings
The EIGRP Topology Table
Once EIGRP neighbors form adjacencies, they will begin to share routing information.
Each router’s update contains a list of all routes known by that router, and the respective
metrics for those routes.
All such routes are added to an EIGRP router’s topology table. The route with the lowest
metric to each network will become the Feasible Distance (FD). The Feasible Distance
for each network will be installed into the routing table.
The Feasible Distance is derived from the Advertised Distance of the router
sending the update, and the local router’s metric to the advertising router.
Confused? Consider the following example:
Router A has three separate paths to the Destination Network, either through Router B, C, or D. If we add up the metrics
to form a “distance” (the metrics are greatly simplified in this example), we can determine the following:
Router B’s Feasible Distance to the Destination Network is 8.
Router C’s Feasible Distance to the Destination Network is 23.
Router D’s Feasible Distance to the Destination Network is 9.
Router B sends an update to Router A, it will provide an Advertised Distance of 8 to the Destination Network.
Router C will provide an AD of 23, and D will provide an AD of 9.
Router A calculates the total distance to the Destination network by adding the AD of the advertising router, with its
own distance to reach that advertising router. For example, Router A’s metric to Router B is 8; thus, the total distance
will be 16 to reach the Destination Network through Router B.
Remember, however, that Router A’s Feasible Distance must be the route with the
lowest metric. If we add the Advertised Distance with the local metric between each
router, we would see that:
The route through Router B has a distance of 16 to the destination
The route through Router C has a distance of 27 to the destination
The route through Router D has a distance of 11 to the destination
Thus, the route through Router D (metric of 11) would become the Feasible
Distance
for Router A, and is added to the routing table as the best route.
This route is identified as the Successor.
To allow convergence to occur quickly if a link fails, EIGRP includes backup routes in the
topology table called Feasible Successors (FS). A route will only become a Successor if its
Advertised Distance is less than the current Feasible Distance. This is known as a Feasible
Condition (FC).
For example, we determined that Router A’s Feasible Distance to the destination is 11,
through Router D. Router C’s Advertised Distance is 23, and thus would not become a
Feasible Successor, as it has a higher metric than Router A’s current Feasible
Distance. Routes that are not Feasible Successors become route Possibilities.
Router B’s Advertised Distance is 8, which is less than Router A’s current Feasible
Distance. Thus, the route through Router B to the Destination Network would become a
Feasible Successor.
Feasible Successors provide EIGRP with redundancy, without forcing routers to re-
converge (thus stopping the flow of traffic) when a topology change occurs. If no Feasible
Successor exists and a link fails, a route will enter an Active (converging) state until an
alternate route is found.
EIGRP Packet Types
&
Configuring EIGRP
Metrics
EIGRP Packet Types
EIGRP employs five packet types:
Hello packets - multicast
Update packets – unicast or multicast
Query packets – multicast
Reply packets – unicast
Acknowledgement packets - unicast
Hello packets are used to form neighbor relationships, and were explained in detail
previously. Hello packets are always multicast to address 224.0.0.10.
Update packets are sent between neighbors to build the topology and routing tables.
Updates sent to new neighbors are sent as unicasts. However, if a route’s metric is
changed, the update is sent out as a multicast to address 224.0.0.10.
Query packets are sent by a router when a Successor route fails, and there are no
Feasible Successors in the topology table. The router places the route in an Active state,
and queries its neighbors for an alternative route. Query packets are sent as a multicast
to address 224.0.0.10.
Reply packets are sent in response to Query packets, assuming the responding router
has an alternative route (feasible successor). Reply packets are sent as a unicast to
the querying router.
Recall that EIGRP utilizes the Reliable Transport Protocol (RTP) to ensure reliable
delivery of most EIGRP packets. Delivery is guaranteed by having packets acknowledged
using…..Acknowledgment packets!
Acknowledgment packets (also known as ACK’s) are simply Hello packets with no data,
other than an acknowledgment number. ACK’s are always sent as unicasts. The following
packet types employ RTP to ensure reliable delivery via ACK’s:
Update Packets
Query Packets
Reply Packets
Hello and Acknowledgments packets do not utilize RTP, and thus do not require
acknowledgement.
EIGRP Route States
An EIGRP route can exist in one of two states, in the topology table:
Active state
Passive State
A Passive state indicates that a route is reachable, and that EIGRP is fully converged. A
stable EIGRP network will have all routes in a Passive state.
A route is placed in an Active state when the Successor and any Feasible Successors fail,
forcing the EIGRP to send out Query packets and re- converge. Multiple routes in an Active
state indicate an unstable EIGRP network. If a Feasible Successor exists, a route should
never enter an Active state.
Routes will become Stuck-in-Active (SIA) when a router sends out a Query packet, but
does not receive a Reply packet within three minutes. In other words, a route will become
SIA if EIGRP fails to re-converge. The local router will clear the neighbor adjacency with
any router(s) that has failed to Reply, and will place all routes from that neighbor(s) in an
Active state.
To view the current state of routes in the EIGRP topology table:
Router# show ip eigrp topology
IP-EIGRP Topology Table for AS(10)/ID(172.19.1.1)
It is possible to control which router interfaces will participate in the EIGRP process. Just
as with RIP, we can use the passive-interface command.
However, please note that the passive-interface command works differently with EIGRP
than with RIP or IGRP. EIGRP will no longer form neighbor relationships out of a
“passive” interface, thus this command prevents updates from being sent or received out of
this interface:
RouterC(config)# router eigrp 10
RouterC(config-router)# network 10.4.0.0
RouterC(config-router)# network 10.2.0.0
RouterC(config-router)# passive-interface s0
Router C will not form a neighbor adjacency with Router
B. can configure all interfaces to be passive using the passive-interface default
We
command, and then individually use the no passive-interface command on the interfaces
we do want neighbors to be formed on:
RouterC(config)# router eigrp 10
RouterC(config-router)# network 10.4.0.0
RouterC(config-router)# network 10.2.0.0
RouterC(config-router)# passive-interface default
RouterC(config-router)# no passive-interface e0
Always remember, that the passive-interface command will prevent EIGRP (and OSPF)
from forming neighbor relationships out of that interface. No routing updates are passed in
either direction.
EIGRPAuto-Summarization
EIGRP is a classless routing protocol that supports Variable Length Subnet Masks
(VLSMs). The above example would pose no problem for EIGRP.
However, EIGRP will still automatically summarize when crossing major network
boundaries.
For example, when Router A sends an EIGRP update to Router B via Serial0, by default it
will still summarize the 10.1.0.0/16 network to 10.0.0.0/8. This is because the
10.1.0.0/16 and 192.168.123.0/24 networks do not belong to the same major network.
Likewise, the 66.115.33.0/24 network will be summarized to 66.0.0.0/8.
An auto-summary route will be advertised as a normal internal EIGRP route. The best
(lowest) metric from among the summarized routes will be applied to this summary route.
The router that performed the auto-summarization will also add the summary route to its
routing table, with a next hop of the Null0 interface. This is to prevent routing loops.
This auto-summarization can be disabled:
RouterA(config)# router eigrp 10
RouterA(config-router)# no auto-summary
The no auto-summary command will prevent Router A from summarizing the 10.1.0.0/16
and 66.115.33.0/24 networks.
EIGRP Manual Summarization
The first command creates a key chain called MYCHAIN. We must then associate a key to
our keychain. Then we actually configure the shared key using the key-string command.
We then apply our key chain to the interface connecting to the other
router: RouterA(config)# interface s0
RouterA(config-if)# ip authentication key-chain eigrp 10 MYCHAIN
RouterB(config)# interface s0
RouterB(config-if)# ip authentication key-chain eigrp 10 MYCHAIN
If there was another router off of Router B’s Ethernet port, we could create a
separate key chain with a different key-string. Every router on the EIGRP domain
does not need to use the same key chain, only interfaces directly connecting two
(or more) routers.
The final step in configuring authentication is identifying which encryption to
use. Unlike RIP, EIGRP only supports MD5 encryption:
RouterA(config)# interface s0
RouterA(config-if)# ip authentication mode eigrp 10 md5
Please note that configuring authentication for EIGRP is similar to that of RIP,
but there are slight variations in the commands, including the addition of the
EIGRP Autonomous System Number.
EIGRP Load-
Balancing Stub &
Authentication Lab
EIGRP Load-Balancing
By default, EIGRP will automatically load-balance across equal-metric routes (four by default, six maximum).
EIGRP also supports load-balancing across routes with an unequal metric.
Consider the following example:
Earlier in this section, we established that Router A would choose the route through Router
D as its Feasible Distance to the destination network. The route through Router B
became a Feasible Successor.
By default, EIGRP will not load-balance between these two routes, as their metrics are
different (11 through Router D, 16 through Router B). We must use the variance command
to tell EIGRP to load-balance across these unequal-metric links:
RouterA(config)# router eigrp 10
RouterA(config-router)# variance 2
RouterA(config-router)# maximum-paths 6
The variance command assigns a “multiplier,” in this instance of 2. We multiply this
variance value by the metric of our Feasible Distance (2 x 11
= 22). Thus, any Feasible Successors with a metric within twice that of our
Feasible Distance (i.e. 12 through 22) will now be used for load balancing by EIGRP.
Remember, only Feasible Successors can be used for load balancing, not Possibilities
(such as the route through Router C).
The maximum-paths command adjusts the number of links EIGRP can load- balance across.
EIGRP Stubs
Consider the above hub-and-spoke environment. If Router C were to fail, Router A (the
hub router) would mark the 10.2.0.0/16 route as Active, and send out Query packets
to the spoke routers for an alternate path.
However, it is obvious that no other route exists to the 10.2.0.0/16 network. Thus, the
querying process is a waste of bandwidth and resources.
To prevent unnecessary querying, “spoke” routers in a hub-and-spoke environment can be
configured as Stub routers. A stub router builds a neighbor adjacency with its hub
router(s), and will inform neighbors of its stub status. The stub router will still build the
full topology table.
However, the stub router will immediately respond to any Query packets with an
Inaccessible message. Neighbors will eventually stop querying the stub router, which helps
EIGRP converge quicker and conserves bandwidth.
Configuration of an EIGRP stub is always performed on the spoke router:
RouterB(config)# router eigrp 10
RouterB(config-router)# eigrp stub connected
The eigrp stub command configures this router as Stub, and supports four possible
parameters:
Receive-only – router will not share updates with neighbors
Connected – router will only advertise connected networks
Static – router will only advertise static networks
Summary – router will only advertise summary routes
The connected and static parameters will only advertise those networks if they have been
injected into the EIGRP process, either using network statements or using route
redistribution. By default, EIGRP stubs will only send connected and summary routes to
neighbors.
Troubleshooting EIGRP
To view the EIGRP Neighbor Table:
Router# show ip eigrp neighbor
IP-EIGRP neighbors for process 10
To view the EIGRP Topology Table, containing all EIGRP route information:
Router# show ip eigrp
topology Topology Table for AS(10)/ID(172.19.1.1)
IP-EIGRP
This command provides us with information on EIGRP timers, EIGRP metrics, summarization, and the specific
networks RIP is advertising.
D
To view a specific route within the IP routing
table:
Router# show ip route 10.3.0.0
Routing entry for 10.3.0.0/16
Known via “eigrp 10”, distance 90, metric 2297856 type internal
Last update from 172.16.1.2 on Serial 0, 00:00:15 ago
The first step in configuring BGP is to enable the BGP process, and specify the router’s
Autonomous System (AS):
RouterB(config)# router bgp 100
Notice that the syntax is the same, and that the remote-as argument is always used,
regardless if the peering is iBGP or eBGP.
For stability purposes, the source interface used to generate updates to a particular
neighbor can be specified:
RouterB(config)# router bgp 100
RouterB(config-router)# neighbor 172.16.1.2 update-source lo0
RouterC must then point to RouterB’s loopback (assume the address is 1.1.1.1/24)
in its
neighbor statement:
RouterC(config)# router bgp 900
RouterC(config-router)# neighbor 1.1.1.1 remote-as 100
RouterC must have a route to RouterB’s loopback in its routing table.
Remember though: by default, BGP assumes that external peers are exactly one hop away.
Using the loopback as a source interface puts RouterB two hops away from RouterC. Thus,
the ebgp-multihop feature must be enabled:
RouterC(config)# router bgp 900
RouterC(config-router)# neighbor 1.1.1.1 ebgp-multihop 2
The 2 indicates the number of hops to the eBGP peer. If left blank, the default is 255.
To authenticate updates between two BGP peers:
RouterB(config)# router bgp 100
RouterB(config-router)# neighbor 172.16.1.2 password CISCO
Configuring BGP Timers
To globally adjust the Keepalive and Hold-time timers for all neighbors:
RouterB(config)# router bgp 100
RouterB(config-router)# timers bgp 30 90
The above command sets the Keepalive timer to 30 seconds, and the Hold- time timer to 90
seconds. If the configured Hold-time timers between two peers are different, the peer session
will still be established, and the smallest timer value will be used.
To adjust the timers for a specific neighbor (which overrides the global timer configuration):
RouterB(config)# router bgp 100
RouterB(config-router)# neighbor 172.16.1.2 timers 30 90
Viewing BGP Neighbors &
BGP Synchronization
Viewing BGP Neighbors
To view the status o f all BGP neighbors:
RouterB# show ip bgp neighbors
Consider the above example. AS 200 is serving as a transit between AS 100 and AS
300. BGP follows a synchronization rule that states that all routers in a transit AS,
including non-BGP routers, must learn of a route before BGP can advertise it to an
external peer.
Confused?
Consider the above example again. If RouterA advertises a BGP route to RouterB (an
eBGP peer) for the 10.5.0.0/16 network, that same BGP route will eventually be
forwarded to RouterD (an iBGP peer).
However, a blackhole would exist if RouterD then advertised that update to RouterE, as
RouterC would not have the 10.5.0.0/16 network in its routing table. If RouterE attempts to
reach the 10.5.0.0 network, RouterC will drop the packet.
BGP’s synchronization rule will force RouterD to wait until RouterC learns the 10.5.0.0/16
route, before forwarding that route to RouterE. How will RouterD know when RouterC
learns the route? Simple! When it receives an update from RouterC via an IGP (such as
OSPF), containing that route.
BGP synchronization can be disabled under two circumstances:
The local AS is not a transit between two other AS’s
All routers in the transit AS run iBGP, and are fully meshed.
To disable BGP synchronization:
RouterD(config)# router bgp 200
RouterD(config-router)# no synchronization
As of IOS 12.2(8)T, synchronization is disabled by default.
10.1.1.0/24
10.1.2.0/24
10.1.4.0/24
Originating Prefixes in
BGP & The BGP
Routing Table
Originating Prefixes in BGP
There are three ways to originate a prefix (in other words, advertise a network) into
BGP:
By using network statements
By using aggregate-address statements
By redistributing an IGP into BGP
Using the network statement informs BGP which networks to advertise to eBGP peers, not
which interfaces to run BGP on. The network command can be used to inject any network
from the local AS into BGP, include dynamic routes learned from an IGP, and not just the
routes directly connected to the router.
However, the route must be in the routing table before BGP will advertise the network to
an eBGP peer. This is a fundamental BGP rule.
Consider the above example. RouterB may inject the 10.5.0.0/16 network into BGP using
the network command. However, unless that route is in the local routing table (in this case,
via an IGP), RouterB will not advertise the route to RouterC.
Furthermore, the network statement must match the route exactly as it is in the routing
table:
RouterB(config)# router bgp 100
RouterB(config-router)# neighbor 172.16.1.2 remote-as 900
RouterB(config-router)# network 10.5.0.0 mask 255.255.0.0
The above configuration would match the route perfectly, while the following
configuration would not:
RouterB(config-router)# network 10.5.0.0 mask 255.255.255.0
Notice that AS 100 has been added to the path, and that the Next Hop is now
RouterB.
BGP Route-Reflectors &
BGP Confederations &
BGP Peer-Groups
BGP Route-Reflectors
Recall that BGP requires all iBGP peers to be fully meshed. Route- Reflectors allow us
to bypass this restriction. Fewer neighbor connections will result in less bandwidth and
CPU usage.
Route-reflector clients form neighbor adjacencies with the route-reflector server. BGP
updates will flow from the server to the clients, without the clients having to interact
with each other.
Consider the above example. In AS 100, there are three BGP speakers. Normally, these
iBGP peers must be fully-meshed. For example, RouterB would need a neighbor statement
for both RouterA and RouterD.
As an alternative, RouterA can be configured as a route-reflector server. Both RouterB
and RouterD would only need to peer with RouterA.
All route-reflector specific configuration takes place on the route reflector server:
RouterA(config)# router bgp 100
RouterA(config-router)# neighbor 10.2.1.2 remote-as 100
RouterA(config-router)# neighbor 10.2.1.2 route-reflector-client
RouterA(config-router)# neighbor 10.1.1.2 remote-as 100
RouterA(config-router)# neighbor 10.1.1.2 route-reflector-client
Route-reflectors are Cisco’s recommended method of alleviating the
iBGP full-mesh
requirement.
BGP Confederations
Confederations are an alternative method to alleviate the requirement that all iBGP
routers be fully meshed. Confederations are essentially AS’s within an AS, and are
sometimes referred to as sub-AS’s.
In the above example, RouterA belongs to AS 777 and RouterB belongs to AS 888.
Both of those AS’s belong to a parent AS of 300. RouterA and RouterB will form an
eBGP peer session.
Configuration is simple:
RouterB(config)# router bgp 888
RouterB(config-router)# bgp confederation identifier 300
RouterB(config-router)# bgp confederation peer 777
RouterB(config-router)# neighbor 10.1.1.1 remote-as 777
RouterB(config-router)# neighbor 172.16.1.2 remote-as 500
Notice that the sub-AS (777) is used in the router bgp statement. Additionally, the
parent AS must be specified using a bgp confederation identifier statement.
Finally, any confederation peers must be identified.
RouterC will be unaware of RouterB’s confederation status. Thus, RouterC’s
neighbor statement will point to AS 300, and not AS 888:
RouterC(config)# router bgp 500
RouterC(config-router)# neighbor 172.16.1.1 remote-as 300
(Reference: http://www.cisco.com/univercd/cc/td/doc/cisintwk/ics/icsbgp4.htm#wp6834)
BGP Peer-Groups
Peer-groups simplify configuration of groups of neighbors, assuming those neighbors
share identical settings. Additionally, peer-groups conserve processor/memory resources by
sending updates to all peer-group members simultaneously, as opposed to sending
individual updates to each neighbor.
All neighbor parameters are applied to the peer-group itself. Configuration is simple:
Router(config)# router bgp 200
Router(config-router)# neighbor MYPEERGROUP peer-group
Router(config-router)# neighbor MYPEERGROUP remote-as 200
Router(config-router)# neighbor MYPEERGROUP update-source lo0
Router(config-router)# neighbor MYPEERGROUP route-reflector-client
The above configuration creates a peer-group named MYPEERGROUP, and applies the
desired settings. Next, we must “assign” the appropriate neighbors to the peer-group:
Router(config-router)# neighbor 10.10.1.1 peer-group MYPEERGROUP
Router(config-router)# neighbor 10.10.2.2 peer-group MYPEERGROUP
Router(config-router)# neighbor 10.10.3.3 peer-group MYPEERGROUP
The above neighbors now inherit the settings of the peer-group named
MYPEERGROUP.
All “members” of a peer-group must exclusively be internal (iBGP) peers or
external (eBGP) peers. A mix of internal and external peers is not allowed in
a peer-group.
Outbound route filtering (via a distribution-list, route-map, etc.) must be
identical on all members of a peer-group. Inbound route filtering can still be
applied on a per-neighbor basis.
10.1.1.0/24
10.1.2.0/24
10.1.4.0/24
BGP “Best Path”
Determination
BGP “Best Path” Determination
If BGP contains multiple routes to the same destination, it compares the routes in pairs, starting with
the newest entries (listed higher in the routing table), and working towards the oldest entries (listed
lower in the table).
BGP determines the best path by successively comparing the attributes of each “route pair.” The
attributes are compared in a specific order:
Weight – Which route has the highest weight?
Local Preference – Which route has the highest local preference?
Locally Originated – Did the local router originate this route? In other words, is the next hop
to the destination 0.0.0.0?
AS-Path – Which route has the shortest AS-Path?
Origin Code – Where did the route originate? The following origin codes are listed in order of
preference:
o IGP (originated from an interior gateway protocol)
o EGP (originated from an exterior gateway protocol)
o ? (Unknown origin)
MED – Which path has the lowest MED?
BGP Route Type – Is this an eBGP or iBGP route? (eBGP routes are preferred)
Age – Which route is the oldest? (oldest is preferred)
Router ID – Which route originated from the router with the lowest BGP router ID?
Peer IP Address – Which route originated from the router with the lowest IP?
When applying attributes, Weight and Local Preference are applied to
inbound routes, dictating the best outbound path.
AS-Path and MED are applied to outbound routes, dictating the best inbound
path.
(Reference: http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml)
Weigh
t
The Weight attribute is applied to inbound routes, dictating the best outbound path.
It is a Cisco-proprietary attribute, and is only locally significant (and thus, is never
passed on to BGP neighbors).
The weight value can range from 0 – 65535, and the highest weight is preferred. By
default, a route originated on the local router will be assigned a weight of 32768. All other
routes will be assigned a weight of 0, by default.
A weight value can be specified for all routes advertised from a specific neighbor:
RouterA(config)# router bgp 100
RouterA(config)# neighbor 10.1.1.2 weight 200
Otherwise, a weight value can be specified for specific routes from a particular
neighbor. First, the prefixes in question must be identified:
RouterA(config)# ip prefix-list MYLIST 192.168.1.0/24
Then, a route-map is used to apply the appropriate weight:
RouterA(config)# route-map WEIGHT permit 10
RouterA(config-route-map)# match ip address prefix-list MYLIST
RouterA(config-route-map)# set weight 200
RouterA(config-route-map)# route-map WEIGHT permit 20
Finally, the route-map is applied to the preferred neighbor:
RouterA(config)# router bgp 100
RouterA(config)# neighbor 10.1.1.2 route-map WEIGHT in
Local Preference
The Local Preference attribute is applied to inbound external routes, dictating the best
outbound path. Unlike the Weight attribute, Local Preference is passed on to iBGP peers
when sending updates. Local Preference informs iBGP routers how to exit the AS, if
multiple paths exist.
Local Preference is a 32-bit number, and can range from 0 to 4294967295. The highest
Local Preference is preferred, and the default preference is 100.
The Local Preference value can be specified for all inbound external routes, on a global
basis for BGP:
RouterB(config)# router bgp 100
RouterB(config-router)# bgp default local-preference 200
RouterD(config)# router bgp 100
RouterD(config-router)# bgp default local-preference 300
Both RouterB and RouterD will include the Local Preference attribute in updates to iBGP
neighbors. Thus, RouterA (and RouterB) will now prefer the route through RouterD to
reach any destination outside the local AS.
Local Preference can be applied on a per-route basis:
RouterD(config)# ip prefix-list MYLIST 192.168.1.0/24
RouterD(config)# route-map PREFERENCE permit
10
RouterD(config-route-map)# match ip address prefix-list MYLIST
RouterD(config-route-map)# set local-preference 300
RouterD(config)# router bgp 10
RouterD(config)# neighbor 172.17.1.2 route-map PREFERENCE
(Reference: http://www.cisco.com/warp/public/459/bgp-toc.html#localpref)
in
Lab
AS-Path Prepend
The AS-Path attribute is applied to outbound routes, dictating the best inbound path. Two
things can be accomplished with the AS-Path attribute, prepend or filter.
To prepend to (or add to) the existing AS-Path results in a longer AS-Path, which makes
the
route less desirable for inbound traffic:
RouterB(config)# access-list 5 permit 10.5.0.0 0.0.255.255
RouterB(config)# route-map ASPREPEND permit 10
RouterB(config-route-map)# match ip address 5
RouterB(config-route-map)# set as-path prepend 200 200
RouterB(config-route-map)# route-map ASPREPEND permit 20
RouterB(config)# router bgp 100
RouterB(config-router)# neighbor 172.16.1.2 route-map ASPREPEND out
Notice the inflated AS-Path through RouterB. RouterC will prefer the
path through RouterD to reach the 10.5.0.0/16 network.
MED
The MED (MultiExit Discriminator) attribute is applied to outbound routes, dictating the
best inbound path into the AS (assuming multiple paths exist). The MED is identified as
the BGP metric when viewing the BGP routing table. A lower metric is preferred, and the
default MED value is 0.
In the above example, there are two entry points into AS 100. To force AS 900 to prefer
that path through RouterD to reach the 10.5.0.0/16 network, the set metric command can
be used with a route-map:
RouterB(config)# access-list 5 permit 10.5.0.0 0.0.255.255
RouterB(config)# route-map SETMED permit 10
RouterB(config-route-map)# ip address 5
RouterB(config-route-map)# set metric 200
match
RouterB(config)# router bgp 100
RouterB(config-router)# neighbor 172.16.1.2 route-map SETMED out
RouterC will now have two entries for the 10.5.0.0/16 route:
RouterC# show ip bgp
Network Next Hop Metric LocPrf Weight Path
* 10.5.0.0 172.16.1.1 200 100 0 100 i
*> 10.5.0.0 172.17.1.1 0 100 0 100 i
Notice that the route from RouterB has a higher metric, and thus is less preferred. Note specifically
the lack of a > on the route with a higher metric.
The MED value is exchanged from one AS to another, but will never be advertised further than
that. Thus, the MED value is passed from AS 100 to all BGP routers in AS 900, but the metric will
be reset to 0 if the route is advertised beyond AS 900.
The MED metric on routes sent to eBGP neighbors can be dynamically set to the actual
metric of an IGP (such as OSPF). This is accomplished using the set metric-type internal
command with a route-map:
RouterB(config)# access-list 5 permit 10.5.0.0 0.0.255.255
RouterB(config)# route-map MED_INTERNAL permit 10
RouterB(config-route-map)# match ip address 5
RouterB(config-route-map)# set metric-type internal
RouterB(config)# router bgp 100
RouterB(config-router)# neighbor 172.17.1.2 route-map
MED_INTERNAL out
If the 10.5.0.0/16 network originated in OSPF, the link-state cost metric for that route will
be applied as the MED metric.
Communities
BGP allows routes to be placed (or tagged) into certain Communities. BGP routers can
make route policy decisions based on a route’s community membership.
BGP communities can be assigned using one of three 32-bit formats:
Decimal (1000000)
Hexadecimal (0x1A2B3C)
AA:NN (100:20)
The AA:NN format specifies a 16-bit AS number (the AA), and a 16-bit generic
community identifier (NN).
By default, the decimal format for communities will be displayed when viewing
a
route. To force the router to display the AA:NN format:
RouterA(config)# ip bgp-community new-format
Additionally, there are four well-known communities that can be referenced by name:
No-export – prevents the route from being advertised outside the local AS to
eBGP peers.
No-advertise – prevents the route from being advertised to either internal or
external peers.
Internet – allows the route to be advertised outside the local AS.
Local-AS – prevents the route from being advertised outside the local AS to
either eBGP or confederate peers.
To set the community for a specific route, using a route-
map:RouterB(config)# access-list 5 permit 10.5.0.0 0.0.255.255
RouterB(config)# route-map COMMUNITY permit 10
RouterB(config-route-map)# match ip address 5
RouterB(config-route-map)# set community no-export
RouterB(config)# route-map COMMUNITY permit 20
RouterB(config)# router bgp 100
RouterB(config-router)# neighbor 172.16.1.2 send-community
RouterB(config-router)# neighbor 172.16.1.2 route-map COMMUNITY out
The community attribute will not be advertised to a neighbor unless the send-
community parameter is applied to the neighbor command, regardless if a
community value is applied using a route-map.
The above configuration will place the 10.5.0.0/16 route into the no-export community
once it is advertised into AS 900. RouterC will advertise this network to all iBGP peers, but
the community attribute will prevent RouterC (and all iBGP peers) from advertising the
route outside of AS 900.
By default, the set community route-map command will overwrite any existing
community parameters for a route. To instead append additional community values, the
additive parameter must be specified:
RouterB(config)# route-map COMMUNITY permit 10
RouterB(config-route-map)# match ip address 5
RouterB(config-route-map)# set community no-export additive
RouterB(config)# route-map COMMUNITY permit 20
Origin
The Origin attribute identifies the originating source of the route. The origin codes are as
follows (listed in order of preference for route selection):
i (IGP) – Originated from an interior gateway protocol, such as OSPF. This usually
indicates the route was injected into BGP via the network command under the BGP
process. An origin code of “i” is most preferred.
e (EGP) – Originated from an external gateway protocol.
AS-Path Filtering
Additionally, routes can be filtered based on AS-Path values, using an as- path access-list. This requires the use
of
regular expressions:
The following examples illustrate the use of regular expressions:
To configure RouterF to only accept routes that originated from
AS100:
RouterF(config)# ip as-path access-list 15 permit _100$
RouterF(config)# route-map ASFILTER permit 10
RouterF(config-route-map)# match as-path 15
RouterF(config)# router bgp 50
RouterF(config-router)# neighbor 10.5.1.1 route-map ASFILTER in
To view what BGP routing entries the AS-Path access-list will
match:
RouterF# show ip bgp regexp _100$
(Reference: http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094a92.shtml)
? (incomplete) - Unknown origin. This usually indicates the route was redistributed
into BGP (from either connected, static, or IGP routes). An origin code of “?” is
the least preferred.
When viewing the BGP routing table, the origin code is listed at the end of each line in
the table:
RouterB# show ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 10.5.0.0 10.1.1.1 0 0 0 i
*> 192.168.1.0 172.16.1.2 0 100 0 900 ?
The i at the end of the first routing entry indicates the 10.5.0.0 network was originated via an IGP, probably
with the BGP network command. The 192.168.1.0 network was most likely redistributed into BGP in AS 900,
as evidenced by the ? at the end of that routing entry.
BGP Summarization
Routes that are redistributed into BGP are automatically summarized. To disable auto-
summary:
Router(config)# router bgp 100
Router(config-router)# no auto-summary
To manually create a summary address for the following group of networks:
172.16.0.0/24 172.16.2.0/24
172.16.1.0/24 172.16.3.0/24
(Reference: http://www.cisco.com/warp/public/459/bgp-rec-routing.html)
BGP Next-Hop-
Self
A serious problem arises when RouterB sends this route to its iBGP
peers
(RouterA and RouterD). The Next Hop value is not changed:
RouterA# show ip bgp
Network Next Hop Metric LocPrf Weight Path
* 192.168.1.0 172.16.1.2 0 100 0 900 i
Notice the lack of >, indicating this is no longer the best route to the destination. This is because RouterA has
no route to the next hop address.
There are two workarounds. Either the 172.16.0.0/16 network must be added to RouterA’s and RouterD’s routing tables,
or the Next-Hop field must be adjusted to identify RouterB as the next hop.
The configuration is simple, and is completed on RouterB:
RouterB(config)# router bgp 200
RouterB(config-router)# neighbor 10.1.1.1 next-hop-self
RouterB(config-router)# neighbor 10.2.1.2 next-hop-self
RouterB now advertises itself as the next hop for all eBGP routes it learns:
RouterA# show ip bgp
To immediately reset an eBGP session if a link connecting two peers goes down, the bgp
fast-external-fallover feature must be enabled. To enable this feature globally:
Router(config)# router bgp 200
Router(config-router)# bgp fast-external-fallover
To force a resend of routing updates, without resetting any BGP sessions between
neighbors:
Router# clear ip bgp * soft
To view a summary of all BGP connections, including the total number of BGP routes
and a concise list of neighbors:
Router# show ip bgp summary
3.4.a Describe Network Time Protocol (NTP)
Network Time Protocol (NTP)
Time and date information can be configured locally on both Cisco routers and switches.
However, in environments with a large amount of equipment, this can become
unmanageable. As a result, the “time” will be inconsistent throughout the network. This can
lead to various inaccuracies, such as the timestamps in syslog messages.
Network Time Protocol (NTP) provides a mechanism to synchronize time throughout the
network. An NTP device will form an association with NTP devices closer to the time
source. NTP devices use a special measurement, called a stratum, to determine how far
they are away from the time source.
For example, a device with a stratum of 1 is directly connected to the time source. A
device
with a stratum of 2 is one device (or “hop”) away from the time source.
NTP Client/Server – The
can be configured oneNTP client
of two ways:is configured to always get its time information
from the NTP server. The server will never get its time from the client.
Peer-to-peer – Peered NTP devices can get their time from each other,
depending on who is closest to the time source (i.e., lowest stratum).
NTP associations can be secured using encrypted authentication.
Configuring Basic
NTP
Consider the above example. Two time sources exist off of RouterD; to use those
time sources as NTP servers:
RouterD(config)# clock timezone CST -6
RouterD(config)# clock summer-time CDT recurring
RouterD(config)# ntp server 10.1.1.1
RouterD(config)# ntp server 10.5.1.1
Router D’s time will now be synchronized with the external time
sources. Specifying more than one NTP server provides redundancy.
To prefer one time source over another:
RouterD(config)# ntp server 10.1.1.1 prefer
RouterD(config)# ntp server 10.5.1.1
NTP can be configured as a tiered client/server model. For example, instead of
pointing RouterC to the external time sources, RouterC can utilize RouterD as its
NTP Server instead:
RouterC(config)# clock timezone CST -6
RouterC(config)# clock summer-time CDT recurring
RouterC(config)# ntp server 50.1.1.1
RouterA and RouterB can be pointed to RouterC as well:
RouterA(config)# clock timezone CST -6
RouterA(config)# clock summer-time CDT recurring
RouterA(config)# ntp server 69.1.1.1
Configuring Basic NTP (continued)
Now consider the above example. No external time sources exist; instead, RouterD can be
designated as the authoritative time source of this network. This is not an optimal solution,
and should only be used when there is no access to external (Internet) time sources.
First, accurate date and time information must be configured on
RouterD:RouterD(config)# clock timezone CST -
RouterD(config)#
6 clock summer-time CDT recurring
To ensure that erroneous time information is not propagated throughout the network, NTP
authentication can be configured.
Assume that RouterD is still configured as the NTP master. To configure authentication on
RouterD:
RouterD(config)# ntp master 10
RouterD(config)# ntp authentication-key 1 md5 MYPASSWORD
RouterD is the NTP server for RouterC. To secure this association, the following must
be configured on RouterC:
RouterC(config)# ntp authenticate
RouterC(config)# ntp authentication-key 1 md5 MYPASSWORD
RouterC(config)# ntp trusted-key 1
RouterC(config)# ntp server 50.1.1.1 key 1
Usually in client/server environments, the server authenticates the
client. However, NTP clients authenticate the NTP server.
The authentication-key must be the same on both NTP devices.
Misc. NTP Commands
You may have noticed that, in client/server NTP environments, no configuration is
necessary on the NTP server to “service” clients. Thus, any device can point to a Cisco
router as its NTP server.
If this is undesirable, NTP can be disabled on a specific interface:
Router(config)# interface fa0/1
Router(config-if)# ntp disable
To restrict the number of client “associations” to an NTP server:
Router(config)# ntp max-associations 10
To provide stability to the NTP network, the source interface of NTP packets can be
specified. It is usually preferable to use a loopback interface as a source, as loopbacks
should never be in a down state:
Router(config)# ntp source loopback0
Verifying NTP
To view the current date and time:
Router# show clock
04:30:03.871 CDT Mon Jun 27
2020
Consider the above example. For a connection from HostA to HostB, the NAT addresses
are identified as follows:
Inside Local Address - 10.1.1.10
Inside Global Address - 55.1.1.1
Outside Global Address – 99.1.1.2
Outside Local Address – 99.1.1.2
HostA’s configured address is 10.1.1.10, and is identified as its Inside Local address. When
HostA communicates with the Internet, it is stamped with RouterA’s public address, using
PAT. Thus, HostA’s Inside Global address will become 55.1.1.1.
When HostA communicates with HostB, it will access HostB’s Outside Global address of
99.1.1.2. In this instance, the Outside Local address is also
99.1.1.2. HostA is never aware of HostB’s configured address.
It is possible to map an address from the local network (such as 10.1.1.5) to the global
address of the remote device (in this case, 99.1.1.2). This may be required if a legacy device
exists that will only communicate with the local subnet. In this instance, the Outside Local
address would be 10.1.1.5.
The above example demonstrates how the source (SRC) and destination
(DST) IP addresses within the Network-Layer header are translated by NAT.
(Reference: http://www.cisco.com/warp/public/556/8.html)
Router(config)# int e0/0 Router(config)# int s0/0
Router(config-if)# ip nat inside Router(config-if)# ip nat outside
To reach other networks, HostA must utilize a single gateway – SwitchA. The gateway
represents a single point of failure on this network. If the gateway fails, hosts will lose
access to all resources beyond the gateway.
Using multiple routers or multilayer switches can provide Layer-3 redundancy
for hosts:
However, the Layer-3 redundancy must be transparent to each host. Hosts should not be
configured with multiple default gateways.
Cisco supports three protocols to provide transparent Layer-3 redundancy:
Hot Standby Router Protocol (HSRP)
Virtual Router Redundancy Protocol (VRRP)
Gateway Load Balancing Protocol (GLBP)
Hot Standby Router Protocol (HSRP)
Cisco developed the proprietary Hot Standby Router Protocol (HSRP) to allow multiple
routers or multilayer switches to masquerade as a single gateway. This is accomplished by
assigning a virtual IP and MAC address to all routers participating in an HSRP group.
Routers within the same HSRP group must be assigned the same group number, which
can range from 0 to 255. However, most Cisco platforms only support 16 configured
HSRP groups.
HSRP routers are elected to specific roles:
Active Router – router currently serving as the gateway.
Standby Router – backup router to the Active Router.
Listening Router – all other routers participating in HSRP.
Only one active and one standby router are allowed per HSRP group. Thus, HSRP
provides Layer-3 redundancy, but no inherent load balancing.
Hello packets are used to elect HSRP roles and to ensure all routers are functional. If the
current active router fails, the standby router will immediately take over as active, and a
new standby is elected. By default, hello packets are sent every 3 seconds.
The role of an HSRP router is dictated by its priority. The priority can range from 0 – 255,
with a default of 100. A higher priority is preferred.
Thus, the router with the highest priority is elected the active router – SwitchB in the
above example. The router with the second highest priority becomes the standby router –
SwitchA in the example. If all priorities are equal, whichever router has the highest IP
Address on its HSRP interface is elected the active router.
HSRP States
A router interface participating in HSRP must progress through several
states before settling into a
role:
Disabled Speak
Initial Standby
Learn Active
Listen
A disabled state indicates that the interface is either not configured for HSRP, or is
administratively shutdown.
An interface begins in an initial state when first configured with HSRP, or taken out of
an administratively shutdown state.
An interface enters a learn state if it does not know the HSRP virtual IP address. Normally
the virtual IP is manually configured on the interface – otherwise, it will be learned from
the current Active router via hello packets.
An interface in a listen state knows the virtual IP address, but was not elected as
either the Active or Standby Router.
Interfaces in a speak state are currently participating in the election of an active or standby
router. Elections are performed using hello packets, which are sent out every 3 seconds by
default.
A standby state indicates that the interface is acting as a backup to the active router. The
standby router continuously exchanges hello packets with the active router, and will
take over if the active router fails.
An interface in an active state is the live gateway, and will forward traffic sent to the
virtual IP address. Hosts will use the virtual IP address as their default gateway. The
active router will respond to ARP requests for the virtual IP with the virtual MAC address.
Note that hello packets are only exchanged in three HSRP states:
Speak
Standby
Active
Interfaces in a listen state will only listen for hello packets. If an active or standby router
fails, a listen interface will transition to a speak state to participate in a new election.
HSRP Basic Configuration
HSRP is configured on the interface that is accepting traffic from hosts.
Recall that the interface with the highest priority is elected the active router. To configure
the priority of a router from its default of 100:
Router(config)# interface gi0/3
Router(config-if)# standby 1 priority 150
The standby 1 command specifies the HSRP group the interface belongs to. HSRP can also
be configured on a VLAN interface on a multilayer switch:
SwitchB(config)# interface vlan 100
SwitchB(config-if)# standby 1 priority 150
Each interface in the HSRP group retains its local IP address. The HSRP group itself is
assigned a virtual IP address, which hosts will use as their default gateway:
To configure the virtual HSRP IP
address: SwitchA(config)# interface vlan 100
SwitchA(config-if)# ip address 10.1.1.2 255.255.255.0
SwitchA(config-if)# standby 1 ip 10.1.1.1
SwitchB(config)# interface vlan 100
SwitchB(config-if)# ip address 10.1.1.3 255.255.255.0
SwitchB(config-if)# standby 1 ip 10.1.1.1
Remember: while each multilayer switch is configured with its own local IP
address, both are configured with the same virtual IP address. HostA will use this
virtual IP address as its default gateway.
HSRP Basic Configuration (continued)
HSRP supports using multiple virtual IP addresses:
SwitchB(config-if)# standby 1 ip 10.1.1.1
SwitchB(config-if)# standby 1 ip 10.1.1.5 secondary
The active router will respond to ARP requests for the virtual IP with
the
virtual MAC address.
The virtual MAC is a reserved address in the following format:
0000.0c07.acxx
…with xx representing the HSRP group number in hexadecimal. For example, if the HSRP
group number is 8, the resulting virtual MAC address would be 0000.0c07.ac08.
The HSRP virtual MAC address can be manually changed:
Switch(config-if)# standby 1 mac-address 0000.00ab.12ef
HSRP authentication prevents an unauthorized router from joining the HSRP group. All
routers in the HSRP group must be configured with an identical authentication string.
To specify a clear-text authentication string:
Switch(config-if)# standby 1 authentication STAYOUT
To specify an MD5-hashed authentication string:
Switch(config-if)# standby 1 authentication md5 key-string 7 STAYOUT
HSRP Preempt
If a new router is added to an HSRP group, it will not preemptively assume the role of the
active router, even if it has the best priority.
In fact, the router that is first powered on will become the active router, even if it has the
lowest priority!
Consider the above
1. If SwitchB was powered on first, it would become the active router.
example:
2. SwitchA would be elected the standby router.
3. If SwitchB fails, SwitchA would take over as the active router.
4. Once SwitchB recovers, it will not retake its role of active router,
despite having a higher priority.
The preempt parameter will allow a router to forcibly assume the role of active router, if it
has the highest priority. The preempt feature is disabled by default:
SwitchB(config-if)# standby 1 preempt
The optional delay parameter will force a router to wait before preempting as the active
router. The delay is measured in seconds:
HSRP Timers
Hello packets are used to elect the active and standby router, and to detect if there is a
failure. By default, hello packets are exchanged every 3 seconds.
HSRP Hello packets are sent to the multicast address 224.0.0.2 over UDP port 1985. If no
elections are occurring, only the active and standby routers exchange hello packets.
If no hello packets are received from the active router within the holddown timer
duration, the standby router will assume it failed and take over as active. By default, the
holddown timer is three times the hello timer, or 10 seconds. Cisco’s math, not mine.
To manually adjust the HSRP timers, measured in seconds:
SwitchB(config-if)# standby 1 timers 4 12
The first timer value represents the hello timer, while the second represents the
holddown
timer. The timers can also be specified in milliseconds:
SwitchB(config-if)# standby 1 timers msec 800 msec 2400
HSRP Tracking
In the above example, SwitchB will become the active router, and SwitchA the standby.
Both SwitchA and SwitchB exchange periodic hello packets to update their status.
If interface gi2/23 goes down on SwitchB, hello packets can still be exchanged with
SwitchA via interface gi2/22. SwitchA is unaware that SwitchB has a failure and can no
longer forward traffic to other networks. SwitchB will remain as the active router, and
traffic will be blackholed.
To mitigate a scenario like this, HSRP can track interfaces. If a tracked interface fails,
the router’s priority is decreased by a specified value – by default, this is 10.
Consider the following tracking configuration on SwitchB:
SwitchB(config-if)# standby 1 track gi2/23 60
If interface gi2/23 on SwitchB fails, the priority of the switch will decrease by 60. The
objective is to decrement the priority enough to allow the standby router to take over as
active.
This requires conscientious planning - if SwitchB’s priority decremented by only 40, it
would remain as active, as its priority would still be higher than SwitchA.
For tracking to be successful, the standby router must be configured to
preempt:
SwitchA(config-if)# standby 1 preempt
Otherwise, the standby router will never take over as active.
Virtual Router Redundancy Protocol (VRRP)
Virtual Router Redundancy Protocol (VRRP)
The Virtual Router Redundancy Protocol (VRRP) is an industry-standard Layer-3
redundancy protocol, originally defined in RFC 2338. VRRP is nearly identical to HSRP,
with some notable exceptions:
The router with the highest priority becomes the master router.
All other routers become backup routers.
The virtual MAC address is the reserved 0000.5e00.01xx, with xx
representing the hexadecimal group number.
Hello packets are sent every 1 second, by default, and sent to multicast
address 224.0.0.18.
VRRP will preempt by default.
VRRP cannot directly track interfaces – it can track an object which is tied to an
interface, though.
Configuration of VRRP is also very similar to HSRP:
SwitchB(config)# interface vlan 100
SwitchB(config-if)# ip address 10.1.1.3 255.255.255.0
SwitchB(config-if)# vrrp 1 priority 150
SwitchB(config-if)# vrrp 1 authentication STAYOUT
SwitchB(config-if)# vrrp 1 ip 10.1.1.1
As with HSRP, the default VRRP priority is 100, and a higher priority is preferred.
Unlike HSRP, preemption is enabled by default.
To manually disable preempt:
Switch(config-if)# no vrrp 1 preempt
Advertisement interval is
3.000 sec Preemption is enabled
min delay is 0.000 sec Priority 150
Master Router is 10.1.1.3 (local),
priority is 150
Master Advertisement interval is 3.000 sec Master Down interval is
9.711 sec
HSRP and VRRP Pseudo Load Balancing
While HSRP and VRRP do provide redundant gateways for fault tolerance, neither
provide load balancing between those gateways.
Cisco will claim that load balancing is possible. Two separate HSRP or VRRP
groups
canSwitchA(config)#
be configured on a single interface: SwitchB(config)# interface vlan 100
interface vlan 100
SwitchA(config-if)# ip address 10.1.1.2 255.255.255.0 SwitchB(config-if)# ip address 10.1.1.3 255.255.255.0
In the above configuration, each HSRP group has been assigned a unique virtual IP address – 10.1.1.1 and
10.1.1.254 respectively. By manipulating the priority, each multilayer switch will become the active router for one
HSRP group, and the standby router for the other group.
SwitchA# show standby brief
Interface Grp Prio P State Active addr Standby addr Group addr
Vlan100 1 150 P Active local 10.1.1.3 10.1.1.1
Vlan100 2 50 P Standby 10.1.1.3 local 10.1.1.254
224.0.1.0 – 238.255.255.255 – Reserved for “public” use, can be used publicly on the
Internet. Many addresses in this range have been reserved for specific applications
239.0.0.0 – 239.255.255.255 – Reserved for “private” use, and cannot be routed on the
Internet.
The following outlines several of the most common multicast addresses reserved for
routing protocols:
224.0.0.1 – all hosts on this subnet
224.0.0.2 – all routers on this subnet
224.0.0.5 – all OSPF routers
224.0.0.6 – all OSPF Designated routers
224.0.0.9 – all RIPv2 routers
224.0.0.10 – all IGRP routers
224.0.0.12 – DHCP traffic
224.0.0.13 – all PIM routers
224.0.0.19-21 – ISIS routers
224.0.0.22 – IGMP traffic
224.0.1.39 – Cisco RP Announce
224.0.1.40 – Cisco RP Discovery
Multicast MAC Addresses
Unfortunately, there is no ARP equivalent protocol for multicast addressing. Instead, a
reserved range of MAC addresses were created for multicast IPs. All multicast MAC
addresses begin with:
0100.5e
Recall that the first six digits of a MAC address identify the vendor code, and the last 6
digits identify the specific host address. To complete the MAC address, the last 23 bits of
the multicast IP address are used.
For example, consider the following multicast IP address and its binary equivalent:
224.65.130.195 = 11100000.01000001.10000010.11000011
Remember that a MAC address is 48 bits long, and that a multicast MAC must begin
with 0100.5e. In binary, that looks like:
00000001.00000000.01011110.0
Add the last 23 bits of the multicast IP address to the MAC, and we
get:
00000001.00000000.01011110.01000001.10000010.11000011
That should be exactly 48 bits long. Converting that to Hex format, our full MAC address
would be:
0100.5e41.82c3
How did I convert this to Hex? Remember that hexadecimal is Base 16 mathematics.
Thus, to represent a single hexadecimal digit in binary, we would need 4 bits (24 = 16). So,
we can break down the above binary MAC address into groups of four bits:
Binary 0000 0001 0000 0000 0101 1110 0100 0001 1000 0010 1100 0011
Decimal 0 1 0 0 5 14 4 1 8 2 12 3
Hex 0 1 0 0 5 e 4 1 8 2 c 3
Sparse Mode should be used when only a limited number of multicast hosts exist.
Because hosts must explicitly join before that network segment is added to the
multicast tree, bandwidth is utilized more efficiently.
PIM Dense Mode Example
Multicast
Source
Router 1
Router 6 Router 7
Router 5
Consider the above example. When PIM routers operate in Dense Mode,
all segments of the multicast tree are flooded initially. Eventually,
“branches” that do not require the multicast traffic are pruned off:
Multicast
Source
Router 1
Router 6 Router 7
Router 5
When PIM routers operate in Sparse Mode, multicast traffic is not initially flooded
throughout the entire multicast tree. Instead, a Rendezvous Point (RP) is elected or
designated, and all multicast sources and clients must explicitly register with the RP. This
provides a centralized method of directing the multicast traffic of multiple multicast sources:
Configuring Manual PIM
Two versions of PIM exist (PIMv1 and PIMv2), though both are very similar. PIM must be
enabled on each participating interface in the multicast tree.
To enable PIM and specify its mode on an interface:
Switch(config)# interface fa0/10
Switch(config-if)# no switchport
Switch(config-if)# ip pim dense-mode
Switch(config-if)# ip pim sparse-mode
Switch(config-if)# ip pim sparse-dense-mode
When utilizing PIM-SM, we must configure a Rendezvous Point (RP). RP’s can be
identified manually, or dynamically chosen using a process called auto-RP (Cisco-
proprietary).
To manually specify an RP on a router:
Switch(config)# ip pim rp-address 192.168.1.1
The above command must be configured on every router in the multicast tree, including
the RP itself.
To restrict the RP to a specific set of multicast groups:
Switch(config)# access-list 10 permit 226.10.10.1
Switch(config)# access-list 10 permit 226.10.10.2
Switch(config)# ip pim rp-address 192.168.1.1 10
The first two commands create an access-list 10 specifying the multicast groups this RP
will support. The third command identifies the RP, and applies access-list 10 to the RP.
Troubleshooting Multicasting
To view IGMP groups and current members:
Switch# show ip igmp groups
If using PIM in Sparse Mode, the output would be similar to the following:
Notice that the (S,G) pairing is labeled as (*, 224.59.222.10). In Sparse Mode, we can
have multiple sources share the same multicast tree.
The Rendezvous Point (RP) is 10.1.1.10. The flags are set to SC, indicating this router is
running in Sparse Mode.
Just like with Dense Mode, the Incoming interface indicates the upstream
interface, and the outgoing interface(s) indicate downstream interfaces.
However, the RPF neighbor is the next hop router “upstream” towards the
RP now, and not the source.