The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
Your software release
may not support all the features documented in this module. For the latest
caveats and feature information, see Bug Search Tool and the release notes for
your platform and software release. To find information about the features
documented in this module, and to see a list of the releases in which each
feature is supported, see the feature information table at the end of this
module.
Use Cisco Feature
Navigator to find information about platform support and Cisco software image
support. To access Cisco Feature Navigator, go to
http://www.cisco.com/go/cfn.
An account on Cisco.com is not required.
Information About Configuring IP Unicast Routing
This module describes how to configure IP Version 4 (IPv4) unicast routing on the switch.
Note
On switches running the LAN base feature, static routing on VLANs is supported only with this release.
A switch stack operates and appears as a single router to the rest of the routers in the network. Basic routing functions, including static routing and the Routing Information Protocol (RIP), are available with both the
IP base feature set and the IP services feature set. To use advanced routing features and other routing protocols, you must have the IP services feature set enabled on the standalone
switch or on the active switch.
Note
In addition to IPv4 traffic, you can also enable IP Version 6 (IPv6) unicast routing and configure interfaces to forward IPv6
traffic if the switch or switch stack is running the IP base or IP services feature set.
Information About IP Routing
In some network environments, VLANs are associated with individual networks or subnetworks. In an IP network, each subnetwork
is mapped to an individual VLAN. Configuring VLANs helps control the size of the broadcast domain and keeps local traffic
local. However, network devices in different VLANs cannot communicate with one another without a Layer 3 device (router) to
route traffic between the VLAN, referred to as inter-VLAN routing. You configure one or more routers to route traffic to the
appropriate destination VLAN.
When Host A in VLAN 10 needs to communicate with Host B in VLAN 10, it sends a packet addressed to that host. Switch A forwards
the packet directly to Host B, without sending it to the router.
When Host A sends a packet to Host C in VLAN 20, Switch A forwards the packet to the router, which receives the traffic on
the VLAN 10 interface. The router checks the routing table, finds the correct outgoing interface, and forwards the packet
on the VLAN 20 interface to Switch B. Switch B receives the packet and forwards it to Host C.
Types of Routing
Routers and Layer 3 switches can route packets in these ways:
By using default routing
By using preprogrammed static routes for the traffic
By dynamically calculating routes by using a routing protocol
Default routing refers to sending traffic with a destination unknown to the router to a default outlet or destination.
Static unicast routing forwards packets from predetermined ports through a single path into and out of a network. Static routing
is secure and uses little bandwidth, but does not automatically respond to changes in the network, such as link failures,
and therefore, might result in unreachable destinations. As networks grow, static routing becomes a labor-intensive liability.
Switches running the LAN base feature set support 16 user-configured static routes, in addition to any default routes used
for the management interface. The LAN base image supports static routing only on SVIs.
Dynamic routing protocols are used by routers to dynamically calculate the best route for forwarding traffic. There are two
types of dynamic routing protocols:
Routers using distance-vector protocols maintain routing tables with distance values of networked resources, and periodically
pass these tables to their neighbors. Distance-vector protocols use one or a series of metrics for calculating the best routes.
These protocols are easy to configure and use.
Routers using link-state protocols maintain a complex database of network topology, based on the exchange of link-state advertisements
(LSAs) between routers. LSAs are triggered by an event in the network, which speeds up the convergence time or time required
to respond to these changes. Link-state protocols respond quickly to topology changes, but require greater bandwidth and more
resources than distance-vector protocols.
Distance-vector protocols supported by the switch are Routing Information Protocol (RIP), which uses a single distance metric
(cost) to determine the best path and Border Gateway Protocol (BGP), which adds a path vector mechanism. The switch also supports
the Open Shortest Path First (OSPF) link-state protocol and Enhanced IGRP (EIGRP), which adds some link-state routing features
to traditional Interior Gateway Routing Protocol (IGRP) to improve efficiency.
Note
On a switch or switch stack, the supported protocols are determined by the software running on the active switch. If the active switch is running the IP base feature set, only default routing, static routing and RIP are supported. If the active switch is running the IP base feature set, only default routing, static routing and RIP are supported. If the switch is running the LAN base feature set, you can configure 16 static routes on SVIs. All other routing protocols
require the IP services feature set.
IP Routing and Switch Stacks
A switch stack appears to the network as a single switch, regardless of which switch in the stack is connected to a routing
peer.
The active switch performs these functions:
It initializes and configures the routing protocols.
It sends routing protocol messages and updates to other routers.
It processes routing protocol messages and updates received from peer routers.
It generates, maintains, and distributes the distributed Cisco Express Forwarding (dCEF) database to all stack members. The
routes are programmed on all switches in the stack bases on this database.
The MAC address of the active switch is used as the router MAC address for the whole stack, and all outside devices use this
address to send IP packets to the stack.
All IP packets that require software forwarding or processing go through the CPU of the active switch.
Stack members perform these functions:
They act as routing standby switches, ready to take over in case they are elected as the new active switch if the active switch
fails.
They program the routes into hardware.
If a active switch fails, the stack detects that the active switch is down and elects one of the stack members to be the new
active switch. During this period, except for a momentary interruption, the hardware continues to forward packets with no
active protocols.
However, even though the switch stack maintains the hardware identification after a failure, the routing protocols on the
router neighbors might flap during the brief interruption before the active switch restarts. Routing protocols such as OSPF
and EIGRP need to recognize neighbor transitions. The router uses two levels of nonstop forwarding (NSF) to detect a switchover,
to continue forwarding network traffic, and to recover route information from peer devices:
NSF-aware routers tolerate neighboring router failures. After the neighbor router restarts, an NSF-aware router supplies information
about its state and route adjacencies on request.
NSF-capable routers support NSF. When they detect a active switch change, they rebuild routing information from NSF-aware
or NSF-capable neighbors and do not wait for a restart.
The switch stack supports NSF-capable routing for OSPF and EIGRP.
Upon election, the new active switch performs these functions:
It starts generating, receiving, and processing routing updates.
It builds routing tables, generates the CEF database, and distributes it to stack members.
It uses its MAC address as the router MAC address. To notify its network peers of the new MAC address, it periodically (every
few seconds for 5 minutes) sends a gratuitous ARP reply with the new router MAC address.
Note
If you configure the persistent MAC address feature on the stack and the active switch changes, the stack MAC address does
not change for the configured time period. If the previous active switch rejoins the stack as a member switch during that
time period, the stack MAC address remains the MAC address of the previous active switch.
It attempts to determine the reachability of every proxy ARP entry by sending an ARP request to the proxy ARP IP address and
receiving an ARP reply. For each reachable proxy ARP IP address, it generates a gratuitous ARP reply with the new router MAC
address. This process is repeated for 5 minutes after a new active switch election.
Note
When a active switch is running the IP services feature set, the stack can run all supported protocols, including Open Shortest
Path First (OSPF), Enhanced IGRP (EIGRP), and Border Gateway Protocol (BGP). If the active switch fails and the new elected
active switch is running the IP base or LAN base feature set, these protocols will no longer run in the stack.
Caution
Partitioning of the switch stack into two or more stacks might lead to undesirable behavior in the network.
If the switch is reloaded, then all the ports
on that switch go down and there is a loss of traffic
for the interfaces involved in routing, despite
NSF/SSO capability
Classless Routing
By default, classless routing behavior is enabled on the switch when it is configured to route. With classless routing, if
a router receives packets for a subnet of a network with no default route, the router forwards the packet to the best supernet
route. A supernet consists of contiguous blocks of Class C address spaces used to simulate a single, larger address space
and is designed to relieve the pressure on the rapidly depleting Class B address space.
In Figure 41-2, classless routing is enabled. When the host sends a packet to 120.20.4.1, instead of discarding the packet,
the router forwards it to the best supernet route. If you disable classless routing and a router receives packets destined
for a subnet of a network with no network default route, the router discards the packet.
In Figure 41-3, the router in network 128.20.0.0 is connected to subnets 128.20.1.0, 128.20.2.0, and 128.20.3.0. If the host
sends a packet to 120.20.4.1, because there is no network default route, the router discards the packet.
Address Resolution
You can control interface-specific handling of IP by using address resolution. A device using IP can have both a local address
or MAC address, which uniquely defines the device on its local segment or LAN, and a network address, which identifies the
network to which the device belongs.
Note
In a switch stack, network communication uses a single MAC address and the IP address of the stack.
The local address or MAC address is known as a data link address because it is contained in the data link layer (Layer 2)
section of the packet header and is read by data link (Layer 2) devices. To communicate with a device on Ethernet, the software
must learn the MAC address of the device. The process of learning the MAC address from an IP address is called address resolution.
The process of learning the IP address from the MAC address is called reverse address resolution.
The switch can use these forms of address resolution:
Address Resolution Protocol (ARP) is used to associate IP address with MAC addresses. Taking an IP address as input, ARP learns
the associated MAC address and then stores the IP address/MAC address association in an ARP cache for rapid retrieval. Then
the IP datagram is encapsulated in a link-layer frame and sent over the network. Encapsulation of IP datagrams and ARP requests
or replies on IEEE 802 networks other than Ethernet is specified by the Subnetwork Access Protocol (SNAP).
Proxy ARP helps hosts with no routing tables learn the MAC addresses of hosts on other networks or subnets. If the switch
(router) receives an ARP request for a host that is not on the same interface as the ARP request sender, and if the router
has all of its routes to the host through other interfaces, it generates a proxy ARP packet giving its own local data link
address. The host that sent the ARP request then sends its packets to the router, which forwards them to the intended host.
The switch also uses the Reverse Address Resolution Protocol (RARP), which functions the same as ARP does, except that the
RARP packets request an IP address instead of a local MAC address. Using RARP requires a RARP server on the same network segment
as the router interface. Use the ip rarp-serveraddress interface configuration command to identify the server.
For more information on RARP, see the Cisco IOS Configuration Fundamentals Configuration Guide, Release 12.4.
Proxy ARP
Proxy ARP, the most common method for learning about other routes, enables an Ethernet host with no routing information to
communicate with hosts on other networks or subnets. The host assumes that all hosts are on the same local Ethernet and that
they can use ARP to learn their MAC addresses. If a switch receives an ARP request for a host that is not on the same network
as the sender, the switch evaluates whether it has the best route to that host. If it does, it sends an ARP reply packet with
its own Ethernet MAC address, and the host that sent the request sends the packet to the switch, which forwards it to the
intended host. Proxy ARP treats all networks as if they are local and performs ARP requests for every IP address.
ICMP Router Discovery Protocol
Router discovery allows the switch to dynamically learn about routes to other networks using ICMP router discovery protocol
(IRDP). IRDP allows hosts to locate routers. When operating as a client, the switch generates router discovery packets. When
operating as a host, the switch receives router discovery packets. The switch can also listen to Routing Information Protocol
(RIP) routing updates and use this information to infer locations of routers. The switch does not actually store the routing
tables sent by routing devices; it merely keeps track of which systems are sending the data. The advantage of using IRDP is
that it allows each router to specify both a priority and the time after which a device is assumed to be down if no further
packets are received.
Each device discovered becomes a candidate for the default router, and a new highest-priority router is selected when a higher
priority router is discovered, when the current default router is declared down, or when a TCP connection is about to time
out because of excessive retransmissions.
UDP Broadcast Packets and Protocols
User Datagram Protocol (UDP) is an IP host-to-host layer protocol, as is TCP. UDP provides a low-overhead, connectionless
session between two end systems and does not provide for acknowledgment of received datagrams. Network hosts occasionally
use UDP broadcasts to find address, configuration, and name information. If such a host is on a network segment that does
not include a server, UDP broadcasts are normally not forwarded. You can remedy this situation by configuring an interface
on a router to forward certain classes of broadcasts to a helper address. You can use more than one helper address per interface.
You can specify a UDP destination port to control which UDP services are forwarded. You can specify multiple UDP protocols.
You can also specify the Network Disk (ND) protocol, which is used by older diskless Sun workstations and the network security
protocol SDNS.
By default, both UDP and ND forwarding are enabled if a helper address has been defined for an interface. The description
for the ip forward-protocol interface configuration command in the Cisco IOS IP Command Reference, Volume 1 of 3: Addressing and Services, Release 12.4 lists the ports that are forwarded by default if you do not specify any UDP ports.
Broadcast Packet Handling
After configuring an IP interface address, you can enable routing and configure one or more routing protocols, or you can
configure the way the switch responds to network broadcasts. A broadcast is a data packet destined for all hosts on a physical
network. The switch supports two kinds of broadcasting:
A directed broadcast packet is sent to a specific network or series of networks. A directed broadcast address includes the
network or subnet fields.
A flooded broadcast packet is sent to every network.
Note
You can also limit broadcast, unicast, and multicast traffic on Layer 2 interfaces by using the storm-control interface configuration command to set traffic suppression levels.
Routers provide some protection from broadcast storms by limiting their extent to the local cable. Bridges (including intelligent
bridges), because they are Layer 2 devices, forward broadcasts to all network segments, thus propagating broadcast storms.
The best solution to the broadcast storm problem is to use a single broadcast address scheme on a network. In most modern
IP implementations, you can set the address to be used as the broadcast address. Many implementations, including the one in
the switch, support several addressing schemes for forwarding broadcast messages.
IP Broadcast Flooding
You can allow IP broadcasts to be flooded throughout your internetwork in a controlled fashion by using the database created
by the bridging STP. Using this feature also prevents loops. To support this capability, bridging must be configured on each
interface that is to participate in the flooding. If bridging is not configured on an interface, it still can receive broadcasts.
However, the interface never forwards broadcasts it receives, and the router never uses that interface to send broadcasts
received on a different interface.
Packets that are forwarded to a single network address using the IP helper-address mechanism can be flooded. Only one copy
of the packet is sent on each network segment.
To be considered for flooding, packets must meet these criteria. (Note that these are the same conditions used to consider
packet forwarding using IP helper addresses.)
The packet must be a MAC-level broadcast.
The packet must be an IP-level broadcast.
The packet must be a TFTP, DNS, Time, NetBIOS, ND, or BOOTP packet, or a UDP specified by the ip forward-protocol udp global configuration command.
The time-to-live (TTL) value of the packet must be at least two.
A flooded UDP datagram is given the destination address specified with the ip broadcast-address interface configuration command on the output interface. The destination address can be set to any address. Thus, the destination
address might change as the datagram propagates through the network. The source address is never changed. The TTL value is
decremented.
When a flooded UDP datagram is sent out an interface (and the destination address possibly changed), the datagram is handed
to the normal IP output routines and is, therefore, subject to access lists, if they are present on the output interface.
In the switch, the majority of packets are forwarded in hardware; most packets do not go through the switch CPU. For those
packets that do go to the CPU, you can speed up spanning tree-based UDP flooding by a factor of about four to five times by
using turbo-flooding. This feature is supported over Ethernet interfaces configured for ARP encapsulation.
How to Configure IP Routing
By default, IP routing is disabled on the switch, and you must enable it before routing can take place. For detailed IP routing
configuration information, see the Cisco IOS IP Configuration Guide, Release 12.4
In the following procedures, the specified interface must be one of these Layer 3 interfaces:
A routed port: a physical port configured as a Layer 3 port by using the no switchport interface configuration command.
A switch virtual interface (SVI): a VLAN interface created by using the interface vlanvlan_id global configuration command and by default a Layer 3 interface.
An EtherChannel port channel in Layer 3 mode: a port-channel logical interface created by using the interface port-channelport-channel-number global configuration command and binding the Ethernet interface into the channel group. For more information, see the “Configuring
Layer 3 EtherChannels” section on page 39-15.
Note
The switch does not support tunnel interfaces for unicast routed traffic.
All Layer 3 interfaces on which routing will occur must have IP addresses assigned to them. See the “Assigning IP Addresses
to Network Interfaces” section on page 41-7.
Note
A Layer 3 switch can have an IP address assigned to each routed port and SVI. The number of routed ports and SVIs that you
can configure is limited to 128, exceeding the recommended number and volume of features being implemented might impact CPU
utilization because of hardware limitations.
Configuring routing consists of several main procedures:
To support VLAN interfaces, create and configure VLANs on the switch or switch stack, and assign VLAN membership to Layer
2 interfaces. For more information, see Chapter 14, “Configuring VLANs.”
Configure Layer 3 interfaces.
Enable IP routing on the switch.
Assign IP addresses to the Layer 3 interfaces.
Enable selected routing protocols on the switch.
Configure routing protocol parameters (optional).
How to Configure IP Addressing
A required task for configuring IP routing is to assign IP addresses to Layer 3 network interfaces to enable the interfaces
and allow communication with the hosts on those interfaces that use IP. The following sections describe how to configure various
IP addressing features. Assigning IP addresses to the interface is required; the other procedures are optional.
Default IP Addressing Configuration
Table 1. Default Addressing Configuration
Feature
Default Setting
IP address
None defined.
ARP
No permanent entries in the Address Resolution Protocol (ARP) cache.
Encapsulation: Standard Ethernet-style ARP.
Timeout: 14400 seconds (4 hours).
IP broadcast address
255.255.255.255 (all ones).
IP classless routing
Enabled.
IP default gateway
Disabled.
IP directed broadcast
Disabled (all IP directed broadcasts are dropped).
IP domain
Domain list: No domain names defined.
Domain lookup: Enabled.
Domain name: Enabled.
IP forward-protocol
If a helper address is defined or User Datagram Protocol (UDP) flooding is configured, UDP forwarding is enabled on default
ports.
Any-local-broadcast: Disabled.
Spanning Tree Protocol (STP): Disabled.
Turbo-flood: Disabled.
IP helper address
Disabled.
IP host
Disabled.
IRDP
Disabled.
Defaults when enabled:
Broadcast IRDP advertisements.
Maximum interval between advertisements: 600 seconds.
Minimum interval between advertisements: 0.75 times max interval
Preference: 0.
IP proxy ARP
Enabled.
IP routing
Disabled.
IP subnet-zero
Disabled.
Assigning IP Addresses to Network Interfaces
An IP address identifies a location to which IP packets can be sent. Some IP addresses are reserved for special uses and cannot
be used for host, subnet, or network addresses. RFC 1166, “Internet Numbers,” contains the official description of IP addresses.
An interface can have one primary IP address. A mask identifies the bits that denote the network number in an IP address.
When you use the mask to subnet a network, the mask is referred to as a subnet mask. To receive an assigned network number,
contact your Internet service provider.
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
interfaceinterface-id
Example:
Device(config)# interface gigabitethernet 1/0/1
Enters interface configuration mode, and specifies the Layer 3 interface to configure.
Step 3
no switchport
Example:
Device(config-if)# no switchport
Removes the interface from Layer 2 configuration mode (if it is a physical interface).
Step 4
ip addressip-address subnet-mask
Example:
Device(config-if)# ip address 10.1.5.1 255.255.255.0
Configures the IP address and IP subnet mask.
Step 5
no shutdown
Example:
Device(config-if)# no shutdown
Enables the physical interface.
Step 6
end
Example:
Device(config-if)# end
Returns to privileged EXEC mode.
Step 7
show ip route
Example:
Device# show ip route
Verifies your entries.
Step 8
show ip interface [interface-id]
Example:
Device# show ip interface gigabitethernet 1/0/1
Verifies your entries.
Step 9
show running-config interface [interface-id]
Example:
Device# show running-config interface gigabitethernet 1/0/1
Verifies your entries.
Step 10
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entries in the configuration file.
Using Subnet Zero
Subnetting with a subnet address of zero is strongly discouraged because of the problems that can arise if a network and a
subnet have the same addresses. For example, if network 131.108.0.0 is subnetted as 255.255.255.0, subnet zero would be written
as 131.108.0.0, which is the same as the network address.
You can use the all ones subnet (131.108.255.0) and even though it is discouraged, you can enable the use of subnet zero if
you need the entire subnet space for your IP address.
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
ip subnet-zero
Example:
Device(config)# ip subnet-zero
Enables the use of subnet zero for interface addresses and routing updates.
Step 3
end
Example:
Device(config)# end
Returns to privileged EXEC mode.
Step 4
show running-config
Example:
Device# show running-config
Verifies your entry.
Step 5
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entry in the configuration file.
Enabling Classless Routing
To prevent the switch from forwarding packets destined for unrecognized subnets to the best supernet route possible, you can
disable classless routing behavior.
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
no ip classless
Example:
Device(config)#no ip classless
Disables classless routing behavior.
Step 3
end
Example:
Device(config)# end
Returns to privileged EXEC mode.
Step 4
show running-config
Example:
Device# show running-config
Verifies your entry.
Step 5
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entry in the configuration file.
Configuring Address Resolution Methods
You can perform the following tasks to configure address resolution.
Defining a Static ARP Cache
ARP and other address resolution protocols provide dynamic mapping between IP addresses and MAC addresses. Because most hosts
support dynamic address resolution, you usually do not need to specify static ARP cache entries. If you must define a static
ARP cache entry, you can do so globally, which installs a permanent entry in the ARP cache that the switch uses to translate
IP addresses into MAC addresses. Optionally, you can also specify that the switch respond to ARP requests as if it were the
owner of the specified IP address. If you do not want the ARP entry to be permanent, you can specify a timeout period for
the ARP entry.
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
arpip-address hardware-address type
Example:
Device(config)# ip 10.1.5.1 c2f3.220a.12f4 arpa
Associates an IP address with a MAC (hardware) address in the ARP cache, and specifies encapsulation type as one of these:
arpa—ARP encapsulation for Ethernet interfaces
snap—Subnetwork Address Protocol encapsulation for Token Ring and FDDI interfaces
sap—HP’s ARP type
Step 3
arpip-address hardware-address type [alias]
Example:
Device(config)# ip 10.1.5.3 d7f3.220d.12f5 arpa alias
(Optional) Specifies that the switch respond to ARP requests as if it were the owner of the specified IP address.
Step 4
interfaceinterface-id
Example:
Device(config)# interface gigabitethernet 1/0/1
Enters interface configuration mode, and specifies the interface to configure.
Step 5
arptimeout seconds
Example:
Device(config-if)# arp 20000
(Optional) Sets the length of time an ARP cache entry will stay in the cache. The default is 14400 seconds (4 hours). The
range is 0 to 2147483 seconds.
Step 6
end
Example:
Device(config-if)# end
Returns to privileged EXEC mode.
Step 7
show interfaces [interface-id]
Example:
Device# show interfaces gigabitethernet 1/0/1
Verifies the type of ARP and the timeout value used on all interfaces or a specific interface.
Step 8
show arp
Example:
Device# show arp
Views the contents of the ARP cache.
Step 9
show ip arp
Example:
Device# show ip arp
Views the contents of the ARP cache.
Step 10
copy running-config startup-config
Example:
Device# copy running-config start-config
(Optional) Saves your entries in the configuration file.
Setting ARP Encapsulation
By default, Ethernet ARP encapsulation (represented by the arpa keyword) is enabled on an IP interface. You can change the encapsulation methods to SNAP if required by your network.
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
interfaceinterface-id
Example:
Device(config)# interface gigabitethernet 1/0/2
Enters interface configuration mode, and specifies the Layer 3 interface to configure.
Step 3
arp {arpa | snap}
Example:
Device(config-if)# arp arpa
Specifies the ARP encapsulation method:
arpa—Address Resolution Protocol
snap—Subnetwork Address Protocol
Step 4
end
Example:
Device(config-if)# end
Returns to privileged EXEC mode.
Step 5
show interfaces [interface-id]
Example:
Device# show interfaces
Verifies ARP encapsulation configuration on all interfaces or the specified interface.
Step 6
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entries in the configuration file.
Enabling Proxy ARP
By default, the switch uses proxy ARP to help hosts learn MAC addresses of hosts on other networks or subnets.
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
interfaceinterface-id
Example:
Device(config)# interface gigabitethernet 1/0/2
Enters interface configuration mode, and specifies the Layer 3 interface to configure.
Step 3
ip proxy-arp
Example:
Device(config-if)# ip proxy-arp
Enables proxy ARP on the interface.
Step 4
end
Example:
Device(config-if)# end
Returns to privileged EXEC mode.
Step 5
show ip interface [interface-id]
Example:
Device# show ip interface gigabitethernet 1/0/2
Verifies the configuration on the interface or all interfaces.
Step 6
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entries in the configuration file.
Routing Assistance When IP Routing is Disabled
These mechanisms allow the switch to learn about routes to other networks when it does not have IP routing enabled:
Proxy ARP
Default Gateway
ICMP Router Discovery Protocol (IRDP)
Proxy ARP
Proxy ARP is enabled by default. To enable it after it has been disabled, see the “Enabling Proxy ARP” section. Proxy ARP
works as long as other routers support it.
Default Gateway
Another method for locating routes is to define a default router or default gateway. All non-local packets are sent to this
router, which either routes them appropriately or sends an IP Control Message Protocol (ICMP) redirect message back, defining
which local router the host should use. The switch caches the redirect messages and forwards each packet as efficiently as
possible. A limitation of this method is that there is no means of detecting when the default router has gone down or is unavailable.
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
ip default-gatewayip-address
Example:
Device(config)# ip default gateway 10.1.5.1
Sets up a default gateway (router).
Step 3
end
Example:
Device(config)# end
Returns to privileged EXEC mode.
Step 4
show ip redirects
Example:
Device# show ip redirects
Displays the address of the default gateway router to verify the setting.
Step 5
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entries in the configuration file.
ICMP Router Discovery Protocol (IRDP)
The only required task for IRDP routing on an interface is to enable IRDP processing on that interface. When enabled, the
default parameters apply.
You can optionally change any of these parameters. If you change the maxadvertinterval value, the holdtime and minadvertinterval values also change, so it is important to first change the maxadvertinterval value, before manually changing either the holdtime or minadvertinterval values.
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
interfaceinterface-id
Example:
Device(config)# interface gigabitethernet 1/0/1
Enters interface configuration mode, and specifies the Layer 3 interface to configure.
Step 3
ip irdp
Example:
Device(config-if)# ip irdp
Enables IRDP processing on the interface.
Step 4
ip irdp multicast
Example:
Device(config-if)# ip irdp multicast
(Optional) Sends IRDP advertisements to the multicast address (224.0.0.1) instead of IP broadcasts.
Note
This command allows for compatibility with Sun Microsystems Solaris, which requires IRDP packets to be sent out as multicasts.
Many implementations cannot receive these multicasts; ensure end-host ability before using this command.
Step 5
ip irdp holdtimeseconds
Example:
Device(config-if)# ip irdp holdtime 1000
(Optional) Sets the IRDP period for which advertisements are valid. The default is three times the maxadvertinterval value. It must be greater than maxadvertinterval and cannot be greater than 9000 seconds. If you change the maxadvertinterval value, this value also changes.
Step 6
ip irdp maxadvertintervalseconds
Example:
Device(config-if)# ip irdp maxadvertinterval 650
(Optional) Sets the IRDP maximum interval between advertisements. The default is 600 seconds.
Step 7
ip irdp minadvertintervalseconds
Example:
Device(config-if)# ip irdp minadvertinterval 500
(Optional) Sets the IRDP minimum interval between advertisements. The default is 0.75 times the maxadvertinterval. If you change the maxadvertinterval, this value changes to the new default (0.75 of maxadvertinterval).
Step 8
ip irdp preferencenumber
Example:
Device(config-if)# ip irdp preference 2
(Optional) Sets a device IRDP preference level. The allowed range is –231 to 231. The default is 0. A higher value increases
the router preference level.
Step 9
ip irdp addressaddress [number]
Example:
Device(config-if)# ip irdp address 10.1.10.10
(Optional) Specifies an IRDP address and preference to proxy-advertise.
Step 10
end
Example:
Device(config-if)# end
Returns to privileged EXEC mode.
Step 11
show ip irdp
Example:
Device# show ip irdp
Verifies settings by displaying IRDP values.
Step 12
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entries in the configuration file.
Configuring Broadcast Packet Handling
Perform the tasks in these sections to enable these schemes:
By default, IP directed broadcasts are dropped; they are not forwarded. Dropping IP-directed broadcasts makes routers less
susceptible to denial-of-service attacks.
You can enable forwarding of IP-directed broadcasts on an interface where the broadcast becomes a physical (MAC-layer) broadcast.
Only those protocols configured by using the ip forward-protocol global configuration command are forwarded.
You can specify an access list to control which broadcasts are forwarded. When an access list is specified, only those IP
packets permitted by the access list are eligible to be translated from directed broadcasts to physical broadcasts. For more
information on access lists, see Chapter 36, “Configuring Network Security with ACLs.”
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
interfaceinterface-id
Example:
Device(config)# interface gigabitethernet 1/0/2
Enters interface configuration mode, and specifies the interface to configure.
Step 3
ip directed-broadcast [access-list-number]
Example:
Device(config-if)# ip directed-broadcast 103
Enables directed broadcast-to-physical broadcast translation on the interface. You can include an access list to control which
broadcasts are forwarded. When an access list, only IP packets permitted by the access list can be translated.
Note
The ip directed-broadcast interface configuration command can be configured on a VPN routing/forwarding(VRF) interface and is VRF aware. Directed broadcast
traffic is routed only within the VRF.
Step 4
exit
Example:
Device(config-if)# exit
Returns to global configuration mode.
Step 5
ip forward-protocol {udp [port] | nd | sdns}
Example:
Device(config)# ip forward-protocol nd
Specifies which protocols and ports the router forwards when forwarding broadcast packets.
udp—Forward UPD datagrams.
port: (Optional) Destination port that controls which UDP services are forwarded.
nd—Forward ND datagrams.
sdns—Forward SDNS datagrams
Step 6
end
Example:
Device(config)# end
Returns to privileged EXEC mode.
Step 7
show ip interface [interface-id]
Example:
Device# show ip interface
Verifies the configuration on the interface or all interfaces
Step 8
show running-config
Example:
Device# show running-config
Verifies the configuration on the interface or all interfaces
Step 9
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entries in the configuration file.
Forwarding UDP Broadcast Packets and Protocols
If you do not specify any UDP ports when you configure the forwarding of UDP broadcasts, you are configuring the router to
act as a BOOTP forwarding agent. BOOTP packets carry DHCP information.
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
interfaceinterface-id
Example:
Device(config)# interface gigabitethernet 1/0/1
Enters interface configuration mode, and specifies the Layer 3 interface to configure.
Step 3
ip helper-addressaddress
Example:
Device(config-if)# ip helper address 10.1.10.1
Enables forwarding and specifies the destination address for forwarding UDP broadcast packets, including BOOTP.
Step 4
exit
Example:
Device(config-if)# exit
Returns to global configuration mode.
Step 5
ip forward-protocol {udp [port] | nd | sdns}
Example:
Device(config)# ip forward-protocol sdns
Specifies which protocols the router forwards when forwarding broadcast packets.
Step 6
end
Example:
Device(config)# end
Returns to privileged EXEC mode.
Step 7
show ip interface [interface-id]
Example:
Device# show ip interface gigabitethernet 1/0/1
Verifies the configuration on the interface or all interfaces.
Step 8
show running-config
Example:
Device# show running-config
Verifies the configuration on the interface or all interfaces.
Step 9
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entries in the configuration file.
Establishing an IP Broadcast Address
The most popular IP broadcast address (and the default) is an address consisting of all ones (255.255.255.255). However, the
switch can be configured to generate any form of IP broadcast address.
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
interfaceinterface-id
Example:
Device(config)# interface gigabitethernet 1/0/1
Enters interface configuration mode, and specifies the interface to configure.
Step 3
ip broadcast-addressip-address
Example:
Device(config-if)# ip broadcast-address 128.1.255.255
Enters a broadcast address different from the default, for example 128.1.255.255.
Step 4
end
Example:
Device(config-if)# end
Returns to privileged EXEC mode.
Step 5
show ip interface [interface-id]
Example:
Device# show ip interface
Verifies the broadcast address on the interface or all interfaces.
Step 6
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entries in the configuration file.
Flooding IP Broadcasts
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
ip forward-protocol spanning-tree
Example:
Device(config)# ip forward-protocol spanning-tree
Uses the bridging spanning-tree database to flood UDP datagrams.
Step 3
end
Example:
Device(config)# end
Returns to privileged EXEC mode.
Step 4
show running-config
Example:
Device# show running-config
Verifies your entry.
Step 5
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entry in the configuration file.
Step 6
configure terminal
Example:
Device# configure terminal
Enters global configuration mode
Step 7
ip forward-protocol turbo-flood
Example:
Device(config)# ip forward-protocol turbo-flood
Uses the spanning-tree database to speed up flooding of UDP datagrams.
Step 8
end
Example:
Device(config)# end
Returns to privileged EXEC mode.
Step 9
show running-config
Example:
Device# show running-config
Verifies your entry.
Step 10
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entry in the configuration file.
Monitoring and Maintaining IP Addressing
When the contents of a particular cache, table, or database have become or are suspected to be invalid, you can remove all
its contents by using the clear privileged EXEC commands. Table 41-2 lists the commands for clearing contents.
Table 2. Commands to Clear Caches, Tables, and Databases
clear arp-cache
Clears the IP ARP cache and the fast-switching cache.
clear host {name | *}
Removes one or all entries from the hostname and the address cache.
clear ip route {network [mask] | *}
Removes one or more routes from the IP routing table.
You can display specific statistics, such as the contents of IP routing tables, caches, and databases; the reachability of
nodes; and the routing path that packets are taking through the network. Table 41-3 lists the privileged EXEC commands for
displaying IP statistics.
Table 3. Commands to Display Caches, Tables, and Databases
show arp
Displays the entries in the ARP table.
show hosts
Displays the default domain name, style of lookup service, name server hosts, and the cached list of hostnames and addresses.
show ip aliases
Displays IP addresses mapped to TCP ports (aliases).
show ip arp
Displays the IP ARP cache.
show ip interface [interface-id]
Displays the IP status of interfaces.
show ip irdp
Displays IRDP values.
show ip masksaddress
Displays the masks used for network addresses and the number of subnets using each mask.
show ip redirects
Displays the address of a default gateway.
show ip route [address [mask]] | [protocol]
Displays the current state of the routing table.
show ip route summary
Displays the current state of the routing table in summary form.
How to Configure IP Unicast Routing
Enabling IP Unicast Routing
By default, the switch is in Layer 2 switching mode and IP routing is disabled. To use the Layer 3 capabilities of the switch,
you must enable IP routing.
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
ip routing
Example:
Device(config)# ip routing
Enables IP routing.
Step 3
routerip_routing_protocol
Example:
Device(config)# router rip
Specifies an IP routing protocol. This step might include other commands, such as specifying the networks to route with the
network (RIP) router configuration command. For information on specific protocols, see sections later in this chapter and to the Cisco IOS IP Configuration Guide, Release 12.4.
Note
The IP base feature set supports only RIP as a routing protocol.
Step 4
end
Example:
Device(config)# end
Returns to privileged EXEC mode.
Step 5
show running-config
Example:
Device# show running-config
Verifies your entries.
Step 6
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entries in the configuration file.
Example of Enabling IP Routing
This example shows how to enable IP routingusing RIP as the routing protocol :
Device# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Device(config)# ip routing
Device(config)# router rip
Device(config-router)# network 10.0.0.0Device(config-router)# end
What to Do Next
You can now set up parameters for the selected routing protocols as described in these sections:
RIP
OSPF,
EIGRP
BGP
Unicast Reverse Path Forwarding
Protocol-Independent Features (optional)
Information About RIP
The Routing Information Protocol (RIP) is an
interior gateway protocol (IGP) created for use in small, homogeneous networks.
It is a distance-vector routing protocol that uses broadcast User Datagram
Protocol (UDP) data packets to exchange routing information. The protocol is
documented in RFC 1058. You can find detailed information about RIP in
IP Routing Fundamentals,
published by Cisco Press.
Note
RIP is supported in the IP
Base.
Using RIP, the switch sends
routing information updates (advertisements) every 30 seconds. If a router does
not receive an update from another router for 180 seconds or more, it marks the
routes served by that router as unusable. If there is still no update after 240
seconds, the router removes all routing table entries for the non-updating
router.
RIP uses hop counts to rate the value of
different routes. The hop count is the number of routers that can be traversed
in a route. A directly connected network has a hop count of zero; a network
with a hop count of 16 is unreachable. This small range (0 to 15) makes RIP
unsuitable for large networks.
If the router has a default
network path, RIP advertises a route that links the router to the pseudonetwork
0.0.0.0. The 0.0.0.0 network does not exist; it is treated by RIP as a network
to implement the default routing feature. The switch advertises the default
network if a default was learned by RIP or if the router has a gateway of last
resort and RIP is configured with a default metric. RIP sends updates to the
interfaces in specified networks. If an interface’s network is not specified,
it is not advertised in any RIP update.
Summary Addresses and Split Horizon
Routers connected to broadcast-type IP networks and using distance-vector routing protocols normally use the split-horizon
mechanism to reduce the possibility of routing loops. Split horizon blocks information about routes from being advertised
by a router on any interface from which that information originated. This feature usually optimizes communication among multiple
routers, especially when links are broken.
How to Configure RIP
Default RIP Configuration
Table 4. Default RIP
Configuration
Feature
Default Setting
Auto summary
Enabled.
Default-information originate
Disabled.
Default metric
Built-in; automatic metric
translations.
IP RIP authentication
key-chain
No authentication.
Authentication mode: clear
text.
IP RIP triggered
Disabled
IP split horizon
Varies with media.
Neighbor
None defined.
Network
None specified.
Offset list
Disabled.
Output delay
0 milliseconds.
Timers basic
Update: 30 seconds.
Invalid: 180 seconds.
Hold-down: 180 seconds.
Flush: 240 seconds.
Validate-update-source
Enabled.
Version
Receives RIP Version 1 and 2
packets; sends Version 1 packets.
Configuring Basic RIP Parameters
To configure RIP, you enable
RIP routing for a network and optionally configure other parameters. On the
switches, RIP configuration commands are ignored until you configure the
network number.
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
ip
routing
Example:
Device(config)# ip routing
Enables IP
routing. (Required only if IP routing is disabled.)
Step 3
router
rip
Example:
Device(config)# router rip
Enables a RIP
routing process, and enter router configuration mode.
Step 4
networknetwork number
Example:
Device(config)# network 12
Associates a
network with a RIP routing process. You can specify multiple
network commands. RIP routing updates are sent and
received through interfaces only on these networks.
Note
You must
configure a network number for the RIP commands to take effect.
Step 5
neighborip-address
Example:
Device(config)# neighbor 10.2.5.1
(Optional)
Defines a neighboring router with which to exchange routing information. This
step allows routing updates from RIP (normally a broadcast protocol) to reach
nonbroadcast networks.
(Optional)
Applies an offset list to routing metrics to increase incoming and outgoing
metrics to routes learned through RIP. You can limit the offset list with an
access list or an interface.
Step 7
timers
basicupdate invalid holddown
flush
Example:
Device(config)# timers basic 45 360 400 300
(Optional)
Adjusts routing protocol timers. Valid ranges for all timers are 0 to
4294967295 seconds.
update—The time between sending routing updates.
The default is 30 seconds.
invalid—The timer after which a route is declared
invalid. The default is 180 seconds.
holddown—The time before a route is removed from
the routing table. The default is 180 seconds.
flush—The amount of time for which routing updates
are postponed. The default is 240 seconds.
Step 8
version {1 |
2}
Example:
Device(config)# version 2
(Optional)
Configures the switch to receive and send only RIP Version 1 or RIP Version 2
packets. By default, the switch receives Version 1 and 2 but sends only Version
1. You can also use the interface commands
ip rip {send |
receive}
version 1 |
2 |
1 2} to control
what versions are used for sending and receiving on interfaces.
Step 9
no auto
summary
Example:
Device(config)# no auto summary
(Optional)
Disables automatic summarization. By default, the switch summarizes subprefixes
when crossing classful network boundaries. Disable summarization (RIP Version 2
only) to advertise subnet and host routing information to classful network
boundaries.
Step 10
no
validate-update-source
Example:
Device(config)# no validdate-update-source
(Optional)
Disables validation of the source IP address of incoming RIP routing updates.
By default, the switch validates the source IP address of incoming RIP routing
updates and discards the update if the source address is not valid. Under
normal circumstances, disabling this feature is not recommended. However, if
you have a router that is off-network and you want to receive its updates, you
can use this command.
Step 11
output-delaydelay
Example:
Device(config)# output-delay 8
(Optional) Adds
interpacket delay for RIP updates sent. By default, packets in a
multiple-packet RIP update have no delay added between packets. If you are
sending packets to a lower-speed device, you can add an interpacket delay in
the range of 8 to 50 milliseconds.
Step 12
end
Example:
Device(config)# end
Returns to
privileged EXEC mode.
Step 13
show ip
protocols
Example:
Device# show ip protocols
Verifies your
entries.
Step 14
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional)
Saves your entries in the configuration file.
Configuring RIP Authentication
RIP Version 1 does not
support authentication. If you are sending and receiving RIP Version 2 packets,
you can enable RIP authentication on an interface. The key chain specifies the
set of keys that can be used on the interface. If a key chain is not
configured, no authentication is performed.
The switch supports two modes
of authentication on interfaces for which RIP authentication is enabled: plain
text and MD5. The default is plain text.
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
interfaceinterface-id
Example:
Device(config)# interface gigabitethernet 1/0/1
Enters interface
configuration mode, and specifies the interface to configure.
Step 3
ip rip
authentication key-chainname-of-chain
Example:
Device(config-if)# ip rip authentication key-chain trees
Enables RIP
authentication.
Step 4
ip rip authentication mode {text |
md5}
Example:
Device(config-if)# ip rip authentication mode md5
Configures the
interface to use plain text authentication (the default) or MD5 digest
authentication.
Step 5
end
Example:
Device(config-if)# end
Returns to
privileged EXEC mode.
Step 6
show running-config interface [interface-id]
Example:
Device# show running-config
Verifies your
entries.
Step 7
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves
your entries in the configuration file.
Configuring Summary Addresses and Split Horizon
Note
In general, disabling split
horizon is not recommended unless you are certain that your application
requires it to properly advertise routes.
If you want to configure an interface running
RIP to advertise a summarized local IP address pool on a network access server
for dial-up clients, use the
ip summary-address rip interface configuration
command.
Note
If split horizon is enabled,
neither autosummary nor interface IP summary addresses are advertised.
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
interfaceinterface-id
Example:
Device(config)# interface gigabitethernet 1/0/1
Enters interface
configuration mode, and specifies the Layer 3 interface to configure.
Step 3
ip addressip-address
subnet-mask
Example:
Device(config-if)# ip address 10.1.1.10 255.255.255.0
Configures the IP
address and IP subnet.
Step 4
ip
summary-address rip ip addressip-network mask
Example:
Device(config-if)# ip summary-address rip ip address 10.1.1.30 255.255.255.0
Configures the IP
address to be summarized and the IP network mask.
Step 5
no ip split
horizon
Example:
Device(config-if)# no ip split horizon
Disables split
horizon on the interface.
Step 6
end
Example:
Device(config-if)# end
Returns to
privileged EXEC mode.
Step 7
show ip
interfaceinterface-id
Example:
Device# show ip interface gigabitethernet 1/0/1
Verifies your
entries.
Step 8
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves
your entries in the configuration file.
Configuring Split Horizon
Routers connected to
broadcast-type IP networks and using distance-vector routing protocols normally
use the split-horizon mechanism to reduce the possibility of routing loops.
Split horizon blocks information about routes from being advertised by a router
on any interface from which that information originated. This feature can
optimize communication among multiple routers, especially when links are
broken.
Note
In general, we do not
recommend disabling split horizon unless you are certain that your application
requires it to properly advertise routes.
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
interfaceinterface-id
Example:
Device(config)# interface gigabitethernet 1/0/1
Enters interface
configuration mode, and specifies the interface to configure.
Step 3
ip addressip-address
subnet-mask
Example:
Device(config-if)# ip address 10.1.1.10 255.255.255.0
Configures the IP
address and IP subnet.
Step 4
no ip
split-horizon
Example:
Device(config-if)# no ip split-horizon
Disables split
horizon on the interface.
Step 5
end
Example:
Device(config-if)# end
Returns to
privileged EXEC mode.
Step 6
show ip
interfaceinterface-id
Example:
Device# show ip interface gigabitethernet 1/0/1
Verifies your
entries.
Step 7
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves
your entries in the configuration file.
Configuration Example for Summary Addresses and Split Horizon
In this example, the major net is 10.0.0.0. The summary address 10.2.0.0 overrides the autosummary address of 10.0.0.0 so
that 10.2.0.0 is advertised out interface Gigabit Ethernet port 2, and 10.0.0.0 is not advertised. In the example, if the
interface is still in Layer 2 mode (the default), you must enter a no switchport interface configuration command before entering the ip address interface configuration command.
Note
If split horizon is enabled, neither autosummary nor interface summary addresses (those configured with the ip summary-address rip router configuration command) are advertised.
Device(config)# router rip
Device(config-router)# interface gigabitethernet1/0/2
Device(config-if)# ip address 10.1.5.1 255.255.255.0
Device(config-if)# ip summary-address rip 10.2.0.0 255.255.0.0
Device(config-if)# no ip split-horizon
Device(config-if)# exit
Device(config)# router rip
Device(config-router)# network 10.0.0.0
Device(config-router)# neighbor 2.2.2.2 peer-group mygroup
Device(config-router)# end
Information About OSPF
OSPF is an Interior Gateway Protocol (IGP) designed
expressly for IP networks, supporting IP subnetting and tagging of externally
derived routing information. OSPF also allows packet authentication and uses IP
multicast when sending and receiving packets. The Cisco implementation supports
RFC 1253, OSPF management information base (MIB).
Note
OSPF is supported in IP Base.
The Cisco implementation
conforms to the OSPF Version 2 specifications with these key features:
Definition of stub areas is
supported.
Routes learned through any IP
routing protocol can be redistributed into another IP routing protocol. At the
intradomain level, this means that OSPF can import routes learned through EIGRP
and RIP. OSPF routes can also be exported into RIP.
Plain text and MD5
authentication among neighboring routers within an area is supported.
Configurable routing
interface parameters include interface output cost, retransmission interval,
interface transmit delay, router priority, router dead and hello intervals, and
authentication key.
Virtual links are supported.
Not-so-stubby-areas (NSSAs) per RFC 1587are
supported.
OSPF typically requires coordination among many
internal routers, area border routers (ABRs) connected to multiple areas, and
autonomous system boundary routers (ASBRs). The minimum configuration would use
all default parameter values, no authentication, and interfaces assigned to
areas. If you customize your environment, you must ensure coordinated
configuration of all routers.
OSPF Nonstop Forwarding
The switch or switch stack
supports two levels of nonstop forwarding (NSF):
The IP-services feature set
supports OSPF NSF Awareness supported for IPv4. When the neighboring router is
NSF-capable, the Layer 3 switch continues to forward packets from the
neighboring router during the interval between the primary Route Processor (RP)
in a router crashing and the backup RP taking over, or while the primary RP is
manually reloaded for a non-disruptive software upgrade.
This feature cannot be
disabled.
OSPF NSF Capability
The IP services feature set supports the OSPFv2 NSF IETF format in addition to the OSPFv2 NSF Cisco format that is supported
in earlier releases. For information about this feature, see NSF—OSPF (RFC 3623 OSPF Graceful Restart): http://www.cisco.com/en/US/docs/ios/ha/configuration/guide/ha-ospf_grrs.html#wp1055692.
The IP-services feature set also supports OSPF NSF-capable routing for IPv4 for better convergence and lower traffic loss
following a stack master change. When a stack master change occurs in an OSPF NSF-capable stack, the new stack master must
do two things to resynchronize its link-state database with its OSFP neighbors:
Release the available OSPF neighbors on the network without resetting the neighbor relationship.
Reacquire the contents of the link-state database for the network.
After a stack master change, the new master sends an OSPF NSF signal to neighboring NSF-aware devices. A device recognizes
this signal to mean that it should not reset the neighbor relationship with the stack. As the NSF-capable stack master receives
signals from other routes on the network, it begins to rebuild its neighbor list.
When the neighbor relationships are reestablished, the NSF-capable stack master resynchronizes its database with its NSF-aware
neighbors, and routing information is exchanged between the OSPF neighbors. The new stack master uses this routing information
to remove stale routes, to update the routing information database (RIB), and to update the forwarding information base (FIB)
with the new information. The OSPF protocols then fully converge.
Note
OSPF NSF requires that all neighbor networking devices be NSF-aware. If an NSF-capable router discovers non-NSF aware neighbors
on a network segment, it disables NSF capabilities for that segment. Other network segments where all devices are NSF-aware
or NSF-capable continue to provide NSF capabilities.
Use the nsf OSPF routing configuration command to enable OSPF NSF routing. Use the show ip ospf privileged EXEC command to verify that it is enabled.
You can optionally configure several OSPF area parameters. These parameters include authentication for password-based protection
against unauthorized access to an area, stub areas, and not-so-stubby-areas (NSSAs). Stub areas are areas into which information
on external routes is not sent. Instead, the area border router (ABR) generates a default external route into the stub area
for destinations outside the autonomous system (AS). An NSSA does not flood all LSAs from the core into the area, but can
import AS external routes within the area by redistribution.
Route summarization is the consolidation of advertised addresses into a single summary route to be advertised by other areas.
If network numbers are contiguous, you can use the area range router configuration command to configure the ABR to advertise a summary route that covers all networks in the range.
Other OSPF Parameters
You can optionally configure other OSPF parameters in router configuration mode.
Route summarization: When redistributing routes from other protocols as described in the “Using Route Maps to Redistribute
Routing Information” section on page 41-124, each route is advertised individually in an external LSA. To help decrease the
size of the OSPF link state database, you can use the summary-address router configuration command to advertise a single router for all the redistributed routes included in a specified network
address and mask.
Virtual links: In OSPF, all areas must be connected to a backbone area. You can establish a virtual link in case of a backbone-continuity
break by configuring two Area Border Routers as endpoints of a virtual link. Configuration information includes the identity
of the other virtual endpoint (the other ABR) and the nonbackbone link that the two routers have in common (the transit area).
Virtual links cannot be configured through a stub area.
Default route: When you specifically configure redistribution of routes into an OSPF routing domain, the route automatically
becomes an autonomous system boundary router (ASBR). You can force the ASBR to generate a default route into the OSPF routing
domain.
Domain Name Server (DNS) names for use in all OSPF show privileged EXEC command displays makes it easier to identify a router than displaying it by router ID or neighbor ID.
Default Metrics: OSPF calculates the OSPF metric for an interface according to the bandwidth of the interface. The metric
is calculated as ref-bw divided by bandwidth, where ref is 10 by default, and bandwidth (bw) is specified by the bandwidth interface configuration command. For multiple links with high bandwidth, you can specify a larger number to differentiate
the cost on those links.
Administrative distance is a rating of the trustworthiness of a routing information source, an integer between 0 and 255,
with a higher value meaning a lower trust rating. An administrative distance of 255 means the routing information source cannot
be trusted at all and should be ignored. OSPF uses three different administrative distances: routes within an area (interarea),
routes to another area (interarea), and routes from another routing domain learned through redistribution (external). You
can change any of the distance values.
Passive interfaces: Because interfaces between two devices on an Ethernet represent only one network segment, to prevent OSPF
from sending hello packets for the sending interface, you must configure the sending device to be a passive interface. Both
devices can identify each other through the hello packet for the receiving interface.
Route calculation timers: You can configure the delay time between when OSPF receives a topology change and when it starts
the shortest path first (SPF) calculation and the hold time between two SPF calculations.
Log neighbor changes: You can configure the router to send a syslog message when an OSPF neighbor state changes, providing
a high-level view of changes in the router.
LSA Group Pacing
The OSPF LSA group pacing feature allows the router to group OSPF LSAs and pace the refreshing, check-summing, and aging functions
for more efficient router use. This feature is enabled by default with a 4-minute default pacing interval, and you will not
usually need to modify this parameter. The optimum group pacing interval is inversely proportional to the number of LSAs the
router is refreshing, check-summing, and aging. For example, if you have approximately 10,000 LSAs in the database, decreasing
the pacing interval would benefit you. If you have a very small database (40 to 100 LSAs), increasing the pacing interval
to 10 to 20 minutes might benefit you slightly.
Loopback Interfaces
OSPF uses the highest IP address configured on the interfaces as its router ID. If this interface is down or removed, the
OSPF process must recalculate a new router ID and resend all its routing information out its interfaces. If a loopback interface
is configured with an IP address, OSPF uses this IP address as its router ID, even if other interfaces have higher IP addresses.
Because loopback interfaces never fail, this provides greater stability. OSPF automatically prefers a loopback interface over
other interfaces, and it chooses the highest IP address among all loopback interfaces.
How to Configure OSPF
Default OSPF Configuration
Table 5. Default OSPF
Configuration
Feature
Default Setting
Interface parameters
Cost: 1.
Retransmit interval: 5
seconds.
Transmit delay: 1 second.
Priority: 1.
Hello interval: 10 seconds.
Dead interval: 4 times the
hello interval.
No authentication.
No password specified.
MD5 authentication disabled.
Area
Authentication type: 0 (no
authentication).
Default cost: 1.
Range: Disabled.
Stub: No stub area defined.
NSSA: No NSSA area defined.
Auto cost
100 Mb/s.
Default-information originate
Disabled. When enabled, the
default metric setting is 10, and the external route type default is Type 2.
Default metric
Built-in, automatic metric
translation, as appropriate for each routing protocol.
Distance OSPF
dist1 (all routes within an
area): 110. dist2 (all routes from one area to another): 110. and dist3 (routes
from other routing domains): 110.
OSPF database filter
Disabled. All outgoing
link-state advertisements (LSAs) are flooded to the interface.
IP OSPF name lookup
Disabled.
Log adjacency changes
Enabled.
Neighbor
None specified.
Neighbor database filter
Disabled. All outgoing LSAs
are flooded to the neighbor.
Network area
Disabled.
Nonstop Forwarding (NSF)
awareness
Enabled. Allows Layer 3
switches to continue forwarding packets from a neighboring NSF-capable router
during hardware or software changes.
NSF capability
Disabled.
Note
The switch stack supports
OSPF NSF-capable routing for IPv4.
Router ID
No OSPF routing process
defined.
Summary address
Disabled.
Timers LSA group pacing
240 seconds.
Timers shortest path first
(spf)
spf delay: 5 seconds.;
spf-holdtime: 10 seconds.
Virtual link
No area ID or router ID
defined.
Hello interval: 10 seconds.
Retransmit interval: 5
seconds.
Transmit delay: 1 second.
Dead interval: 40 seconds.
Authentication key: no key
predefined.
Message-digest key (MD5): no
key predefined.
Configuring Basic OSPF Parameters
To enable OSPF, create an
OSPF routing process, specify the range of IP addresses to associate with the
routing process, and assign area IDs to be associated with that range. For
switches running the IP services image, you can configure either the Cisco
OSPFv2 NSF format or the IETF OSPFv2 NSF format.
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
router
ospf process-id
Example:
Device(config)# router ospf 15
Enables OSPF
routing, and enter router configuration mode. The process ID is an internally
used identification parameter that is locally assigned and can be any positive
integer. Each OSPF routing process has a unique value.
Note
OSPF for Routed
Access supports only one OSPFv2 and one OSPFv3 instance with a maximum number
of 200 dynamically learned routes.
Step 3
nsf cisco [enforce global]
Example:
Device(config)# nsf cisco enforce global
(Optional)
Enables Cisco NSF operations for OSPF. The
enforce global keyword cancels NSF restart when
non-NSF-aware neighboring networking devices are detected.
Note
Enter the command
in Step 3 or Step 4, and go to Step 5.
Step 4
nsf ietf [restart-intervalseconds]
Example:
Device(config)# nsf ietf restart-interval 60
(Optional)
Enables IETF NSF operations for OSPF. The
restart-interval keyword specifies the length of
the graceful restart interval, in seconds. The range is from 1 to 1800. The
default is 120.
Note
Enter the command
in Step 3 or Step 4, and go to Step 5.
Step 5
network address wildcard-mask
area area-id
Example:
Device(config)# network 10.1.1.1 255.240.0.0 area 20
Define an
interface on which OSPF runs and the area ID for that interface. You can use
the wildcard-mask to use a single command to define one or more multiple
interfaces to be associated with a specific OSPF area. The area ID can be a
decimal value or an IP address.
Step 6
end
Example:
Device(config)# end
Returns to
privileged EXEC mode.
Step 7
show ip
protocols
Example:
Device# show ip protocols
Verifies your
entries.
Step 8
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves
your entries in the configuration file.
Configuring OSPF Interfaces
You can use the
ip ospf interface configuration commands to modify
interface-specific OSPF parameters. You are not required to modify any of these
parameters, but some interface parameters (hello interval, dead interval, and
authentication key) must be consistent across all routers in an attached
network. If you modify these parameters, be sure all routers in the network
have compatible values.
Note
The
ip ospf interface
configuration commands are all optional.
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
interface interface-id
Example:
Device(config)# interface gigabitethernet 1/0/1
Enters interface
configuration mode, and specifies the Layer 3 interface to configure.
Step 3
ip
ospf cost
Example:
Device(config-if)# ip ospf 8
(Optional)
Explicitly specifies the cost of sending a packet on the interface.
Step 4
ip ospf
retransmit-interval seconds
Example:
Device(config-if)# ip ospf transmit-interval 10
(Optional)
Specifies the number of seconds between link state advertisement transmissions.
The range is 1 to 65535 seconds. The default is 5 seconds.
Step 5
ip ospf
transmit-delay seconds
Example:
Device(config-if)# ip ospf transmit-delay 2
(Optional) Sets
the estimated number of seconds to wait before sending a link state update
packet. The range is 1 to 65535 seconds. The default is 1 second.
Step 6
ip ospf
priority number
Example:
Device(config-if)# ip ospf priority 5
(Optional) Sets
priority to help find the OSPF designated router for a network. The range is
from 0 to 255. The default is 1.
Step 7
ip ospf
hello-interval seconds
Example:
Device(config-if)# ip ospf hello-interval 12
(Optional) Sets
the number of seconds between hello packets sent on an OSPF interface. The
value must be the same for all nodes on a network. The range is 1 to 65535
seconds. The default is 10 seconds.
Step 8
ip ospf
dead-interval seconds
Example:
Device(config-if)# ip ospf dead-interval 8
(Optional) Sets
the number of seconds after the last device hello packet was seen before its
neighbors declare the OSPF router to be down. The value must be the same for
all nodes on a network. The range is 1 to 65535 seconds. The default is 4 times
the hello interval.
Step 9
ip ospf
authentication-key key
Example:
Device(config-if)# ip ospf authentication-key password
(Optional) Assign
a password to be used by neighboring OSPF routers. The password can be any
string of keyboard-entered characters up to 8 bytes in length. All neighboring
routers on the same network must have the same password to exchange OSPF
information.
Step 10
ip ospf message
digest-key keyid
md5 key
Example:
Device(config-if)# ip ospf message digest-key 16 md5 your1pass
(Optional)
Enables MDS authentication.
keyid—An identifier from 1 to 255.
key—An alphanumeric password of up to 16 bytes.
Step 11
ip ospf
database-filter all out
Example:
Device(config-if)# ip ospf database-filter all out
(Optional) Block
flooding of OSPF LSA packets to the interface. By default, OSPF floods new LSAs
over all interfaces in the same area, except the interface on which the LSA
arrives.
Step 12
end
Example:
Device(config-if)# end
Returns to
privileged EXEC mode.
Step 13
show ip ospf interface [interface-name]
Example:
Device# show ip ospf interface
Displays
OSPF-related interface information.
Step 14
show ip ospf
neighbor detail
Example:
Device# show ip ospf neighbor detail
Displays NSF
awareness status of neighbor switch. The output matches one of these examples:
Options is
0x52
LLS Options is
0x1 (LR)
When both of
these lines appear, the neighbor switch is NSF aware.
Options is
0x42—This means the neighbor switch is not NSF aware.
Step 15
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional)
Saves your entries in the configuration file.
Configuring OSPF Area Parameters
Before you begin
Note
The OSPF
area router configuration commands are all
optional.
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
router
ospf process-id
Example:
Device(config)# router ospf 109
Enables OSPF
routing, and enter router configuration mode.
Step 3
areaarea-idauthentication
Example:
Device(config-router)# area 1 authentication
(Optional) Allow
password-based protection against unauthorized access to the identified area.
The identifier can be either a decimal value or an IP address.
Step 4
areaarea-idauthentication
message-digest
Example:
Device(config-router)# area 1 authentication message-digest
(Optional)
Enables MD5 authentication on the area.
Step 5
areaarea-idstub [no-summary]
Example:
Device(config-router)# area 1 stub
(Optional) Define
an area as a stub area. The
no-summary keyword prevents an ABR from sending
summary link advertisements into the stub area.
Device(config-router)# area 1 nssa default-information-originate
(Optional)
Defines an area as a not-so-stubby-area. Every router within the same area must
agree that the area is NSSA. Select one of these keywords:
no-redistribution—Select when the router is an
NSSA ABR and you want the
redistribute command to import routes into normal
areas, but not into the NSSA.
default-information-originate—Select on an ABR to
allow importing type 7 LSAs into the NSSA.
no-redistribution—Select to not send summary LSAs
into the NSSA.
Step 7
areaarea-idrangeaddress mask
Example:
Device(config-router)# area 1 range 255.240.0.0
(Optional)
Specifies an address range for which a single route is advertised. Use this
command only with area border routers.
Step 8
end
Example:
Device(config-router)# end
Returns to
privileged EXEC mode.
Step 9
show ip ospf
[process-id]
Example:
Device# show ip ospf
Displays
information about the OSPF routing process in general or for a specific process
ID to verify configuration.
Step 10
show ip ospf [process-id
[area-id]]
database
Example:
Device# show ip osfp database
Displays lists of
information related to the OSPF database for a specific router.
Step 11
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional)
Saves your entries in the configuration file.
Configuring Other OSPF Parameters
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
router ospfprocess-id
Example:
Device(config)# router ospf 10
Enables OSPF
routing, and enter router configuration mode.
Device(config)# area 2 virtual-link 192.168.255.1 hello-interval 5
(Optional)
Establishes a virtual link and set its parameters. See the “Configuring OSPF
Interfaces” section on page 41-39 for parameter definitions and Table 41-5 on
page 41-35 for virtual link defaults.
spf-delay—Delay between receiving a change to SPF
calculation. The range is from 1 to 600000 miliseconds.
spf-holdtime—Delay between first and second SPF
calculation. The range is form 1 to 600000 in milliseconds.
spf-wait—Maximum wait time in milliseconds for SPF
calculations. The range is from 1 to 600000 in milliseconds.
Step 11
ospf
log-adj-changes
Example:
Device(config)# ospf log-adj-changes
(Optional)
Sends syslog message when a neighbor state changes.
Step 12
end
Example:
Device(config)# end
Returns to
privileged EXEC mode.
Step 13
show ip ospf [process-id [area-id]]
database
Example:
Device# show ip ospf database
Displays lists
of information related to the OSPF database for a specific router. For some of
the keyword options, see the “Monitoring OSPF” section on page 41-47.
Step 14
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional)
Saves your entries in the configuration file.
Changing LSA Group Pacing
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
router ospfprocess-id
Example:
Device(config)# router ospf 25
Enables OSPF
routing, and enter router configuration mode.
Step 3
timers
lsa-group-pacingseconds
Example:
Device(config-router)# timers lsa-group-pacing 15
Changes the group
pacing of LSAs.
Step 4
end
Example:
Device(config)# end
Returns to
privileged EXEC mode.
Step 5
show
running-config
Example:
Device# show running-config
Verifies your
entries.
Step 6
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves
your entries in the configuration file.
Configuring a Loopback Interface
Procedure
Command or Action
Purpose
Step 1
configure terminal
Example:
Device# configure terminal
Enters global configuration mode.
Step 2
interface loopback 0
Example:
Device(config)# interface loopback 0
Creates a loopback interface, and enter interface configuration mode.
Step 3
ip address address mask
Example:
Device(config-if)# ip address 10.1.1.5 255.255.240.0
Assign an IP address to this interface.
Step 4
end
Example:
Device(config-if)# end
Returns to privileged EXEC mode.
Step 5
show ip interface
Example:
Device# show ip interface
Verifies your entries.
Step 6
copy running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves your entries in the configuration file.
Monitoring OSPF
You can display specific statistics such as the contents of IP routing tables, caches, and databases.
Table 6. Show IP OSPF Statistics Commands
show ip ospf [process-id]
Displays general information about OSPF routing processes.
show ip ospf [process-id] database [router] [link-state-id]
show ip ospf [process-id] database [router] [self-originate]
show ip ospf [process-id] database [router] [adv-router [ip-address]]
show ip ospf [process-id] database [network] [link-state-id]
show ip ospf [process-id] database [summary] [link-state-id]
show ip ospf [process-id] database [asbr-summary] [link-state-id]
show ip ospf [process-id] database [external] [link-state-id]
show ip ospf [process-id area-id] database [database-summary]
Displays lists of information related to the OSPF database.
show ip ospf border-routes
Displays the internal OSPF routing ABR and ASBR table entries.
show ip ospf interface [interface-name]
Displays OSPF-related interface information.
show ip ospf neighbor [interface-name] [neighbor-id] detail
Displays OSPF interface neighbor information.
show ip ospf virtual-links
Displays OSPF-related virtual links information.
Configuration Examples for OSPF
Example: Configuring Basic OSPF Parameters
This example shows how to configure an OSPF routing process and assign it a process number of 109:
Device(config)# router ospf 109
Device(config-router)# network 131.108.0.0 255.255.255.0 area 24
Information About EIGRP
Enhanced IGRP (EIGRP) is a Cisco proprietary enhanced version of the IGRP. EIGRP uses the same distance vector algorithm and
distance information as IGRP; however, the convergence properties and the operating efficiency of EIGRP are significantly
improved.
The convergence technology employs an algorithm referred to as the Diffusing Update Algorithm (DUAL), which guarantees loop-free
operation at every instant throughout a route computation and allows all devices involved in a topology change to synchronize
at the same time. Routers that are not affected by topology changes are not involved in recomputations.
IP EIGRP provides increased network width. With RIP, the largest possible width of your network is 15 hops. Because the EIGRP
metric is large enough to support thousands of hops, the only barrier to expanding the network is the transport-layer hop
counter. EIGRP increments the transport control field only when an IP packet has traversed 15 routers and the next hop to
the destination was learned through EIGRP. When a RIP route is used as the next hop to the destination, the transport control
field is incremented as usual.
EIGRP Features
EIGRP offers these features:
Fast convergence.
Incremental updates when the state of a destination changes, instead of sending the entire contents of the routing table,
minimizing the bandwidth required for EIGRP packets.
Less CPU usage because full update packets need not be processed each time they are received.
Protocol-independent neighbor discovery mechanism to learn about neighboring routers.
Variable-length subnet masks (VLSMs).
Arbitrary route summarization.
EIGRP scales to large networks.
EIGRP Components
EIGRP has these four basic components:
Neighbor discovery and recovery is the process that routers use to dynamically learn of other routers on their directly attached
networks. Routers must also discover when their neighbors become unreachable or inoperative. Neighbor discovery and recovery
is achieved with low overhead by periodically sending small hello packets. As long as hello packets are received, the Cisco
IOS software can learn that a neighbor is alive and functioning. When this status is determined, the neighboring routers can
exchange routing information.
The reliable transport protocol is responsible for guaranteed, ordered delivery of EIGRP packets to all neighbors. It supports
intermixed transmission of multicast and unicast packets. Some EIGRP packets must be sent reliably, and others need not be.
For efficiency, reliability is provided only when necessary. For example, on a multiaccess network that has multicast capabilities
(such as Ethernet), it is not necessary to send hellos reliably to all neighbors individually. Therefore, EIGRP sends a single
multicast hello with an indication in the packet informing the receivers that the packet need not be acknowledged. Other types
of packets (such as updates) require acknowledgment, which is shown in the packet. The reliable transport has a provision
to send multicast packets quickly when there are unacknowledged packets pending. Doing so helps ensure that convergence time
remains low in the presence of varying speed links.
The DUAL finite state machine embodies the decision process for all route computations. It tracks all routes advertised by
all neighbors. DUAL uses the distance information (known as a metric) to select efficient, loop-free paths. DUAL selects routes
to be inserted into a routing table based on feasible successors. A successor is a neighboring router used for packet forwarding
that has a least-cost path to a destination that is guaranteed not to be part of a routing loop. When there are no feasible
successors, but there are neighbors advertising the destination, a recomputation must occur. This is the process whereby a
new successor is determined. The amount of time it takes to recompute the route affects the convergence time. Recomputation
is processor-intensive; it is advantageous to avoid recomputation if it is not necessary. When a topology change occurs, DUAL
tests for feasible successors. If there are feasible successors, it uses any it finds to avoid unnecessary recomputation.
The protocol-dependent modules are responsible for network layer protocol-specific tasks. An example is the IP EIGRP module,
which is responsible for sending and receiving EIGRP packets that are encapsulated in IP. It is also responsible for parsing
EIGRP packets and informing DUAL of the new information received. EIGRP asks DUAL to make routing decisions, but the results
are stored in the IP routing table. EIGRP is also responsible for redistributing routes learned by other IP routing protocols.
Note
To enable EIGRP, the switch or stack master must be running the IP services feature set.
EIGRP Nonstop Forwarding
The switch stack supports two levels of EIGRP nonstop forwarding:
EIGRP NSF Awareness
EIGRP NSF Capability
EIGRP NSF Awareness
The IP-services feature set supports EIGRP NSF Awareness for IPv4. When the neighboring router is NSF-capable, the Layer 3
switch continues to forward packets from the neighboring router during the interval between the primary Route Processor (RP)
in a router failing and the backup RP taking over, or while the primary RP is manually reloaded for a nondisruptive software
upgrade.
This feature cannot be disabled. For more information on this feature, see the “EIGRP Nonstop Forwarding (NSF) Awareness”
section of the Cisco IOS IP Routing Protocols Configuration Guide, Release 12.4.
EIGRP NSF Capability
The IP services feature set supports EIGRP Cisco NSF routing to speed up convergence and to eliminate traffic loss after a
stack master change. For details about this NSF capability, see the “Configuring Nonstop Forwarding” chapter in the High Availability Configuration Guide, Cisco IOS XE Release 3S: http://www.cisco.com/en/US/docs/ios/ios_xe/ha/configuration/guide/ha-nonstp_fwdg_xe.html.
The IP-services feature set also supports EIGRP NSF-capable routing for IPv4 for better convergence and lower traffic loss
following a stack master change. When an EIGRP NSF-capable stack master restarts or a new stack master starts up and NSF restarts,
the switch has no neighbors, and the topology table is empty. The switch must bring up the interfaces, reacquire neighbors,
and rebuild the topology and routing tables without interrupting the traffic directed toward the switch stack. EIGRP peer
routers maintain the routes learned from the new stack master and continue forwarding traffic through the NSF restart process.
To prevent an adjacency reset by the neighbors, the new stack master uses a new Restart (RS) bit in the EIGRP packet header
to show the restart. When the neighbor receives this, it synchronizes the stack in its peer list and maintains the adjacency
with the stack. The neighbor then sends its topology table to the stack master with the RS bit set to show that it is NSF-aware
and is aiding the new stack master.
If at least one of the stack peer neighbors is NSF-aware, the stack master receives updates and rebuilds its database. Each
NSF-aware neighbor sends an end of table (EOT) marker in the last update packet to mark the end of the table content. The
stack master recognizes the convergence when it receives the EOT marker, and it then begins sending updates. When the stack
master has received all EOT markers from its neighbors or when the NSF converge timer expires, EIGRP notifies the routing
information database (RIB) of convergence and floods its topology table to all NSF-aware peers.
EIGRP Stub Routing
The EIGRP stub routing feature, available in all feature sets, reduces resource utilization by moving routed traffic closer
to the end user.
Note
The IP base feature set contains EIGRP stub routing capability, which only advertises connected or summary routes from the
routing tables to other switches in the network. The switch uses EIGRP stub routing at the access layer to eliminate the need
for other types of routing advertisements. For enhanced capability and complete EIGRP routing, the switch must be running
the IP services feature set. On a switch running the IP base feature set, if you try to configure multi-VRF-CE and EIGRP stub
routing at the same time, the configuration is not allowed. IPv6 EIGRP stub routing is not supported with the IP base feature
set.
In a network using EIGRP stub routing, the only allowable route for IP traffic to the user is through a switch that is configured
with EIGRP stub routing. The switch sends the routed traffic to interfaces that are configured as user interfaces or are connected
to other devices.
When using EIGRP stub routing, you need to configure the distribution and remote routers to use EIGRP and to configure only
the switch as a stub. Only specified routes are propagated from the switch. The switch responds to all queries for summaries,
connected routes, and routing updates.
Any neighbor that receives a packet informing it of the stub status does not query the stub router for any routes, and a router
that has a stub peer does not query that peer. The stub router depends on the distribution router to send the proper updates
to all peers.
In Figure 41-4, switch B is configured as an EIGRP stub router. Switches A and C are connected to the rest of the WAN. Switch
B advertises connected, static, redistribution, and summary routes to switch A and C. Switch B does not advertise any routes
learned from switch A (and the reverse).
For more information about EIGRP stub routing, see “Configuring EIGRP Stub Routing” section of the Cisco IOS IP Configuration Guide, Volume 2 of 3: Routing Protocols, Release 12.4.
How to Configure EIGRP
To create an EIGRP routing process, you must enable EIGRP and associate networks. EIGRP sends updates to the interfaces in
the specified networks. If you do not specify an interface network, it is not advertised in any EIGRP update.
Note
If you have routers on your network that are configured for IGRP, and you want to change to EIGRP, you must designate transition
routers that have both IGRP and EIGRP configured. In these cases, perform Steps 1 through 3 in the next section and also see
the “Configuring Split Horizon” section. You must use the same AS number for routes to be automatically redistributed.
Default EIGRP Configuration
Table 7. Default EIGRP
Configuration
Feature
Default Setting
Auto summary
Disabled.
Default-information
Exterior routes are accepted
and default information is passed between EIGRP processes when doing
redistribution.
Default metric
Only connected routes and
interface static routes can be redistributed without a default metric. The
metric includes:
Bandwidth: 0 or greater kb/s.
Delay (tens of microseconds):
0 or any positive number that is a multiple of 39.1 nanoseconds.
Reliability: any number
between 0 and 255 (255 means 100 percent reliability).
Loading: effective bandwidth
as a number between 0 and 255 (255 is 100 percent loading).
MTU: maximum transmission
unit size of the route in bytes. 0 or any positive integer.
Distance
Internal distance: 90.
External distance: 170.
EIGRP log-neighbor changes
Disabled. No adjacency
changes logged.
IP authentication key-chain
No authentication provided.
IP authentication mode
No authentication provided.
IP bandwidth-percent
50 percent.
IP hello interval
For low-speed nonbroadcast
multiaccess (NBMA) networks: 60 seconds; all other networks: 5 seconds.
IP hold-time
For low-speed NBMA networks:
180 seconds; all other networks: 15 seconds.
IP split-horizon
Enabled.
IP summary address
No summary aggregate
addresses are predefined.
Metric weights
tos: 0; k1 and k3: 1; k2, k4,
and k5: 0
Network
None specified.
Nonstop Forwarding (NSF)
Awareness
Enabled for IPv4 on switches
running the IP services feature set. Allows Layer 3 switches to continue
forwarding packets from a neighboring NSF-capable router during hardware or
software changes.
NSF capability
Disabled.
Note
The switch supports EIGRP
NSF-capable routing for IPv4.
Offset-list
Disabled.
Router EIGRP
Disabled.
Set metric
No metric set in the route
map.
Traffic-share
Distributed proportionately
to the ratios of the metrics.
Variance
1 (equal-cost
load-balancing).
Configuring Basic EIGRP Parameters
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
router
eigrp autonomous-system
Example:
Device(config)# router eigrp 10
Enables an EIGRP
routing process, and enter router configuration mode. The AS number identifies
the routes to other EIGRP routers and is used to tag routing information.
Step 3
nsf
Example:
Device(config)# nsf
(Optional)
Enables EIGRP NSF. Enter this command on the stack master and on all of its
peers.
Step 4
network network-number
Example:
Device(config)# network 192.168.0.0
Associate
networks with an EIGRP routing process. EIGRP sends updates to the interfaces
in the specified networks.
Step 5
eigrp
log-neighbor-changes
Example:
Device(config)# eigrp log-neighbor-changes
(Optional)
Enables logging of EIGRP neighbor changes to monitor routing system stability.
Step 6
metric
weightstos k1 k2 k3 k4
k5
Example:
Device(config)# metric weights 0 2 0 2 0 0
(Optional) Adjust
the EIGRP metric. Although the defaults have been carefully set to provide
excellent operation in most networks, you can adjust them.
Setting metrics
is complex and is not recommended without guidance from an experienced network
designer.
(Optional)
Applies an offset list to routing metrics to increase incoming and outgoing
metrics to routes learned through EIGRP. You can limit the offset list with an
access list or an interface.
Step 8
auto-summary
Example:
Device(config)# auto-summary
(Optional)
Enables automatic summarization of subnet routes into network-level routes.
Step 9
ip
summary-address eigrpautonomous-system-number
address mask
Example:
Device(config)# ip summary-address eigrp 1 192.168.0.0 255.255.0.0
(Optional)
Configures a summary aggregate.
Step 10
end
Example:
Device(config)# end
Returns to
privileged EXEC mode.
Step 11
show ip
protocols
Example:
Device# show ip protocols
Verifies your
entries.
For NSF
awareness, the output shows:
*** IP Routing is NSF aware
*** EIGRP NSF enabled
Step 12
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional)
Saves your entries in the configuration file.
Configuring EIGRP Interfaces
Other optional EIGRP parameters can be
configured on an interface basis.
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
interface interface-id
Example:
Device(config)# interface gigabitethernet 1/0/1
Enters interface
configuration mode, and specifies the Layer 3 interface to configure.
Step 3
ip
bandwidth-percent eigrppercent
Example:
Device(config-if)# ip bandwidth-percent eigrp 60
(Optional)
Configures the percentage of bandwidth that can be used by EIGRP on an
interface. The default is 50 percent.
Step 4
ip
summary-address eigrpautonomous-system-number
address mask
Example:
Device(config-if)# ip summary-address eigrp 109 192.161.0.0 255.255.0.0
(Optional)
Configures a summary aggregate address for a specified interface (not usually
necessary if auto-summary is enabled).
Step 5
ip hello-interval
eigrpautonomous-system-number
seconds
Example:
Device(config-if)# ip hello-interval eigrp 109 10
(Optional) Change
the hello time interval for an EIGRP routing process. The range is 1 to 65535
seconds. The default is 60 seconds for low-speed NBMA networks and 5 seconds
for all other networks.
Step 6
ip hold-time
eigrpautonomous-system-number
seconds
Example:
Device(config-if)# ip hold-time eigrp 109 40
(Optional) Change
the hold time interval for an EIGRP routing process. The range is 1 to 65535
seconds. The default is 180 seconds for low-speed NBMA networks and 15 seconds
for all other networks.
Do not adjust the
hold time without consulting Cisco technical support.
Step 7
no ip
split-horizon eigrpautonomous-system-number
Example:
Device(config-if)# no ip split-horizon eigrp 109
(Optional)
Disables split horizon to allow route information to be advertised by a router
out any interface from which that information originated.
Step 8
end
Example:
Device(config-if)# end
Returns to
privileged EXEC mode.
Step 9
show ip eigrp
interface
Example:
Device# show ip eigrp interface
Displays which
interfaces EIGRP is active on and information about EIGRP relating to those
interfaces.
Step 10
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional) Saves
your entries in the configuration file.
Configuring EIGRP Route Authentication
EIGRP route authentication
provides MD5 authentication of routing updates from the EIGRP routing protocol
to prevent the introduction of unauthorized or false routing messages from
unapproved sources.
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
interface interface-id
Example:
Device(config)# interface gigabitethernet 1/0/1
Enters interface
configuration mode, and specifies the Layer 3 interface to configure.
Step 3
ip authentication
mode eigrpautonomous-system
md5
Example:
Device(config-if)# ip authentication mode eigrp 104 md5
Enables MD5
authentication in IP EIGRP packets.
Step 4
ip authentication
key-chain eigrp autonomous-system
key-chain
Example:
Device(config-if)# ip authentication key-chain eigrp 105 chain1
Enables
authentication of IP EIGRP packets.
Step 5
exit
Example:
Device(config-if)# exit
Returns to global
configuration mode.
Step 6
key
chain name-of-chain
Example:
Device(config)# key chain chain1
Identify a key
chain and enter key-chain configuration mode. Match the name configured in Step
4.
Step 7
keynumber
Example:
Device(config-keychain)# key 1
In key-chain
configuration mode, identify the key number.
Step 8
key-stringtext
Example:
Device(config-keychain-key)# key-string key1
In key-chain key
configuration mode, identify the key string.
Device(config-keychain-key)# accept-lifetime 13:30:00 Jan 25 2011 duration 7200
(Optional)
Specifies the time period during which the key can be received.
The start-time and
end-time syntax can be either
hh:mm:ss Month date year or
hh:mm:ss date Month year. The default is forever
with the default
start-time and the earliest acceptable date as
January 1, 1993. The default
end-time and
duration is
infinite.
Device(config-keychain-key)# send-lifetime 14:00:00 Jan 25 2011 duration 3600
(Optional)
Specifies the time period during which the key can be sent.
The start-time and
end-time
syntax can be either
hh:mm:ss Month date
year or
hh:mm:ss date Month
year. The default is forever with the default
start-time
and the earliest acceptable date as January 1, 1993. The default
end-time and
duration is
infinite.
Step 11
end
Example:
Device(config-keychain-key)# exit
Returns to
privileged EXEC mode.
Step 12
show key
chain
Example:
Device# show key chain
Displays
authentication key information.
Step 13
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional)
Saves your entries in the configuration file.
Monitoring and Maintaining EIGRP
You can delete neighbors from the neighbor table. You can also display various EIGRP routing statistics. Table 41-8 lists
the privileged EXEC commands for deleting neighbors and displaying statistics. For explanations of fields in the resulting
display, see the Cisco IOS IP Command Reference, Volume 2 of 3: Routing Protocols, Release 12.4.
Table 8. IP EIGRP Clear and Show Commands
clear ip eigrp neighbors [if-address | interface]
Deletes neighbors from the neighbor table.
show ip eigrp interface [interface] [as number]
Displays information about interfaces configured for EIGRP.
show ip eigrp neighbors [type-number]
Displays EIGRP discovered neighbors.
show ip eigrp topology [autonomous-system-number] | [[ip-address] mask]]
Displays the EIGRP topology table for a given process.
show ip eigrp traffic [autonomous-system-number]
Displays the number of packets sent and received for all or a specified EIGRP process.
Information About BGP
The Border Gateway Protocol (BGP) is an exterior
gateway protocol used to set up an interdomain routing system that guarantees
the loop-free exchange of routing information between autonomous systems.
Autonomous systems are made up of routers that operate under the same
administration and that run Interior Gateway Protocols (IGPs), such as RIP or
OSPF, within their boundaries and that interconnect by using an Exterior
Gateway Protocol (EGP). BGP Version 4 is the standard EGP for interdomain
routing in the Internet. The protocol is defined in RFCs 1163, 1267, and 1771.
You can find detailed information about BGP in
Internet Routing
Architectures,
published by Cisco Press, and in the “Configuring BGP” chapter in the
Cisco IP and IP Routing
Configuration Guide.
For details about BGP
commands and keywords, see the “IP Routing Protocols” part of the
Cisco IOS IP Command
Reference, Volume 2 of 3: Routing Protocols
.
BGP Network Topology
Routers that belong to the same autonomous system (AS) and that exchange BGP updates run internal BGP (IBGP), and routers
that belong to different autonomous systems and that exchange BGP updates run external BGP (EBGP). Most configuration commands
are the same for configuring EBGP and IBGP. The difference is that the routing updates are exchanged either between autonomous
systems (EBGP) or within an AS (IBGP). Figure 41-5 shows a network that is running both EBGP and IBGP.
Before exchanging information with an external AS, BGP ensures that networks within the AS can be reached by defining internal
BGP peering among routers within the AS and by redistributing BGP routing information to IGPs that run within the AS, such
as IGRP and OSPF.
Routers that run a BGP routing process are often referred to as BGP speakers. BGP uses the Transmission Control Protocol (TCP)
as its transport protocol (specifically port 179). Two BGP speakers that have a TCP connection to each other for exchanging
routing information are known as peers or neighbors. In Figure 41-5, Routers A and B are BGP peers, as are Routers B and C
and Routers C and D. The routing information is a series of AS numbers that describe the full path to the destination network.
BGP uses this information to construct a loop-free map of autonomous systems.
The network has these characteristics:
Routers A and B are running EBGP, and Routers B and C are running IBGP. Note that the EBGP peers are directly connected and
that the IBGP peers are not. As long as there is an IGP running that allows the two neighbors to reach one another, IBGP peers
do not have to be directly connected.
All BGP speakers within an AS must establish a peer relationship with each other. That is, the BGP speakers within an AS must
be fully meshed logically. BGP4 provides two techniques that reduce the requirement for a logical full mesh: confederations
and route reflectors.
AS 200 is a transit AS for AS 100 and AS 300—that is, AS 200 is used to transfer packets between AS 100 and AS 300.
BGP peers initially exchange their full BGP routing tables and then send only incremental updates. BGP peers also exchange
keepalive messages (to ensure that the connection is up) and notification messages (in response to errors or special conditions).
In BGP, each route consists of a network number, a list of autonomous systems that information has passed through (the autonomous
system path), and a list of other path attributes. The primary function of a BGP system is to exchange network reachability
information, including information about the list of AS paths, with other BGP systems. This information can be used to determine
AS connectivity, to prune routing loops, and to enforce AS-level policy decisions.
A router or switch running Cisco IOS does not select or use an IBGP route unless it has a route available to the next-hop
router and it has received synchronization from an IGP (unless IGP synchronization is disabled). When multiple routes are
available, BGP bases its path selection on attribute values. See the “Configuring BGP Decision Attributes” section for information
about BGP attributes.
BGP Version 4 supports classless interdomain routing (CIDR) so you can reduce the size of your routing tables by creating
aggregate routes, resulting in supernets. CIDR eliminates the concept of network classes within BGP and supports the advertising
of IP prefixes.
Nonstop Forwarding Awareness
The BGP NSF Awareness feature is supported for IPv4 in the IP services feature set. To enable this feature with BGP routing,
you need to enable Graceful Restart. When the neighboring router is NSF-capable, and this feature is enabled, the Layer 3
switch continues to forward packets from the neighboring router during the interval between the primary Route Processor (RP)
in a router failing and the backup RP taking over, or while the primary RP is manually reloaded for a nondisruptive software
upgrade.
For more information, see the “BGP Nonstop Forwarding (NSF) Awareness” section of the Cisco IOS IP Routing Protocols Configuration Guide, Release 12.4.
Information About BGP Routing
To enable BGP routing, you establish a BGP routing process and define the local network. Because BGP must completely recognize
the relationships with its neighbors, you must also specify a BGP neighbor.
BGP supports two kinds of neighbors: internal and external. Internal neighbors are in the same AS; external neighbors are
in different autonomous systems. External neighbors are usually adjacent to each other and share a subnet, but internal neighbors
can be anywhere in the same AS.
The switch supports the use of private AS numbers, usually assigned by service providers and given to systems whose routes
are not advertised to external neighbors. The private AS numbers are from 64512 to 65535. You can configure external neighbors
to remove private AS numbers from the AS path by using the neighbor remove-private-as router configuration command. Then when an update is passed to an external neighbor, if the AS path includes private AS numbers,
these numbers are dropped.
If your AS will be passing traffic through it from another AS to a third AS, it is important to be consistent about the routes
it advertises. If BGP advertised a route before all routers in the network had learned about the route through the IGP, the
AS might receive traffic that some routers could not yet route. To prevent this from happening, BGP must wait until the IGP
has propagated information across the AS so that BGP is synchronized with the IGP. Synchronization is enabled by default.
If your AS does not pass traffic from one AS to another AS, or if all routers in your autonomous systems are running BGP,
you can disable synchronization, which allows your network to carry fewer routes in the IGP and allows BGP to converge more
quickly.
Routing Policy Changes
Routing policies for a peer include all the configurations that might affect inbound or outbound routing table updates. When
you have defined two routers as BGP neighbors, they form a BGP connection and exchange routing information. If you later change
a BGP filter, weight, distance, version, or timer, or make a similar configuration change, you must reset the BGP sessions
so that the configuration changes take effect.
There are two types of reset, hard reset and soft reset. Cisco IOS Releases 12.1 and later support a soft reset without any
prior configuration. To use a soft reset without preconfiguration, both BGP peers must support the soft route refresh capability,
which is advertised in the OPEN message sent when the peers establish a TCP session. A soft reset allows the dynamic exchange
of route refresh requests and routing information between BGP routers and the subsequent re-advertisement of the respective
outbound routing table.
When soft reset generates inbound updates from a neighbor, it is called dynamic inbound soft reset.
When soft reset sends a set of updates to a neighbor, it is called outbound soft reset.
A soft inbound reset causes the new inbound policy to take effect. A soft outbound reset causes the new local outbound policy
to take effect without resetting the BGP session. As a new set of updates is sent during outbound policy reset, a new inbound
policy can also take effect.
Table 41-10 lists the advantages and disadvantages hard reset and soft reset.
Table 9. Advantages and Disadvantages of Hard and Soft Resets
Type of Reset
Advantages
Disadvantages
Hard reset
No memory overhead
The prefixes in the BGP, IP, and FIB tables provided by the neighbor are lost. Not recommended.
Outbound soft reset
No configuration, no storing of routing table updates
Does not reset inbound routing table updates.
Dynamic inbound soft reset
Does not clear the BGP session and cache
Does not require storing of routing table updates and has no memory overhead
Both BGP routers must support the route refresh capability (in Cisco IOS Release 12.1 and later).
BGP Decision Attributes
When a BGP speaker receives updates from multiple autonomous systems that describe different paths to the same destination,
it must choose the single best path for reaching that destination. When chosen, the selected path is entered into the BGP
routing table and propagated to its neighbors. The decision is based on the value of attributes that the update contains and
other BGP-configurable factors.
When a BGP peer learns two EBGP paths for a prefix from a neighboring AS, it chooses the best path and inserts that path in
the IP routing table. If BGP multipath support is enabled and the EBGP paths are learned from the same neighboring autonomous
systems, instead of a single best path, multiple paths are installed in the IP routing table. Then, during packet switching,
per-packet or per-destination load-balancing is performed among the multiple paths. The maximum-paths router configuration command controls the number of paths allowed.
These factors summarize the order in which BGP evaluates the attributes for choosing the best path:
If the path specifies a next hop that is inaccessible, drop the update. The BGP next-hop attribute, automatically determined
by the software, is the IP address of the next hop that is going to be used to reach a destination. For EBGP, this is usually
the IP address of the neighbor specified by the neighbor remote-as router configuration command. You can disable next-hop processing by using route maps or the neighbor next-hop-self router configuration command.
Prefer the path with the largest weight (a Cisco proprietary parameter). The weight attribute is local to the router and not
propagated in routing updates. By default, the weight attribute is 32768 for paths that the router originates and zero for
other paths. Routes with the largest weight are preferred. You can use access lists, route maps, or the neighbor weight router configuration command to set weights.
Prefer the route with the highest local preference. Local preference is part of the routing update and exchanged among routers
in the same AS. The default value of the local preference attribute is 100. You can set local preference by using the bgp default local-preference router configuration command or by using a route map.
Prefer the route that was originated by BGP running on the local router.
Prefer the route with the shortest AS path.
Prefer the route with the lowest origin type. An interior route or IGP is lower than a route learned by EGP, and an EGP-learned
route is lower than one of unknown origin or learned in another way.
Prefer the route with the lowest multi -exit discriminator (MED) metric attribute if the neighboring AS is the same for all
routes considered. You can configure the MED by using route maps or by using the default-metric router configuration command. When an update is sent to an IBGP peer, the MED is included.
Prefer the external (EBGP) path over the internal (IBGP) path.
Prefer the route that can be reached through the closest IGP neighbor (the lowest IGP metric). This means that the router
will prefer the shortest internal path within the AS to reach the destination (the shortest path to the BGP next-hop).
If the following conditions are all true, insert the route for this path into the IP routing table:
Both the best route and this route are external.
Both the best route and this route are from the same neighboring autonomous system.
maximum-paths is enabled.
If multipath is not enabled, prefer the route with the lowest IP address value for the BGP router ID. The router ID is usually
the highest IP address on the router or the loopback (virtual) address, but might be implementation-specific.
Route Maps
Within BGP, route maps can be used to control and to modify routing information and to define the conditions by which routes
are redistributed between routing domains. See the “Using Route Maps to Redistribute Routing Information” section on page 41-124
for more information about route maps. Each route map has a name that identifies the route map (map tag) and an optional sequence number.
BGP Filtering
You can filter BGP advertisements by using AS-path filters, such as the as-path access-list global configuration command and the neighbor filter-list router configuration command. You can also use access lists with the neighbor distribute-list router configuration command. Distribute-list filters are applied to network numbers. See the “Controlling Advertising and
Processing in Routing Updates” section on page 41-135 for information about the distribute-list command.
You can use route maps on a per-neighbor basis to filter updates and to modify various attributes. A route map can be applied
to either inbound or outbound updates. Only the routes that pass the route map are sent or accepted in updates. On both inbound
and outbound updates, matching is supported based on AS path, community, and network numbers. Autonomous system path matching
requires the match as-path access-list route-map command, community based matching requires the match community-list route-map command, and network-based matching requires the ip access-list global configuration command.
Prefix List for BGP Filtering
You can use prefix lists as an alternative to access lists in many BGP route filtering commands, including the neighbor distribute-list router configuration command. The advantages of using prefix lists include performance improvements in loading and lookup
of large lists, incremental update support, easier CLI configuration, and greater flexibility.
Filtering by a prefix list involves matching the prefixes of routes with those listed in the prefix list, as when matching
access lists. When there is a match, the route is used. Whether a prefix is permitted or denied is based upon these rules:
An empty prefix list permits all prefixes.
An implicit deny is assumed if a given prefix does not match any entries in a prefix list.
When multiple entries of a prefix list match a given prefix, the sequence number of a prefix list entry identifies the entry
with the lowest sequence number.
By default, sequence numbers are generated automatically and incremented in units of five. If you disable the automatic generation
of sequence numbers, you must specify the sequence number for each entry. You can specify sequence values in any increment.
If you specify increments of one, you cannot insert additional entries into the list; if you choose very large increments,
you might run out of values.
BGP Community Filtering
One way that BGP controls the distribution of routing information based on the value of the COMMUNITIES attribute. The attribute
is a way to groups destinations into communities and to apply routing decisions based on the communities. This method simplifies
configuration of a BGP speaker to control distribution of routing information.
A community is a group of destinations that share some common attribute. Each destination can belong to multiple communities.
AS administrators can define to which communities a destination belongs. By default, all destinations belong to the general
Internet community. The community is identified by the COMMUNITIES attribute, an optional, transitive, global attribute in
the numerical range from 1 to 4294967200. These are some predefined, well-known communities:
internet—Advertise this route to the Internet community. All routers belong to it.
no-export—Do not advertise this route to EBGP peers.
no-advertise—Do not advertise this route to any peer (internal or external).
local-as—Do not advertise this route to peers outside the local autonomous system.
Based on the community, you can control which routing information to accept, prefer, or distribute to other neighbors. A BGP
speaker can set, append, or modify the community of a route when learning, advertising, or redistributing routes. When routes
are aggregated, the resulting aggregate has a COMMUNITIES attribute that contains all communities from all the initial routes.
You can use community lists to create groups of communities to use in a match clause of a route map. As with an access list,
a series of community lists can be created. Statements are checked until a match is found. As soon as one statement is satisfied,
the test is concluded.
To set the COMMUNITIES attribute and match clauses based on communities, see the match community-list and set community route-map configuration commands in the “Using Route Maps to Redistribute Routing Information” section.
BGP Neighbors and Peer Groups
Often many BGP neighbors are configured with the same update policies (that is, the same outbound route maps, distribute lists,
filter lists, update source, and so on). Neighbors with the same update policies can be grouped into peer groups to simplify
configuration and to make updating more efficient. When you have configured many peers, we recommend this approach.
To configure a BGP peer group, you create the peer group, assign options to the peer group, and add neighbors as peer group
members. You configure the peer group by using the neighbor router configuration commands. By default, peer group members inherit all the configuration options of the peer group, including
the remote-as (if configured), version, update-source, out-route-map, out-filter-list, out-dist-list, minimum-advertisement-interval,
and next-hop-self. All peer group members also inherit changes made to the peer group. Members can also be configured to override
the options that do not affect outbound updates.
Aggregate Routes
Classless interdomain routing (CIDR) enables you to create aggregate routes (or supernets) to minimize the size of routing
tables. You can configure aggregate routes in BGP either by redistributing an aggregate route into BGP or by creating an aggregate
entry in the BGP routing table. An aggregate address is added to the BGP table when there is at least one more specific entry
in the BGP table.
Routing Domain Confederations
One way to reduce the IBGP mesh is to divide an autonomous system into multiple subautonomous systems and to group them into
a single confederation that appears as a single autonomous system. Each autonomous system is fully meshed within itself and
has a few connections to other autonomous systems in the same confederation. Even though the peers in different autonomous
systems have EBGP sessions, they exchange routing information as if they were IBGP peers. Specifically, the next hop, MED,
and local preference information is preserved. You can then use a single IGP for all of the autonomous systems.
BGP Route Reflectors
BGP requires that all of the IBGP speakers be fully meshed. When a router receives a route from an external neighbor, it must
advertise it to all internal neighbors. To prevent a routing information loop, all IBPG speakers must be connected. The internal
neighbors do not send routes learned from internal neighbors to other internal neighbors.
With route reflectors, all IBGP speakers need not be fully meshed because another method is used to pass learned routes to
neighbors. When you configure an internal BGP peer to be a route reflector, it is responsible for passing IBGP learned routes
to a set of IBGP neighbors. The internal peers of the route reflector are divided into two groups: client peers and nonclient
peers (all the other routers in the autonomous system). A route reflector reflects routes between these two groups. The route
reflector and its client peers form a cluster. The nonclient peers must be fully meshed with each other, but the client peers
need not be fully meshed. The clients in the cluster do not communicate with IBGP speakers outside their cluster.
When the route reflector receives an advertised route, it takes one of these actions, depending on the neighbor:
A route from an external BGP speaker is advertised to all clients and nonclient peers.
A route from a nonclient peer is advertised to all clients.
A route from a client is advertised to all clients and nonclient peers. Hence, the clients need not be fully meshed.
Usually a cluster of clients have a single route reflector, and the cluster is identified by the route reflector router ID.
To increase redundancy and to avoid a single point of failure, a cluster might have more than one route reflector. In this
case, all route reflectors in the cluster must be configured with the same 4-byte cluster ID so that a route reflector can
recognize updates from route reflectors in the same cluster. All the route reflectors serving a cluster should be fully meshed
and should have identical sets of client and nonclient peers.
Route Dampening
Route flap dampening is a BGP feature designed to minimize the propagation of flapping routes across an internetwork. A route
is considered to be flapping when it is repeatedly available, then unavailable, then available, then unavailable, and so on.
When route dampening is enabled, a numeric penalty value is assigned to a route when it flaps. When a route’s accumulated
penalties reach a configurable limit, BGP suppresses advertisements of the route, even if the route is running. The reuse
limit is a configurable value that is compared with the penalty. If the penalty is less than the reuse limit, a suppressed
route that is up is advertised again.
Dampening is not applied to routes that are learned by IBGP. This policy prevents the IBGP peers from having a higher penalty
for routes external to the AS.
More BGP Information
For detailed descriptions of
BGP configuration, see the “Configuring BGP” chapter in the “IP Routing
Protocols” part of the
Cisco IOS IP Configuration
Guide, Release 12.4. For details about specific commands, see the
Cisco IOS IP Command
Reference, Volume 2 of 3: Routing Protocols, Release 12.4.
How to Configure BGP
Default BGP Configuration
Table 41-9 shows the basic default
BGP configuration. For the defaults for all characteristics, see the specific
commands in the
Cisco IOS IP Command
Reference, Volume 2 of 3: Routing Protocols, Release 12.4.
Table 10. Default BGP
Configuration
Feature
Default Setting
Aggregate address
Disabled: None defined.
AS path access list
None defined.
Auto summary
Disabled.
Best path
The router considers
as-path in choosing a route and does not compare
similar routes from external BGP peers.
Compare router ID: Disabled.
BGP community list
Number: None defined. When
you permit a value for the community number, the list defaults to an implicit
deny for everything else that has not been permitted.
Format: Cisco default format
(32-bit number).
BGP confederation
identifier/peers
Identifier: None configured.
Peers: None identified.
BGP Fast external fallover
Enabled.
BGP local preference
100. The range is 0 to
4294967295 with the higher value preferred.
BGP network
None specified; no backdoor
route advertised.
BGP route dampening
Disabled by default. When
enabled:
Half-life is 15 minutes.
Re-use is 750 (10-second
increments).
Suppress is 2000 (10-second
increments).
Max-suppress-time is 4 times
half-life; 60 minutes.
BGP router ID
The IP address of a loopback
interface if one is configured or the highest IP address configured for a
physical interface on the router.
Default information originate
(protocol or network redistribution)
Disabled.
Default metric
Built-in, automatic metric
translations.
Distance
External route administrative
distance: 20 (acceptable values are from 1 to 255).
Internal route administrative
distance: 200 (acceptable values are from 1 to 255).
Local route administrative
distance: 200 (acceptable values are from 1 to 255).
Distribute list
In (filter networks received
in updates): Disabled.
Out (suppress networks from
being advertised in updates): Disabled.
Internal route redistribution
Disabled.
IP prefix list
None defined.
Multi exit discriminator
(MED)
Always compare: Disabled.
Does not compare MEDs for paths from neighbors in different autonomous systems.
Best path compare: Disabled.
MED missing as worst path:
Disabled.
Deterministic MED comparison
is disabled.
Neighbor
Advertisement interval: 30
seconds for external peers; 5 seconds for internal peers.
Change logging: Enabled.
Conditional advertisement:
Disabled.
Default originate: No default
route is sent to the neighbor.
Description: None.
Distribute list: None
defined.
External BGP multihop: Only
directly connected neighbors are allowed.
Filter list: None used.
Maximum number of prefixes
received: No limit.
Next hop (router as next hop
for BGP neighbor): Disabled.
Password: Disabled.
Peer group: None defined;
no members assigned.
Prefix list: None
specified.
Remote AS (add entry to
neighbor BGP table): No peers defined.
Private AS number removal:
Disabled.
Route maps: None applied to
a peer.
Send community attributes:
None sent to neighbors.
Disabled2. If enabled, allows Layer 3 switches to
continue forwarding packets from a neighboring NSF-capable router during
hardware or software changes.
Route reflector
None configured.
Synchronization (BGP and
IGP)
Disabled.
Table map update
Disabled.
Timers
Keepalive: 60 seconds;
holdtime: 180 seconds.
1 Nonstop
Forwarding
2 NSF Awareness
can be enabled for IPv4 on switches with the IP services feature set by
enabling Graceful Restart.
Enabling BGP Routing
Before you begin
Note
To enable BGP, the switch or
stack master must be running the IP services feature set.
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
ip
routing
Example:
Device(config)# ip routing
Enables IP
routing.
Step 3
router bgpautonomous-system
Example:
Device(config)# router bgp 45000
Enables a BGP
routing process, assign it an AS number, and enter router configuration mode.
The AS number can be from 1 to 65535, with 64512 to 65535 designated as private
autonomous numbers.
(Optional)
Removes private AS numbers from the AS-path in outbound routing updates.
Step 7
synchronization
Example:
Device(config)# synchronization
(Optional)
Enables synchronization between BGP and an IGP.
Step 8
auto-summary
Example:
Device(config)# auto-summary
(Optional)
Enables automatic network summarization. When a subnet is redistributed from an
IGP into BGP, only the network route is inserted into the BGP table.
Step 9
bgp
graceful-restart
Example:
Device(config)# bgp graceful-start
(Optional)
Enables NSF awareness on switch. By default, NSF awareness is disabled.
Step 10
end
Example:
Device(config)# end
Returns to
privileged EXEC mode.
Step 11
show ip bgp
networknetwork-number
Example:
Device# show ip bgp network 10.108.0.0
Verifies the
configuration.
Step 12
show ip bgp
neighbor
Example:
Device# show ip bgp neighbor
Verifies that
NSF awareness (Graceful Restart) is enabled on the neighbor.
If NSF
awareness is enabled on the switch and the neighbor, this message appears:
Graceful
Restart Capability: advertised and received
If NSF
awareness is enabled on the switch, but not on the neighbor, this message
appears:
Graceful
Restart Capability: advertised
Step 13
copy
running-config startup-config
Example:
Device# copy running-config startup-config
(Optional)
Saves your entries in the configuration file.
Managing Routing Policy Changes
To learn if a BGP peer
supports the route refresh capability and to reset the BGP session:
Procedure
Command or Action
Purpose
Step 1
show ip bgp
neighbors
Example:
Device# show ip bgp neighbors
Displays whether
a neighbor supports the route refresh capability. When supported, this message
appears for the router:
Received route refresh capability from peer.
Step 2
clear ip bgp {* |
address |
peer-group-name}
Example:
Device# clear ip bgp *
Resets the
routing table on the specified connection.
Enter an asterisk
(*) to specify that all connections be reset.
Enter an IP
address to specify the connection to be reset.
Enter a peer
group name to reset the peer group.
Step 3
clear ip bgp {* |
address |
peer-group-name}
soft out
Example:
Device# clear ip bgp * soft out
(Optional)
Performs an outbound soft reset to reset the inbound routing table on the
specified connection. Use this command if route refresh is supported.
Enter an asterisk
(*) to specify that all connections be reset.
Enter an IP
address to specify the connection to be reset.
Enter a peer
group name to reset the peer group.
Step 4
show ip
bgp
Example:
Device# show ip bgp
Verifies the
reset by checking information about the routing table and about BGP neighbors.
Step 5
show ip bgp
neighbors
Example:
Device# show ip bgp neighbors
Verifies the
reset by checking information about the routing table and about BGP neighbors.
Configuring BGP Decision Attributes
Procedure
Command or Action
Purpose
Step 1
configure
terminal
Example:
Device# configure terminal
Enters global
configuration mode.
Step 2
router bgpautonomous-system
Example:
Device(config)# router bgp 4500
Enables a BGP
routing process, assign it an AS number, and enter router configuration mode.
(Optional) Assign
a weight to a neighbor connection. Acceptable values are from 0 to 65535; the
largest weight is the preferred route. Routes learned through another BGP peer
have a default weight of 0; routes sourced by the local router have a default
weight of 32768.
Step 6
default-metricnumber
Example:
Device(config-router)# default-metric 300
(Optional) Sets a
MED metric to set preferred paths to external neighbors. All routes without a
MED will also be set to this value. The range is 1 to 4294967295. The lowest
value is the most desirable.
Step 7
bgp bestpath med
missing-as-worst
Example:
Device(config-router)# bgp bestpath med missing-as-worst
(Optional)
Configures the switch to consider a missing MED as having a value of infinity,
making the path without a MED value the least desirable path.
Step 8
bgp
always-compare med
Example:
Device(config-router)# bgp always-compare-med
(Optional)
Configures the switch to compare MEDs for paths from neighbors in different
autonomous systems. By default, MED comparison is only done among paths in the
same AS.
Step 9
bgp bestpath med
confed
Example:
Device(config-router)# bgp bestpath med confed
(Optional)
Configures the switch to consider the MED in choosing a path from among those
advertised by different subautonomous systems within a confederation.
Step 10
bgp deterministic
med
Example:
Device(config-router)# bgp deterministic med
(Optional)
Configures the switch to consider the MED variable when choosing among routes
advertised by different peers in the same AS.
(Optional) Change
the default local preference value. The range is 0 to 4294967295; the default
value is 100. The highest local preference value is preferred.
Step 12
maximum-pathsnumber
Example:
Device(config-router)# maximum-paths 8
(Optional)
Configures the number of paths to be added to the IP routing table. The default
is to only enter the best path in the routing table. The range is from 1 to 16.
Having multiple paths allows load-balancing among the paths. (Although the
switch software allows a maximum of 32 equal-cost routes, the switch hardware
will never use more than 16 paths per route.)
Step 13
end
Example:
Device(config-router)# end
Returns to
privileged EXEC mode.
Step 14
show ip
bgp
Example:
Device# show ip bgp
Verifies the
reset by checking information about the routing table and about BGP neighbors.