04-RG-S7805C Switch RGOS Configuration Reference, Release 11.0 (4) B19 - IP Routing Configuration
04-RG-S7805C Switch RGOS Configuration Reference, Release 11.0 (4) B19 - IP Routing Configuration
1. Configuring RIP
2. Configuring OSPFv2
3. Configuring OSPFv3
4. Configuring IS-IS
5. Configuring BGP
6. Configuring PBR
7. Configuring VRF
8. Configuring RIPng
9. Configuring Routes
1 Configuring RIP
1.1 Overview
Routing Information Protocol (RIP) is a unicast routing protocol applied on IPv4 networks. RIP-enabled routers exchange
routing information to obtain routes to remote networks.
As an Interior Gateway Protocol (IGP), RIP can run only within the autonomous system (AS) and is applicable to small-sized
networks whose longest path involves less than 16 hops.
1.2 Applications
Application Description
Basic RIP Application The routing information is automatically maintained through RIP on a small-sized
network.
Interworking Between RIP and BGP Several ASs are interconnected. RIP runs within each AS, and Border Gateway
Protocol (BGP) runs between ASs.
On a network with a simple structure, you can configure RIP to implement network interworking. Configuring RIP is simpler
than configuring other IGP protocols like Open Shortest Path First (OSPF). Compared with static routes, RIP can dynamically
adapt to the network structure changes and is easier to maintain.
As shown in Figure 1-1, to implement interworking between PC1, PC2, and PC3, you can configure RIP routes on R1, R2,
and R3.
Configuration Guide Configuring RIP
Figure 1-1
Deployment
Several ASs are interconnected. RIP runs within each AS, and BGP runs between ASs. Generally, RIP and BGP learn the
routing information from each other.
As shown in Figure 1-2, unicast routing is implemented within AS 100 and AS 200 using RIP, and between the two ASs
using BGP.
Configuration Guide Configuring RIP
Deployment
1.3 Features
Basic Concepts
Classful routing protocol: It supports classful routes. For example, RIPv1 is a classful routing protocol.
Classless routing protocol: It supports classless routes. For example, RIPv2 is a classless routing protocol.
Overview
Feature Description
RIPv1 and RIPv2 RIP is available in two versions: RIPv1 and RIPv2.
Exchanging Routing By exchanging routing information, RIP-enabled devices can automatically obtain routes to a remote
Information network and update the routes in real time.
Routing Algorithm RIP is a protocol based on the distance-vector algorithm. It uses the vector addition method to
compute the routing information.
Avoiding Route RIP uses functions, such as split horizon and poison reverse, to avoid route loops.
Loops
Configuration Guide Configuring RIP
Feature Description
Security Measures RIP uses functions, such as authentication and source address verification, to ensure protocol
security.
Reliability Measures RIP uses functions, such as bidirectional forwarding detection (BFD) correlation, fast reroute, and
graceful restart (GR), to enhance reliability of the protocol.
Multiple Instances RIP supports multiple instances and VPN applications.
Working Principle
RIPv1
RIPv1 packets are broadcast. The broadcast address is 255.255.255.255, and the UDP port ID is 520. RIPv1 cannot identify
the subnet mask, and supports only classful routes.
RIPv2
RIPv2 packets are multicast. The multicast address is 224.0.0.9, and the UDP port ID is 520. RIPv2 can identify the subnet
mask, and supports classless routes, summarized route, and supernetting routes. RIPv2 supports plain text authentication
and message digest 5 (MD5) authentication.
Related Configuration
You must enable the RIP process on a device; otherwise, all functions related to RIP cannot take effect.
Run the network command to define an address range. RIP runs on interfaces that belong to this address range.
After RIP runs on an interface, RIP packets can be exchanged on the interface and RIP can learn routes to the network
segments directly connected to the device.
By default, an interface receives RIPv1 and RIPv2 packets, and sends RIPv1 packets.
Run the version command to define the version of RIP packets sent or received on all interfaces.
Run the ip rip send version command to define the version of RIP packets sent on an interface.
Run the ip rip receive version command to define the version of RIP packets received on an interface.
Configuration Guide Configuring RIP
If the versions of RIP running on adjacent routers are different, the RIPv1-enabled router will learn incorrect routes.
Run the no ip rip receive enable command to prevent an interface from receiving RIP packets.
Run the no ip rip send enable command to prevent an interface from sending RIP packets.
Run the passive-interface command to prevent an interface from sending broadcast or multicast RIP packets.
Run the ip rip v2-broadcast command to send broadcast RIPv2 packets on an interface.
Run the neighbor command to send unicast RIP packets to a specified neighbor router.
Working Principle
Initialization
After RIP is enabled on a router, the router sends a request packet to its neighbor router, requesting for all routing information,
that is, the routing table. After receiving the request message, the neighbor router returns a response packet containing the
local routing table. After receiving the response packet, the router updates the local routing table, and sends an update
packet to the neighbor router, informing the neighbor router of the route update information. After receiving the update packet,
the neighbor router updates the local routing table, and sends the update packet to other adjacent routers. After a series of
updates, all routers can obtain and retain the latest routing information.
Periodical Update
By default, periodical update is enabled for RIP. Adjacent routers exchange complete routing information with each other
every 30s (update timer), that is, the entire routing table is sent to neighbor routers. One update packet contains at most 25
routes. Therefore, a lot of update packets may be required to send the entire routing table. You can set the sending delay
between update packets to avoid loss of routing information.
For every non-local route, if the route is not updated within 180s (invalid timer), the metric of the route is changed to 16
(unreachable). If the route is still not updated in the next 120s (flush timer), the route is deleted from the routing table.
Triggered Updates
After the triggered updates function is enabled, periodical update is automatically disabled. When routing information
changes on a router, the router immediately sends routes related to the change (instead of the complete routing table) to the
neighbor router, and use the acknowledgment and retransmission mechanisms to ensure that the neighbor router receives
Configuration Guide Configuring RIP
the routes successfully. Compared with periodical update, triggered updates help reduce flooding and accelerates route
convergence.
Events that can trigger update include router startup, interface status change, changes in routing information (such as the
metric), and reception of a request packet.
Route Summarization
When sending routing information to a neighbor router, the RIP-enabled router summarizes subnet routes that belong to the
same classful network into a route, and sends the route to the neighbor router. For example, summarize 80.1.1.0/24
(metric=2) and 80.1.2.0/24 (metric=3) into 80.0.0.0/8 (metric=2), and set the metric of the summarized route to the optimum
metric.
Only RIPv2 supports route summarization. Route summarization can reduce the size of the routing table and improve the
efficiency of routing information exchange.
Supernetting Route
If the subnet mask length of a route is smaller than the natural mask length, this route is called supernetting route. For
example, in the 80.0.0.0/6 route, as 80.0.0.0 is a Class A network address and the natural mask is 8 bits, 80.0.0.0/6 route is a
supernetting route.
Default Route
In the routing table, a route to the destination network 0.0.0.0/0 is called default route.
The default route can be learned from a neighbor router, or sent to a neighbor router.
Route Redistribution
For RIP, other types of routes (such as direct routes, static routes, and routes of other routing protocols) are called external
routes.
External routes (excluding the default route) can be redistributed to RIP and advertised to neighbors.
Route Filtering
Filtering conditions can be configured to limit the routing information exchanged between adjacent routers. Only the routing
information that meets filtering conditions can be sent or received.
Related Configuration
By default, the update packets are sent continuously without any delay.
Run the output-delay command to set the sending delay between update packets.
RIP Timers
By default, the update timer is 30s, the invalid timer is 180s, and the flush timer is 120s.
Configuration Guide Configuring RIP
Run the timers basic command to modify durations of the RIP timers.
Increasing the duration of the flush timer can reduce the route flapping. Decreasing the duration of the flush timer helps
accelerate route convergence.
The durations of RIP timers must be consistent on adjacent routers. Unless otherwise required, you are advised not to modify
the RIP timers.
Triggered Updates
Run the ip rip triggered command to enable triggered updates on the interface and disable periodical update.
Run the ip rip triggered retransmit-timer command to modify the retransmission interval of update packets. The default
value is 5s.
Run the ip rip triggered retransmit-count command to modify the maximum retransmission times of update packets. The
default value is 36.
Route Summarization
By default, route summarization is automatically enabled if an interface is allowed to send RIPv2 packets.
Supernetting Route
By default, supernetting routes can be sent if an interface is allowed to send RIPv2 packets.
Run the no ip rip send supernet-routes command to prevent the sending of supernetting routes.
Default Route
Run the ip rip default-information command to advertise the default route to neighbors on an interface.
Run the default-information originate command to advertise the default route to neighbors from all interfaces.
Route Redistribution
Run the redistribute command to redistribute external routes (excluding the default route) to RIP and advertise them to
neighbors.
Route Filtering
Run the distribute-list out command to set filtering rules to limit the routing information sent by the device.
Run the distribute-list in command to set filtering rules to limit the routing information received by the device.
Working Principle
Distance-Vector Algorithm
RIP is a protocol based on the distance-vector algorithm. The distance-vector algorithm treats a route as a vector that
consists of the destination network and distance (metric). The router obtains a route from its neighbor and adds the distance
vector from itself to the neighbor to the route to form its own route.
RIP uses the hop count to evaluate the distance (metric) to the destination network. By default, the hop count from a router to
its directly connected network is 0, the hop count from a router to a network that can be reached through the router is 1, and
so on. That is, the metric is equal to the number of routers from the local network to the destination network. To restrict the
convergence time, RIP stipulates that the metric must be an integer between 0 and 15. If the metric is equal to or greater than
16, the destination network or host is unreachable. For this reason, RIP cannot be applied on a large-scale network.
As shown in Figure 1-3, Router A is connected to the network 10.0.0.0. Router B obtains the route (10.0.0.0,0) from Router A
and adds the metric 1 to the route to obtain its own route ((10.0.0.0,1), and the next hop points to Router A.
Figure 1-3
RIP selects an optimum route based on the following principle: If multiple routes to the same destination network is available,
a router preferentially selects the route with the smallest metric.
As shown in Figure 1-4, Router A is connected to the network 10.0.0.0. Router C obtains the route (10.0.0.0,0) from Router A
and the route (10.0.0.0,1) from Router B. Router C will select the route that is obtained from Router A and add metric 1 to this
route to form its own route (10.0.0.0,1), and the next hop points to Router A.
Figure 1-4
When routes coming from different sources exist on a router, the route with the smallest distance is preferentially
selected.
Configuration Guide Configuring RIP
Related Configuration
For a RIP route that is proactively discovered by a device, the default metric is equal to the number of hops from the local
network to the destination network. For a RIP router that is manually configured (default route or redistributed route), the
default metric is 1.
Run the offset-list in command to increase the metric of a received RIP route.
Run the offset-list out command to increase the metric of a sent RIP route.
Run the default-metric command to modify the default metric of a redistributed route.
Run the redistribute command to modify the metric of a route when the route is redistributed.
Run the default-information originate command to modify the metric of a default route when the default route is introduced.
Run the ip rip default-information command to modify the metric of a default route when the default route is created.
Working Principle
Route Loop
A RIP route loop occurs due to inherent defects of the distance-vector algorithm.
As shown in Figure 1-5, Router A is connected to the network 10.0.0.0, and sends an update packet every 30s. Router B
receives the route 10.0.0.0 from Router A every 30s. If Router A is disconnected from 10.0.0.0, the route to 10.0.0.0 will be
deleted from the routing table on Router A. Next time, the update packet sent by Router A no longer contains this route. As
Router B does not receive an update packet related to 10.0.0.0, Router B determines that the route to 10.0.0.0 is valid within
180s and uses the Update packet to send this route to Router A. As the route to 10.0.0.0 does not exist on Router A, the
route learned from Router B is added to the routing table. Router B determines that data can reach 10.0.0.0 through Router A,
and Router A determines that data can reach 10.0.0.0 through Router B. In this way, a route loop is formed.
Configuration Guide Configuring RIP
Figure 1-5
Split Horizon
Split horizon can prevent route loops. After split horizon is enabled on an interface, a route received on this interface will not
be sent out from this interface.
As shown in Figure 1-6, after split horizon is enabled on the interface between Router A and Router B, Router B will not send
the route 10.0.0.0 back to Router A. Router B will learn 180s later that 10.0.0.0 is not reachable.
Figure 1-6
Poison Reverse
Poison reverse can also prevent route loops. Compared with slit horizon, poison reverse is more reliable, but brings more
protocol packets, which makes network congestion more severe.
After poison reverse is enabled on an interface, a route received from this interface will be sent out from this interface again,
but the metric of this router will be changed to 16 (unreachable).
As shown in Figure 1-7, after learning the route 10.0.0.0 from Router A, Router B sets the metric of this route to 16 and sends
the route back to Router A. After this route becomes invalid, Router B advertises the route 10.0.0.0 (metric = 16) to Router A
to accelerate the process of deleting the route from the routing table.
Figure 1-7
Related Configuration
Split Horizon
Poison Reverse
Configuration Guide Configuring RIP
Run the ip rip split-horizon poisoned-reverse command to enable poison reverse. (After poison reverse is enabled, split
horizon is automatically disabled.)
Working Principle
Authentication
After authentication is enabled on an interface, the routing information cannot be exchanged between adjacent devices if
authentication fails. The authentication function is used to prevent unauthorized devices from accessing the RIP routing
domain.
When a RIP-enabled device receives an Update packet, it checks whether the source IP address in the packet and the IP
address of the inbound interface are in the same network segment. If not, the device drops the packet. Source address
verification is used to ensure that RIP routing information is exchanged only between adjacent routing devices.
Related Configuration
Authentication
Run the ip rip authentication mode text command to enable plain text authentication on an interface.
Run the ip rip authentication mode md5 command to enable MD5 authentication on an interface.
Run the ip rip authentication text-password command to set the password for plain text authentication on an interface.
Run the ip rip authentication key-chain command to reference the key in the configured key chain as the authentication
key on an interface.
Working Principle
When a link or a device is faulty on the network, packets transmitted through this route will be lost until the route is converged
again.
As shown in Figure 1-8, after the link between Router A and Router S is faulty, Router B may wait 180s before it can detect
the failure of the route (Destination network: 10.0.0.0; Next hop: Router A). Later, Router B may need to wait 30s to re-obtain
the route (Destination network: 10.0.0.0; Next hop: Router C) from Router C. Therefore, the traffic is interrupted for 210s.
Figure 1-8
Quick detection of a route failure or fast switchover to the standby route helps shorten the traffic interruption time.
A BFD session can be set up between Router A and Router B, and correlated with RIP. BFD can quickly test the
connectivity between adjacent routers. Once a link is faulty, RIP can detect the route failure within 1s.
The fast reroute function can be enabled. A standby route (Destination network: 10.0.0.0; Next hop: Router C) can be
configured on Router B in advance. Once RIP detects a route failure, the standby route is immediately enabled.
GR
GR ensures uninterrupted data transmission when the protocol is restarted. If RIP is restarted on a GR-enabled device, the
forwarding table before restart will be retained and a request packet will be sent to the neighbor so that the route can be
learned again. During the GR period, RIP completes re-convergence of the route. After the GR period expires, RIP updates
the forwarding entry and advertises the routing table to the neighbor.
Related Configuration
BFD Correlation
Run the bfd all-interfaces command to set up the correlation between RIP and BFD. This configuration takes effect on all
interfaces.
Configuration Guide Configuring RIP
Run the ip rip bfd command to set up the correlation between RIP and BFD on the current interface.
Fast Reroute
Run the fast-reroute route-map command to enable fast reroute and reference the route map.
Run the set fast-reroute backup-interface backup-nexthop command to configure a standby route in the route map.
GR
By default, GR is disabled.
RIP supports multiple instances. You can enable the RIP process in VPN routing and forwarding (VRF) address family mode
to run RIP on VPN instances. One VRF address family is mapped to one VPN instance.
VPN instances cannot be distinguished from each other when you perform RIP operations using SNMP. You must bind the
management information base (MIB) of RIP with a VPN instance before the SNMP operations take effect on the VPN
instance.
Related Configuration
Run the address-family command to create a VRF address family and enter VRF address family mode.
Run the exit-address-family command to exit from VRF address family mode.
MIB Binding
Run the enable mib-binding command to bind the RIP MIB with a VPN instance.
1.4 Configuration
Notes
Configuration Steps
Mandatory.
Unless otherwise required, this configuration must be performed on every router in the RIP routing domain.
Mandatory.
Unless otherwise required, this configuration must be performed on every router in the RIP routing domain.
Unless otherwise required, the local network associated with RIP should cover network segments of all L3 interfaces.
If RIPv2 functions (such as the variable length subnet mask and authentication) are required, enable the RIPv2.
Unless otherwise required, you must define the same RIP version on every router.
Unless otherwise required, enable split horizon on every interface connected to the broadcast network, such as the
Ethernet. (Retain the default setting.)
Unless otherwise required, enable split horizon on every interface connected to the point-to-point (P2P) network, such
as the PPP and HDLC. (Retain the default setting.)
It is recommended that split horizon and poison reverse be disabled on an interface connected to a non-broadcast
multi-access (NBMA) network, such as FR and X.25; otherwise, some devices may fail to learn the complete routing
information.
If the secondary IP address is configured for an interface connected to a non-broadcast, it is recommended that split
horizon and poison reverse be disabled.
If you want to suppress Update packets on a RIP interface, configure the interface as a passive interface.
Configuration Guide Configuring RIP
Use the passive interface to set the boundary of the RIP routing domain. The network segment of the passive interface
belongs to the RIP routing domain, but RIP packets cannot sent over the passive interface.
If RIP routes need to be exchanged on an interface (such as the router interconnect interface) in the RIP routing domain,
this interface cannot be configured as a passive interface.
Verification
Check the routing table on a router to verify that the route to a remote network can be obtained through RIP.
Related Commands
Command version { 1 | 2 }
Syntax
Parameter 1: Indicates RIPv1.
Description 2: Indicates RIPv2.
Command Global configuration mode
Mode
Configuration Guide Configuring RIP
Configuration This command takes effect on the entire router. You can run this command to define the version of RIP
Usage packets sent or received on all interfaces.
Configuration Example
Scenario
Figure 1-9
A(config-router)# version 2
B
B# configure terminal
B(config-router)# version 2
C
C# configure terminal
C(config-router)# version 2
C(config-router)#no auto-summary
Verification Check the routing tables on Router A, Router B, and Router C. Verify that RIP learns the routes to remote
networks (contents marked in blue).
A
A# show ip route
B
B# show ip route
C
C# show ip route
Common Errors
The RIP version is not defined on a device, or the RIP version on the device is different from that on other routers.
The address range configured by the network command does not cover a specific interface.
Configuration Guide Configuring RIP
The wildcard parameter in the network command is not correctly configured. 0 indicates accurate matching, and 1
indicates that no comparison is performed.
The interface used for interconnection between devices is configured as a passive interface.
Change the default running mechanism of RIP through configuration and manually control the interaction mode of RIP
packets, including:
Allowing or prohibiting the sending of unicast RIP packets to a specified neighbor on an interface
Allowing or prohibiting the sending of unicast RIPv2 packets instead of broadcast packets to a specified neighbor on an
interface
Notes
On an interface connecting to a neighbor device, the configured version of sent RIP packets must be the same as the
version of received RIP packets.
Configuration Steps
Configure this function if you wish that only some of devices connected to an interface can receive the updated routing
information.
By default, RIPv1 uses the IP broadcast address (255.255.255.255) to advertise the routing information, whereas
RIPv2 uses the multicast address (224.0.0.9) to advertise the routing information. If you do not wish all devices on the
broadcast network or NBMA network to receive routing information, configure the related interface as the passive
interface and specify the neighbors that can receive the routing information. This command does not affect the receiving
of RIP packets. RIPv2 packets are broadcast on an interface.
Unless otherwise required, this function must be enabled on a router that sends the unicast Update packets.
This function must be configured if the neighbor router does not support the receiving of multicast RIPv2 packets.
Unless otherwise required, this function must be configured on every router interface that broadcasts RIPv2 packets.
This function is enabled by default, and must be disabled if an interface is not allowed to receive RIP packets.
Unless otherwise required, this function must be configured on every router interface that is not allowed to receive RIP
packets.
This function is enabled by default, and must be disabled if an interface is not allowed to send RIP packets.
Unless otherwise required, this function must be configured on every router interface that is not allowed to send RIP
packets.
This function must be configured if the version of RIP packets that can be sent on an interface is required to be different
from the global configuration.
Unless otherwise required, this function must be configured on every router interface that is allowed to send RIP
packets of a specified version.
This function must be configured if the version of RIP packets that can be received on an interface is required to be
different from the global configuration.
Unless otherwise required, this function must be configured on every router interface that is allowed to receive RIP
packets of a specified version.
Verification
Run the debug ip rip packet command to verify the packet sending result and packet type.
Related Commands
Configuration The default behavior is determined by the configuration of the version command. The configuration result of
Usage this command can overwrite the default configuration of the version command. This command affects the
behavior of sending RIP packets on the current interface, and the interface is allowed to send RIPv1 and
RIPv2 packets simultaneously. If this command does not contain any parameter, the behavior of receiving
RIP packets is determined by the configuration of the version command.
Configuration Example
Verification Run the debug ip rip packet send command on Router A, and verify that packets cannot be sent.
A
A# debug ip rip packet recv
Scenario
Figure 1-10
Verification Run the debug ip rip packet send command on Router A, and verify that packets cannot be sent.
*Nov 4 08:19:31: %RIP-7-DEBUG: [RIP] Building update entries on GigabitEthernet 0/1
*Nov 4 08:19:31: %RIP-7-DEBUG: [RIP] Interface GigabitEthernet 0/1 is disabled to send RIP packet!
Common Errors
A compatibility error occurs because the RIP version configured on the neighbor is different from that configured on the local
device.
Enable the RIP triggered updates function, after which RIP does not periodically send the route update packets.
Notes
It is recommended that split horizon with poisoned reverse be enabled; otherwise, invalid routing information may exist.
This function cannot be enabled together with the function of correlating RIP with BFD.
Ensure that the triggered updates function is enabled on every router on the same link; otherwise, the routing
information cannot be exchanged properly.
Configuration Steps
This function must be enabled if demand circuits are configured on the WAN interface.
The triggered updates function can be enabled in either of the following cases: (1) The interface has only one neighbor;
(2) The interface has multiple neighbors but the device interacts with these neighbors in unicast mode.
It is recommended that triggered updates be enabled on a WAN interface (running the PPP, Frame Relay, or X.25 link
layer protocol) to meet the requirements of demand circuits.
If the triggered updates function is enabled on an interface, source address verification is performed no matter whether
the source address verification function is enabled by the validate-update-source command.
Unless otherwise required, triggered updates must be enabled on demand circuits of every router.
Verification
When the RIP triggered updates function is enabled, RIP cannot periodically send the route update packets. RIP sends the
route update packets to the WAN interface only in one of the following cases:
Related Commands
Configuration Example
Scenario
Figure 1-11
B
B# configure terminal
Verification On Router A and Router B, check the RIP database and verify that the corresponding routes are permanent.
A
A# sho ip rip database
Configuration Guide Configuring RIP
201.1.1.0/24 auto-summary
201.1.1.0/24
B
B# sho ip rip database
200.1.1.0/24 auto-summary
200.1.1.0/24
Common Errors
The triggered updates function is enabled when the RIP configurations at both ends of the link are consistent.
The triggered updates function is not enabled on all routers on the same link.
The source address of the received RIP route update packet is verified.
Notes
Configuration Steps
This function is enabled by default, and must be disabled when source address verification is not required.
After split horizon is disabled on an interface, the RIP routing process will perform source address verification on the
Update packet no matter whether the validate-update-source command is executed in routing process configuration
mode.
For an IP unnumbered interface, the RIP routing process does not perform source address verification on the Update
packet no matter whether the validate-update-source command is executed in routing process configuration mode.
Unless otherwise required, this function must be disabled on every router that does not requires source address
verification.
Verification
Only the route update packets coming from the same IP subnet neighbor are received.
Related Commands
Configuration Guide Configuring RIP
Command validate-update-source
Syntax
Parameter N/A
Description
Command Routing process configuration mode
Mode
Configuration Source address verification of the Update packet is enabled by default. After this function is enabled, the
Usage source address of the RIP route update packet is verified. The purpose is to ensure that the RIP routing
process receives only the route update packets coming from the same IP subnet neighbor.
Configuration Example
Scenario
Figure 1-12
A(config-router)# no validate-update-source
B
B# configure terminal
B(config-router)# no validate-update-source
Verification On Router A, check the routing table and verify that the entry 201.1.1.0/24 is loaded.
On Router B, check the routing table and verify that the entry 200.1.1.0/24 is loaded.
A
A# show ip route rip
B
B# show ip route rip
Prevent learning unauthenticated and invalid routes and advertising valid routes to unauthorized devices, ensuring
stability of the system and protecting the system against intrusions.
Notes
Only RIPv2 supports authentication of RIP packets, and RIPv1 does not.
Configuration Steps
Enabling Authentication and Specifying the Key Chain Used for RIP Authentication
If the key chain is already specified in the interface configuration, run the key chain command in global configuration
mode to define the key chain; otherwise, authentication of RIP packets may fail.
Unless otherwise required, this configuration must be performed on every router that requires authentication.
The RIP authentication modes configured on all devices that need to directly exchange RIP routing information must be
the same; otherwise, RIP packets may fail to be exchanged.
If plain text authentication is used, but the key chain for plain text authentication is not configured or associated,
authentication is not performed. Similarly, if MD5 authentication is used, but the key chain is not configured or
associated, authentication is not performed.
Unless otherwise required, this configuration must be performed on every router that requires authentication.
Enabling RIP Plain Text Authentication and Configuring the Key Chain
If RIP plain text authentication should be enabled, use this command to configure the key chain for plain text
authentication. Alternatively, you can obtain the key chain for plain text authentication by associating the key chain. The
key chain obtained using the second method takes precedence over that obtained using the first method.
Unless otherwise required, this configuration must be performed on every router that requires authentication.
Verification
RIP plain text authentication provides only limited security because the password transferred through the packet is
visible.
RIP MD5 authentication can provide higher security because the password transferred through the packet is encrypted
using the MD5 algorithm.
Configuration Guide Configuring RIP
Routes can be learned properly if the correct authentication parameters are configured.
Related Commands
Enabling RIP Plain Text Authentication and Configuring the Key Chain
Configuration Example
Scenario
Figure 1-13
A(config-keychain)# key 1
A(config-keychain-key)# exit
A(config-keychain)# exit
B
B# configure terminal
B(config-keychain)# key 1
B(config-keychain-key)# exit
B(config-keychain)# exit
Verification On Router A, check the routing table and verify that the entry 201.1.1.0/24 is loaded.
On Router B, check the routing table and verify that the entry 200.1.1.0/24 is loaded.
A
A# show ip route rip
B
A# show ip route rip
Common Errors
The keys configured on routers that need to exchange RIP routing information are different.
The authentication modes configured on routers that need to exchange RIP routing information are different.
Reduce the size of the routing table, improve the routing efficiency, avoid route flapping to some extent, and improve
scalability and effectiveness of the network.
If a summarized route exists, subroutes included by the summarized route cannot be seen in the routing table, which
greatly reduces the size of the routing table.
Advertising a summarized route is more efficient than advertising individual routes because: (1) A summarized route is
processed first when RIP looks through the database; (2) All subroutes are ignored when RIP looks through the
database, which reduces the processing time required.
Notes
The range of supernetting routes is larger than that of the classful network. Therefore, the automatic route
summarization function is invalid for supernetting routes.
RIPv1 always performs automatic route summarization. If the detailed routes should be advertised, you must set the
RIP version to RIPv2.
Configuration Steps
To learn specific subnet routes instead of summarized network routes, you must disable automatic route
summarization.
You can disable automatic route summarization only in RIPv2. RIPv1 always performs automatic route summarization.
The ip rip summary-address command is used to summarize an address or a subnet under a specified interface. RIP
automatically summarizes to the classful network boundary. Each classful subnet can be configured only in the ip rip
summary-address command.
Configuration Guide Configuring RIP
The summary range configured in this command cannot be supernetting routes, that is, the configured subnet mask
length cannot be smaller than the natural mask length of the network.
Unless otherwise required, this configuration should be performed on a router that requires classful subnet
summarization.
Verification
Verify that the routes are summarized in the routing table of the peer end.
Related Commands
Command auto-summary
Syntax
Parameter N/A
Description
Command Routing process configuration mode
Mode
Configuration Route summarization is enabled by default for RIPv1 and RIPv2.
Usage You can disable automatic route summarization only in RIPv2. RIPv1 always performs automatic route
summarization.
Configuration Example
Scenario
Figure 1-14
B# configure terminal
B(config-router)# version 2
B(config-router)# no auto-summary
Verification Check the routing table on Router A, and verify that the entry 172.16.0.0/16 is generated.
Common Errors
Notes
Configuration Steps
If a supernetting route is detected when a RIPv1-enabled router monitors the RIPv2 route response packets, the router
will learn an incorrect route because RIPv1 ignores the subnet mask in the routing information of the packet. In this
case, the no form of the command must be used on the RIPv2-enabled router to prohibit advertisement of supernetting
routes on the related interface. This command takes effect only on the current interface.
The command is effective only when RIPv2 packets are sent on the interface, and is used to control the sending of
supernetting routes.
Verification
Verify that the peer router cannot learn the supernetting route.
Related Commands
Configuration Example
Scenario
Figure 1-15
B# configure terminal
Verification Check the routing table on Router A, and verify that Router A can learn only the non-supernetting route
208.1.1.0/24, but not the supernetting route 207.0.0.0/8.
In the RIP domain, introduce a unicast route of another AS so that the unicast routing service to this AS can be provided
for users in the RIP domain.
In the RIP domain, inject a default route to another AS so that the unicast routing service to this AS can be provided for
users in the RIP domain.
Notes
Route redistribution cannot introduce default routes of other protocols to the RIP routing domain.
Configuration Steps
This function must be enabled if it is required to advertise the default route to neighbors.
By default, a default route is not generated, and the metric of the default route is 1.
If the RIP process can generate a default route using this command, RIP does not learn the default route advertised by the
neighbor.
Unless otherwise required, this configuration should be performed on a router that needs to advertise the default route.
This function must be enabled if it is required to advertise the default route to neighbors on a specified interface.
By default, a default route is not configured and the metric of the default route is 1.
Configuration Guide Configuring RIP
After this command is configured on an interface, a default route is generated and advertised through this interface.
Unless otherwise required, this configuration should be performed on a router that needs to advertise the default route.
By default,
If OSPF redistribution is configured, redistribute the routes of all sub-types of the OSPF process.
If IS-IS redistribution is configured, redistribute the level-2 routes of the IS-IS process.
During route redistribution, it is not necessary to convert the metric of one routing protocol to the metric of another routing
protocol because different routing protocols use completely different metric measurement methods. RIP measures the metric
based on the hop count, and OSPF measures the metric based on the bandwidth. Therefore, the computed metrics cannot
be compared with each other. During route redistribution, however, it is necessary to configure a symbolic metric; otherwise,
route redistribution fails.
Unless otherwise required, this configuration should be performed on a router that needs to redistribute routes.
Verification
On a neighbor device, verify that a default route exists in the RIP routing table.
On the local and neighbor devices, verify that external routes (routes to other ASs) exist in the RIP routing table.
Related Commands
information database.
To further control the behavior of advertising the RIP default route, use the route-map parameter. For
example, run the set metric rule to set the metric of the default route.
You can use the metric parameter to set the metric of the advertised default value, but the priority of this
configuration is lower than that of the set metric rule of the route-map parameter. If the metric parameter is
not configured, the default route uses the default metric configured for RIP.
You still need to run the default-information originate command to introduce the default route generated
by ip default-network to RIP.
Command redistribute { bgp | connected | isis [ area-tag ] | ospf process-id | static } [ { level-1 | level-1-2 | level-2 } ]
Syntax [ match { internal | external [ 1 | 2 ] | nssa-external [ 1 | 2 ] } ] [ metric metric-value ] [ route-map
route-map-name ]
Parameter bgp: Indicates redistribution from BGP.
Description connected: Indicates redistribution from direct routes.
isis area-tag: Indicates redistribution from IS-IS. area-tag indicates the IS-IS process ID.
ospf process-id: Indicates redistribution from OSPF. process-id indicates the OSPF process ID. The value
ranges from 1 to 65535.
static: Indicates redistribution from static routes.
level-1 | level-1-2 | level-2: Used only when IS-IS routes are redistributed. Only the routes of the specified
level are redistributed.
match: Used only when OSPF routes are redistributed. Only the routes that match the filtering conditions
are redistributed.
metric metric-value: Sets the metric of the redistributed route. The value ranges from 1 to 16.
route-map route-map-name: Sets the redistribution filtering rules.
Command Routing process configuration mode
Mode
Configuration Guide Configuring RIP
Configuration When you configure redistribution of IS-IS routes without specifying the level parameter, only level-2 routes
Usage can be redistributed by default. If you specify the level parameter during initial configuration of redistribution,
routes of the specified level can be redistributed. If both level-1 and level-2 are configured, the two levels
are combined and saved as level-1-2 for the convenience sake.
If you configure redistribution of OSPF routes without specifying the match parameter, OSPF routes of all
sub-types can be distributed by default. The latest setting of the match parameter is used as the initial
match parameter. Only routes that match the sub-types can be redistributed. You can use the no form of
the command to restore the default value of match.
The configuration rules for the no form of the redistribute command are as follows:
1. If some parameters are specified in the no form of the command, default values of these parameters will
be restored.
2. If no parameter is specified in the no form of the command, the entire command will be deleted.
For example, if redistribute isis 112 level-2 is configured, you can run the no redistribute isis 112 level-2
command to restore the default value of level-2. As level-2 itself is the default value of the parameter, the
configuration saved is still redistribute isis 112 level-2 after the preceding no form of the command is
executed.
To delete the entire command, run the no redistribute isis 112 command.
Configuration Example
Scenario
Figure 1-16
Verification On Router A, check the routing table and verify that the entry 172.10.10.0/24 is loaded.
Routes that do not meet filtering criteria cannot be loaded to the routing table, or advertised to neighbors. In this way,
users within the network can be prevented from accessing specified destination networks.
Notes
In regard to the filtering rules of sent routes, you must configure route redistribution first, and then filter the redistributed
routes.
Configuration Steps
To refuse receiving some specified routes, you can configure the route distribution control list to process all the received
route update packets. If no interface is specified, route update packets received on all interfaces will be processed.
Unless otherwise required, this configuration should be performed on a router that requires route filtering.
This function must be configured if it is required to filter the redistributed routing information that is sent.
If this command does not contain any optional parameter, route update advertisement control takes effect on all
interfaces. If the command contains the interface parameter, route update advertisement control takes effect only on
the specified interface. If the command contains other routing process parameters, route update advertisement control
takes effect only on the specified routing process.
Unless otherwise required, this configuration should be performed on a router that requires route filtering.
Verification
Run the show ip route rip command to verify that the routes that have been filtered out are not loaded to the routing
table.
Related Commands
interface-type interface-number: Indicates that the distribution list is applied to the specified interface.
Command Routing process configuration mode
Mode
Configuration N/A
Usage
Command distribute-list { [ access-list-number | name ] | prefix prefix-list-name } out [ interface | [ bgp | connected |
Syntax isis [ area-tag ] | ospf process-id | rip | static ] ]
Parameter access-list-number | name: Specifies the access list. Only routes permitted by the access list can be sent.
Description prefix prefix-list-name: Uses the prefix list to filter routes.
Interface: Applies route update advertisement control only on the specified interface.
bgp: Applies route update advertisement control only on the routes introduced from BGP.
connected: Applies route update advertisement control only on direct routes introduced through
redistribution.
isis [ area-tag ]: Applies route update advertisement control only on the routes introduced from IS-IS.
area-tag specifies an IS-IS process.
ospf process-id: Applies route update advertisement control only on the routes introduced from OSPF.
process-id specifies an OSPF process.
rip: Applies route update advertisement control only on RIP routes.
static: Applies route update advertisement control only on static routes introduced through redistribution.
Command Routing process configuration mode
Mode
Configuration N/A
Usage
Configuration Example
Scenario
Figure 1-17
Configuration Guide Configuring RIP
A(config-router)# no auto-summary
Verification On Router A, check the routing table and verify that only the entry 200.1.1.0/24 exists.
A
A# show ip route rip
Scenario
Figure 1-18
B(config-router)# version 2
Verification Check the routing table on Router A, and verify that route in the 200.1.1.0 network segment exists.
Configuration Guide Configuring RIP
A
A# show ip route rip
Common Errors
Filtering fails because the filtering rules of the access list are not properly configured.
Change the RIP routes to enable the traffic pass through specified nodes or avoid passing through specified nodes.
Change the sequence that a router selects various types of routes so as to change the priorities of RIP routes.
Notes
Configuration Steps
Optional.
This configuration is mandatory if you wish to change the priorities of RIP routes on a router that runs multiple unicast
routing protocols.
Optional.
Unless otherwise required, this configuration should be performed on a router where the metrics of routes need to be
adjusted.
Optional.
Unless otherwise required, this configuration must be performed on an ASBR to which external routes are introduced.
Verification
Run the show ip rip command to display the administrative distance currently configured. Run the show ip rip data
command to display the metrics of redistributed routes to verify that the configuration takes effect.
Related Commands
Syntax
Parameter distance: Sets the administrative distance of a RIP route. The value is an integer ranging from 1 to 255.
Description ip-address: Indicates the prefix of the source IP address of the route.
wildcard: Defines the IP address comparison bit. 0 indicates accurate matching, and 1 indicates that no
comparison is performed.
Command Routing process configuration mode
Mode
Configuration Run this command to configure the administrative distance of a RIP route.
Usage
Configuration Example
Scenario
Figure 1-19
A(config-router)# offset-list 8 in 7
Verification Check the routing table on Router A and Router B to verify that the metrics of RIP routes are 8.
A
A# show ip route rip
B
B# show ip route rip
Change the duration of RIP timers to accelerate or slow down the change of the protocol state or occurrence of an
event.
Notes
Modifying the protocol control parameters may result in protocol running failures. Therefore, you are advised not to
modify the timers.
Configuration Steps
Configuration Guide Configuring RIP
This configuration must be performed if you need to adjust the RIP timers.
By adjusting the timers, you can reduce the convergence time and fault rectification time of the routing protocol. For routers
connected to the same network, values of the three RIP timers must be the same. Generally, you are advised not to modify
the RIP timers unless otherwise required.
Setting timers to small values on a low-speed link brings risks because a lot of Update packets consume the bandwidth. You
can set timers to small values generally on the Ethernet or a 2 Mbps (or above) link to reduce the convergence time of
network routes.
Unless otherwise required, this configuration should be performed on a router where RIP timers need to be modified.
This configuration must be performed if you need to adjust the sending delay between RIP Update packets.
Run the output-delay command to increase the sending delay between packets on a high-speed device so that a low-speed
device can receive and process all Update packets.
Unless otherwise required, this configuration should be performed on a router where the sending delay needs to be adjusted.
Verification
Run the show ip rip command to display the current settings of RIP timers.
Related Commands
Usage
Configuration Example
Scenario
Figure 1-20
A(config-router)# output-delay 30
Verification Capture packets on Router A and compare the sending time of update packets before and after the
configuration, and verify that a delay of 30 ms is introduced.
Common Errors
For routers connected to the same network, values of the three RIP timers are not the same.
Configuration Guide Configuring RIP
Once a link is faulty, RIP can quickly detect the failure of the route. This configuration helps shorten the traffic
interruption time.
Notes
The BFD correlation configured in interface configuration mode takes precedence over the global configuration.
Configuration Steps
After BFD is enabled on RIP, a BFD session will be set up for the RIP routing information source (that is, the source
address of RIP route update packets). Once the BFD neighbor fails, the corresponding RIP route directly enters the
invalid state and is not forwarded.
You can also run the ip ospf bfd [disable] command in interface configuration mode to enable or disable the BFD
function on a specified interface, and this configuration takes precedence over the bfd all-interfaces command used in
routing process configuration mode.
This configuration must be performed if you need to enable or disable BFD correlation on a specified interface.
The interface-based configuration takes precedence over the bfd all-interfaces command used in routing process
configuration mode.
Based on the actual environment, you can run the ip ospf bfd command to enable BFD on a specified interface for link
detection, or run the bfd all-interfaces command in RIP process configuration mode to enable BFD on all interface of
the OSPF process, or run the ospf bfd disable command to disable BFD on a specified interface.
Unless otherwise required, configure this function on a router interface where BFD correlation should be configured
separately.
Verification
Related Commands
Configuration Example
Scenario
Figure 1-21
B
B# configure terminal
Configuration Guide Configuring RIP
Peer 192.168.1.2:
B
A# show ip rip peer
Peer 192.168.1.1:
Common Errors
The preceding two commands are executed in RIP before the BFD function is enabled.
Once RIP detects a route failure, the router can immediately switch to the second-best route. This configuration helps
shorten the traffic interruption time.
Notes
Configuration Guide Configuring RIP
The route map and the standby next hop must be configured.
To accelerate the convergence, set carrier-delay of the interface to 0 and enable BFD correlation with RIP.
Configuration Steps
If route-map is configured, a standby path can be specified for a successfully matched route through the route map.
When the RIP fast reroute function is used, it is recommended that BFD be enabled at the same time so that the device can
quickly detect any link failure and therefore shorten the forwarding interruption time. If the interface is up or down, to shorten
the forwarding interruption time during RIP fast reroute, you can configure carrier-delay 0 in interface configuration mode to
achieve the fastest switchover speed.
Verification
When the active link fails, the data can be quickly switch over to the standby link for forwarding.
Related Commands
Configuration Example
Scenario
Figure 1-22
Verification On Router A, check the routing table and verify that a standby route exists for the entry 192.168.4.0/24.
A
A# show ip route fast-reroute | begin 192.168.4.0
Common Errors
Configuration Guide Configuring RIP
The standby next hop is not properly configured for the route map.
The carrier-delay is not configured for the interface or BFD correlation is not configured. Consequently, the switchover
speed of the forwarding line is slow.
1.4.14 Enabling GR
Configuration Effect
When a distributed route switches services from the active board to the standby board, traffic forwarding continues and
is not interrupted.
When the RIP process is being restarted, traffic forwarding continues and is not interrupted.
Notes
During the RIP GR process, ensure that the network environment is stable.
Configuration Steps
This configuration must be performed if RIP needs to be gracefully restarted to ensure data forwarding during hot standby
switchover.
The GR function is configured based on the RIP process. You can configure different parameters for different RIP processes
based on the actual conditions.
The GR period is the maximum time from restart of the RIP process to completion of GR. During this period, the forwarding
table before the restart is retained, and the RIP route is restored so as to restore the RIP state before the restart. After the
restart period expires, RIP exits from the GR state and performs common RIP operations.
Unless otherwise required, this configuration should be performed on every router that needs to be gracefully restarted.
Verification
Run the show ip rip command to display the GR state and configured time.
Trigger a hot standby switchover, and verify that data forwarding is not interrupted.
Related Commands
Configuration Example
Scenario
Figure 1-23
B# configure terminal
Verification Trigger a hot standby switchover on Router B, and verify that the routing tables of destination Network
1 and Network 2 remain unchanged on Router A during the switchover.
Trigger a hot standby switchover on Router B, ping destination Network 1 from Router A, and verify
that traffic forwarding is not interrupted during the switchover.
Notes
The RIP basic functions (with the VRF parameter) must be configured.
Configuration Steps
Creating a VRF Instance and Entering the IPv4 VRF Address Family
This configuration must be performed if you need to configure RIP multiple instances and associate these RIP
instances with VRF.
Unless otherwise required, this configuration should be performed on every router that requires the RIP multiple
instances.
This configuration must be performed if you configure RIP multiple instances and wish to manage non-default RIP
instances using the MIB.
The RIP MIB does not have the RIP instance information. Therefore, you must perform operations only on one instance
through SNMP. By default, the RIP MIB is bound with the RIP instance of the default VRF, and all user operations take
effect on this instance.
If you wish to perform operations on a specified RIP instance through SNMP, run this command to bind the MIB with the
instance.
Unless otherwise required, this configuration should be performed on a router where the instance is managed using the
MIB.
Verification
Check the VRF routing table on a router to verify that the route to a remote network can be obtained through RIP.
Related Commands
Creating a VRF Instance and Entering the IPv4 VRF Address Family
Syntax
Parameter vrf vrf-name: Specifies the name of the VRF associated with the address family configuration sub-mode.
Description
Command Routing process configuration mode
Mode
Configuration Run the address-family command to enter address family configuration sub-mode, the prompt of which is
Usage (config-router-af)#. When the VRF associated with the address family configuration sub-mode is specified
for the first time, the RIP instance corresponding to the VRF will be created. In this submode, you can
configure the RIP routing information for the related VRF.
To exit from address family configuration sub-mode and return routing process configuration mode, run the
exit-address-family or exit command.
Command exit-address-family
Syntax
Parameter N/A
Description
Command Address family configuration mode
Mode
Configuration Run this command in address family configuration mode to exit from this configuration mode.
Usage This command can be abbreviated as exit.
Configuration Example
Scenario
Figure 1-24
A# configure terminal
A(config-vrf)# exit
A(config-router-af)# exit-address-family
Verification Check the routing table on Router A, and verify that the VRF route 201.1.1.0/24 can be learned.
Read and configure parameters of the RIP vpn1 instance using the MIB tool.
Notes
Configuration Steps
Verification
Run the show ip route rip command to display the protocol status.
Related Commands
Parameter all: Indicates that packets are allowed to be sent to all sub VLANs.
Description
vid: Specifies the sub VLAN ID. The value ranges from 1 to 4094.
Usage Guide In normal cases, a super VLAN contains multiple sub VLANs. Multicast packets of a super VLAN are also
sent to its sub VLANs. In this case, when RIP multicast packets are sent over a super VLAN containing
multiple sub VLANs, the RIP multicast packets are replicated multiple times, and the device processing
capability is insufficient. As a result, a large number of packets are discarded, causing the neighbor down
error. In most scenarios, the RIP function does not need to be enabled on a super VLAN. Therefore, the RIP
function is disabled by default. However, in some scenarios, the RIP function must be run on the super
VLAN, but packets only need to be sent to one sub VLAN. In this case, run this command to specify a
particular sub VLAN. You must be cautious in configuring packet transmission to all sub VLANs, as the large
number of sub VLANs may cause a device processing bottleneck, which will lead to the neighbor down
error.
Configuration Example
Configuration Guide Configuring RIP
Scenario
1-25
A A# configure terminal
B B# configure terminal
V erify that the entry 201.1.1.0/24 has been loaded to the routing table on Device A.
Verification
Verify that the entry 201.1.1.0/24 has been loaded to the routing table on Device B.
1.5 Monitoring
Displaying
Description Command
Displays the basic information about show ip rip
a RIP process.
Displays the RIP routing table. show ip rip database [ vrf vrf-name ] [ network-number network-mask ] [ count ]
Configuration Guide Configuring RIP
Displays information about external show ip rip external [ bgp | connected | isis [ process-id ] | ospf process-id | static]
routes redistributed by RIP. [vrf vrf-name]
Displays the RIP interface
show ip rip interface [ vrf vrf-name ] [ interface-type interface-number ]
information.
Displays the RIP neighbor
show ip rip peer [ ip-address ] [ vrf vrf-name ]
information.
Debugging
System resources are occupied when debugging information is output. Therefore, disable debugging immediately after
use.
Description Command
Debugs events that occur when the debug ip rip event
RIP process is running.
Debugs interaction with the NSM debug ip rip nsm
process.
Debugs the sent and received debug ip rip packet [ interface interface-type interface-number | recv | send ]
packets.
Debugs the RIP GR process. debug ip rip restart
Debugs the route changes of the RIP debug ip rip route
process.
Configuration Guide Configuring OSPFv2
2 Configuring OSPFv2
2.1 Overview
Open Shortest Path First (OSPF) is an Interior Gateway Protocol (IGP) that is used within the Autonomous System (AS) to
allow routers to obtain a route to a remote network.
OSPF Version 2 (OSPFv2) is applicable to IPv4, and OSPF Version 3 (OSPFv3) is applicable to IPv6. The protocol
running mechanism and most configurations are the same.
Wide scope of application: OSPF is applicable to a larger-scale network that supports hundreds of routers.
Fast convergence: Once the network topology changes, notifications can be quickly sent between routers to update
routes.
No self-loop: Only the link status information is synchronized between routers. Each router computes routes
independently, and a self-loop will not occur.
Area division: A large routing domain is divided into multiple small areas to save system resources and network
bandwidth and ensure stability and reliability of routes.
Route classification: Routes are classified into several types to support flexible control.
Multicast transmission: Protocol packets are sent using the multicast address to avoid interfering with irrelevant entities
and save system resources.
In this chapter, the term "router" refers to any network device that supports the routing function. These network devices
can be L3 switches, routers, or firewall.
RFC2328 This memo documents version 2 of the OSPFprotocol. OSPF is a link-state routing protocol.
RFC 2370 This memo defines enhancements to the OSPFprotocol to support a new class of link-stateadvertisements
(LSA) called Opaque LSAs.Opaque LSAs provide a generalized mechanismto allow for the future extensibility
of OSPF.
RFC3137 This memo describes a backward-compatibletechnique that may be used by OSPF (OpenShortest Path First)
implementations to advertiseunavailability to forward transit traffic or to lowerthe preference level for the paths
through such arouter.
2-1
Configuration Guide Configuring OSPFv2
RFC3623 This memo documents an enhancement to theOSPF routing protocol, whereby an OSPF routercan stay on the
forwarding path even as its OSPFsoftware is restarted.
RFC3630 This document describes extensions to the OSPFprotocol version 2 to support intra-area TrafficEngineering
(TE), using Opaque Link StateAdvertisements.
RFC3682 The use of a packet's Time to Live (TTL) (IPv4)or Hop Limit (IPv6) to protect a protocol stackfrom
CPU-utilization based attacks has beenproposed in many settings.
RFC3906 This document describes how conventional hop-by-hop link-state routing protocols interact withnew Traffic
Engineering capabilities to createInterior Gateway Protocol (IGP) shortcuts.
RFC4576 This document specifies the necessary procedure,using one of the options bits in the LSA (Link
StateAdvertisements) to indicate that an LSA hasalready been forwarded by a PE and should beignored by
any other PEs that see it.
RFC4577 This document extends that specification byallowing the routing protocol on the PE/CEinterface to be the
OSPF protocol.
RFC4750 This memo defines a portion of the ManagementInformation Base (MIB) for use with networkmanagement
protocols in TCP/IP-based Internets.In particular, it defines objects for managingversion 2 of the Open
Shortest Path First RoutingProtocol. Version 2 of the OSPF protocol is specific to the IPv4 address family.
2.2 Applications
Application Description
Intra-Domain Interworking OSPF runs within the AS, which is divided into several areas.
Inter-Domain Interworking Several ASs are interconnected. OSPF runs within each AS, and Border Gateway
Protocol (BGP) runs between ASs.
OSPF runs within the AS. If the number of routers exceeds 40, it is recommended that the AS be divided into several areas.
Generally, high-end devices featuring reliable performance and fast processing speed are deployed in a backbone area, and
low-end or medium-range devices with relatively lower performance can be deployed in a normal area. All normal areas must
be connected to the backbone area. It is recommended that a normal arealocated on the stub be configured as a stub area.
As shown in Figure 2-1, the network is divided into four areas. Communication between these areas must go through the
backbone area, that is area 0.
2-2
Configuration Guide Configuring OSPFv2
Remarks A, B, C, D, E, and H are located in the backbone area, and are backbone routers.
Area 3 is configured as a stub area.
Deployment
Several ASs are interconnected. OSPF runs within each AS, and BGP runs between ASs.Generally, OSPF and BGP learn
the routing information from each other.
As shown in Figure 2-2, unicast routing is implemented within AS 100 and AS 200 using OSPF, and between the two ASs
using BGP.
2-3
Configuration Guide Configuring OSPFv2
Deployment
2.3 Features
Basic Concepts
Routing Domain
All routers in an AS must be interconnected and use the same routing protocol. Therefore, the AS is also called routing
domain.
An AS on which OSPF runs is also called OSPF routing domain, or OSPF domain for short.
OSPF Process
OSPF supports multiple instances, and each instance corresponds to an OSPF process.
One or more OSPF processes can be started on a router. Each OSPF process runs OSPF independently, and the processes
are mutually isolated.
The process ID takes effect only on the local router, and does not affect exchange of OSPF packets on adjacent interfaces.
RouterID
The router ID uniquely identifies a router in an OSPF domain. Router IDs of any two routers cannot be the same.
If multiple OSPF processes exist on a router, each OSPF process uses one router ID. Router IDs of any two OSPF
processes cannot be the same.
Area
2-4
Configuration Guide Configuring OSPFv2
OSPF supports multiple areas. An OSPF domain is divided into multiple areas to ease the computing pressure of a
large-scale network.
An area is a logical group of routers, and each group is identified by an area ID. The border between areas is a router. A
router may belong to one area or multiple areas. One network segment (link) can belong to only one area, or each
OSPF-enabled interface must belong to a specified area.
Area 0 is the backbone area, and other areas are normal areas. Normal areas must be directly connected to the backbone
area.
OSPF Router
The following types of routers are defined in OSPF, and assigned with different responsibilities:
Internal router
All interface of an interval router belong to the same OSPF area. As shown in Figure 1-3, A, C, F, G, I, M, J, K, and L are
internal routers.
Backbone router
A backbone router has at least one interface that belongs to the backbone area. All ABRs and all routers in area 0 are
backbone routers. As shown in Figure 2-3, A, B, C, D, E, and H are backbone routers.
2-5
Configuration Guide Configuring OSPFv2
Virtual Link
OSPF supports virtual links. A virtual link is a logical link that belongs to the backbone area. It is used to resolve the problems
such as a discontinuous backbone area or a failure to directly connect a normal area to the backbone area on the physical
network. A virtual link supports traversal of only one normal area, and this area is called transit area. Routers on both ends of
a virtual link are ABRs.
As shown in Figure 2-4, a virtual link is set up between A and B to connect two separated area 0s. Area 1 is a transit area,
and A and B are ABRs of area 1.
Figure 2-5Failure to Directly Connect a Normal Area to the Backbone Areaon the Physical Network
As shown in Figure 2-4, a virtual link is set up between A and B to extend area 0 to B so that area 0 can be directly connected
to area 2 on B. Area 1 is a transit area, A is an ABR of area 1, and B is an ABR of area 0 and area 2.
LSA
OSPF describes the routing information by means of Link State Advertisement (LSA).
2-6
Configuration Guide Configuring OSPFv2
Type 9 LSAs are only advertised within the network segment where interfaces
resides. The Grace LSA used to support graceful restart (GR) is one of Type 9
LSAs.
Type 10 LSAs are advertised within an area. The LSA used to support Traffic
Engineering (TE) is one of Type 10 LSAs.
Type 11 LSAs are advertised within an AS. At present, there are no application
examples of Type 11 LSAs.
Stub areas, NSSA areas, totally stub areas, and totally NSSA areas are special forms of normal areas and help reduce
the load of routers and enhance reliability of OSPF routes.
OSPF Packet
The following table lists the protocol packets used by OSPF. These OSPF packets are encapsulated in IP packets and
transmitted in multicast or unicast mode.
Overview
2-7
Configuration Guide Configuring OSPFv2
Feature Description
Link-State Routing Protocols Run OSPF on the router to obtain routes to different destinations on the network.
OSPF Route Management Plan or optimize OSPF routes through manual configuration to implement management of
OSPF routes.
Enhanced Security and Use functions such as authentication and bidirectional forwarding detection (BFD) correlation
Reliability to enhance security, stability, and reliability of OSPF.
Network Management Use functions such as the management information base (MIB) and Syslog to facilitate OSPF
management.
Working Principle
Routers send Hello packets through all OSPF-enabled interfaces (or virtual links). If Hello packets can be exchanged
between two routers, and parameters carried in the Hello packets can be successfully negotiated, the two routers become
neighbors. Routers that are mutually neighbors find their own router IDs from Hello packets sent from neighbors, and
bidirectional communication is set up.
A Hello packet includes, but is not limited to, the following information:
Neighbor dead interval of the originating router interface (or virtual link)
2-8
Configuration Guide Configuring OSPFv2
After bidirectional communication is set up between neighbor routers, the DD, LSR, LSU, and LSAck packets are used to
exchange LSAs and set up the adjacency. The brief process is as follows:
The LSA is exchanged between neighbors. When a router receives the LSA from its neighbor, it copies the LSA and
saves the copy in the local LSDB, and then advertises the LSA to other neighbors.
When the router and its neighbors obtain the same LSDB, full adjacency is achieved.
OSPF will be very quiet without changes in link costs or network addition or deletion. If any change takes place, the
changed link states are advertised to quickly synchronize the LSDB.
After the complete LSDB is obtained from the router, the Dijkstra algorithm is run to generate an SPT from the local router to
each destination network. The SPT records the destination networks, next-hop addresses, and costs. OSPF generates a
routing table based on the SPT.
If changes in link costs or network addition or deletion take place, the LSDB will be updated. The router again runs the
Dijkstra algorithm, generates a new SPT, and updates the routing table.
The Dijkstra algorithm is used to find a shortest path from a vertex to other vertices in a weighted directed graph.
A router does not necessarily need to exchange LSAs with every neighbor and set upan adjacency with every neighbor. To
improve efficiency, OSPF classifies networks that use various link layer protocols into five types so that LSAs are exchanged
in different ways to set upan adjacency:
Broadcast
Neighbors are discovered, and the DR and BDR are elected.
The DR (or BDR) exchanges LSAs with all other routers to set up an adjacency. Except the DR and BDR, all other
routers do not exchange LSAs with each other, and the adjacency is not set up.
Ethernet and fiber distributed data interface (FDDI) belong to the broadcast network type by default.
Point-to-point (P2P)
Neighbors are automatically discovered, and the DR or BDR is not elected.
LSAs are exchanged between routers at both ends of the link, and the adjacency is set up.
PPP,HDLC, and LAPB belongs to the P2P network type by default.
2-9
Configuration Guide Configuring OSPFv2
Point-to-multipoint (P2MP)
Neighbors are automatically discovered, and the DR or BDR is not elected.
LSAs are exchanged between any two routers, and the adjacency is set up.
Networks without any link layer protocol belong to the P2MP network type by default. P2MP broadcast
Neighbors are manually configured, and the DR or BDR is not elected.
LSAs are exchanged between any two routers, and the adjacency is set up.
Networks without any link layer protocol belong to the P2MP network type by default.
Figure 2-6
Display the OSPF routes (marked in red) in the routing table of Router A.
A#show ip route
2-10
Configuration Guide Configuring OSPFv2
A mark is displayed in front of each OSPF route to indicate the type of the route. There are six types of OSPF routes:
O: Intra-area route
This type of route describes how to arrive ata destination network in the local area. The cost of this type of route is equal
to the cost of the route from the local router to the destination network.
Reliability of E2 and N2 routes is poor. OSPF believes that the cost of the route from the ASBR to a destination outside
an AS is far greater than the cost of the route to the ASBR within the AS. Therefore, when the route cost is computed,
only the cost of the route from the ASBR to a destination outside an AS is considered.
Related Configuration
Enabling OSPF
2-11
Configuration Guide Configuring OSPFv2
Run the router ospf 1 command to create an OSPF process on the router.
Run the network area command to enable OSPF on the interface and specify the area ID.
Run the area virtual-link command to create a virtual link on the router. The virtual link can be treated as a logical interface.
Router ID
By default, the OSPF process elects the largest IP address among the IP addresses of all the loopback interfaces as the
router ID. If the loopback interfaces configured with IP addresses are not available, the OSPF process elects the largest IP
address among the IP addresses of all the loopback interfaces as the router ID.
Alternatively, you can run the router-id command to manually specify the router ID.
Run the ip ospf hello-interval command to modify the Hello interval on the interface. The default value is 10s (or 30s for
NBMA networks).
Run the ip ospf dead-interval command to modify the neighbor dead interval on the interface. The default value is four
times the Hello interval.
Use the poll-interval parameter in the neighbor command to modify the neighbor polling interval on the NBMA interface.
The default value is 120s.
Run the ip ospf transmit-delay command to modify the LSU packet transmission delay on the interface. The default value is
1s.
Run the ip ospf retransmit-interval command to modify the LSU packet retransmission interval on the interface. The default
value is 5s.
Use the hello-interval parameter in the area virtual-linkcommand to modify the Hello interval on the virtual link. The default
value is 10s.
Use the dead-interval parameter in the area virtual-linkcommand to modify the neighbor dead interval on the virtual link.
The default value is four times the Hello interval.
Use the transmit-delay parameter in the area virtual-linkcommand to modify the LSU packet transmission delay on the
virtual link. The default value is 1s.
Use the retransmit-interval parameter in the area virtual-linkcommand to modify the LSU packet retransmission interval on
the virtual link. The default value is 5s.
Run the timers throttle lsa all command to modify parameters of the exponential backoff algorithm that generates LSAs.
The default values of these parameters are 0 ms, 5000 ms, and 5000 ms.
Run the timerspacinglsa-group command to modify the LSA group update interval. The default value is 30s.
Run the timers pacing lsa-transmit command to modify the LS-UPD packet sending interval and the number of sent
LS-UPD packets. The default values are 40 ms and 1.
Run the timers lsa arrival command to modify the delay after which the same LSA is received. The default value is 1000 ms.
2-12
Configuration Guide Configuring OSPFv2
Run the timers throttle spf command to modify the SPT computation delay, minimum interval between two SPT
computations, and maximum interval between two SPT computations. The default values are 1000 ms, 5000 ms, and 10000
ms.
By default, Ethernet and FDDI belong to the broadcast type, X.25, frame relay, and ATM belong to the NBMA type, and PPP,
HDLC, and LAPB belong to the P2P type.
Run the ip ospf network command to manually specify the network type of an interface.
Run the neighbor command to manually specify a neighbor. For the NBMA and P2MP non-broadcast types, you must
manually specify neighbors.
Run the ip ospf priority command to adjust the priorities of interfaces, which are used for DR/BDR election. The DR/BDR
election is required for the broadcast and NBMA types. The router with the highest priority wins in the election, and the router
with the priority of 0 does not participate in the election. The default value is 1.
Working Principle
The (totally) stub and (totally)NSSA areas help reduce the protocol interaction load and the size of the routing table.
If an appropriate area is configured as a (totally) stub or NSSA area, advertisement of a large number of Type 5 and
Type 3 LSAs can be avoided within the area.
Area Type1 and Type 3 LSA Type 4 LSA Type 5 LSA Type 7 LSA
Type2 LSAs
Non (totally) stub area and Allowed Allowed Allowed Allowed Not allowed
NSSA area
Stub area Allowed Allowed (containing one Not allowed Not allowed Not allowed
default route)
Totally stub area Allowed Only one default route is Not allowed Not allowed Not allowed
allowed.
NSSA area Allowed Allowed (containing one Allowed Not allowed Allowed
default route)
Totally NSSA area Allowed Only one default route is Allowed Not allowed Allowed
allowed.
The ABR uses Type 3LSAs to advertise a default route to the (totally) stub or NSSA area.
The ABR converts Type 7 LSAs in the totally NSSA area to Type 5LSAs, and advertise Type5LSAs to the backbone
area.
2-13
Configuration Guide Configuring OSPFv2
If an area is appropriately configured as a (totally) stub area or an NSSA area, a large number of E1, E2, and IA routes
will not be added to the routing table of a router in the area.
Area Routes Available in the Routing Table of a Router Inside the Area
Non (totally) stub area and O: a route to a destination network in the local area
NSSA area IA: a route to a destination network in another area
E1 or E2: a route or default route to a destination network segment outside the AS (via any
ASBR in the AS)
Stub area O: a route to a destination network in the local area
IA: a route or a default route to a destination network in another area
Totally stub area O: a route to a destination network in the local area
IA: a default route
NSSA area O: a route to a destination network in the local area
IA: a route or a default route to a destination network in another area
N1 or N2: a route or default route to a destination network segment outside the AS (via any
ASBR in the local area)
Totally NSSA area O: a route to a destination network in the local area
IA: a default route
N1 or N2: a route or default route to a destination network segment outside the AS (via any
ASBR in the local area)
Route Redistribution
Route redistribution refers to the process of introducing routes of other routing protocols, routes of other OSPF processes,
static routes, and direct routes that exist on the device to an OSPF process so that these routes can be advertised to
neighbors using Type 5 and Type 7 LSAs. A default route cannot be introduced during route redistribution.
Route redistribution is often used for interworking between ASs. You can configure route redistribution on an ASBR to
advertise routes outside an AS to the interior of the AS, or routes inside an AS to the exterior of the AS.
By configuring a command on an ASBR, you can introduce a default route to an OSPF process so that the route can be
advertised to neighbors using Type 5 and Type 7 LSAs.
Default route introduction is often used for interworking between ASs. One default route is used to replace all the routes
outside an AS.
Route Summarization
Route summarization is a process of summarizing routing information with the same prefix into one route, and advertising the
summarized route (replacing a large number of individual routes) to neighbors. Route summarization helps reduce the
protocol interaction load and the size of the routing table.
By default, the ABR advertises inter-area routing information by using Type3 LSAs within a network segment, and advertises
redistributed routing information by using Type 5 and Type 7 LSAs.If continuous network segments exist, it is recommended
that you configure route summarization.
2-14
Configuration Guide Configuring OSPFv2
When configuring route summarization, the summarization range may exceed the actual network scope of routes. If data is
sent to a network beyond the summarization range, a routing loop may be formed and the router processing load may
increase.To prevent these problems, the ABR or ASBR automatically adds a discard route to the routing table. This route will
not be advertised.
Route Filtering
OSPF supports route filtering to ensure security and facilitate control when the routing information is being learned,
exchanged, or used.
Using configuration commands, you can configure route filtering for the following items:
Interface: The interface is prevented from sending routing information (any LSAs) or exchanging routing information
(any LSAs) with neighbors.
Routing information advertised between areas: Only the routing information that meets the filtering conditions can be
advertised to another area (Type 3 LSAs).
Routing information outside an AS: Only the routing information that meets the filtering conditions can be redistributed
to the OSPF process(Type 5 and Type 7 LSAs).
LSAs received by a router: In the OSPF routing table, only the routes that are computed based on the LSAs meeting the
filtering conditions can be advertised.
Route Cost
If redundancy links or devices exist on the network, multiple paths may exist from the local device to the destination network.
OSPF selects the path with the minimum total cost to form an OSPF route. The total cost of a path is equal to the sum of the
costs of individual links along the path.The total cost of a path can be minimized by modifying the costs of individual links
along the path. In this way, OSPF selects this path to form a route.
Cost from an interface to a directly connected network segment and cost from the interface to a neighbor
Costfrom an ABR to the inter-area summarization network segment and cost from the ABR to the default network
segment
Costfrom an ASBR to an external network segment and cost from the ASBR to the default network segment
Both the cost and the metric indicate the cost and are not differentiated from each other.
The administrative distance (AD) evaluates reliability of a route, and the value is an integer ranging from 0 to 255. A smaller
AD value indicates that the route is more trustworthy. If multiples exist to the same destination, the route preferentially
selects a route with a smaller AD value. The route with a greater AD value becomes a floating route, that is, a standby route
of the optimum route.
By default, the route coming from one source corresponds to an AD value. The AD value is a local concept. Modifying the AD
value affects route selection only on the current router.
2-15
Configuration Guide Configuring OSPFv2
Route Directly-Co Static EBGP OSPF IS-IS RIP Route IBGP Unreachab
Source nnected Route Route Route Route Route le Route
Network
Default AD 0 1 20 110 115 120 200 255
Related Configuration
Run the area stub command to configure a specified area as a stub area.
Run the area nssa command to configure a specified area as an NSSA area.
A transit area (with virtual links going through) cannot be configured as a stub or an NSSA area.
By default, routes are not redistributed and the default route is not introduced.
After configuring route redistribution and default route introduction, the route automatically becomes an ASBR.
Route Summarization
By default, routes are not summarized. If route summarization is configured, a discard route will be automatically added.
Run the arearange command to summarize routes distributed between areas (Type 3 LSA) on the ABR.
Run the summary-address command to summarize redistributed routes (Type 5 and Type 7 LSAs) on the ASBR.
Run the discard-route command to add a discard route to the routing table.
Route Filtering
Run the passive-interface command to configure a passive interface. Routing information (any LSAs) cannot be exchanged
on a passive interface.
Run the ip ospfdatabase-filter all out command to prohibit an interface from sending routing information (any LSAs).
Run the area filter-list command to filter routing information advertised between areas on the ABR. Only the routing
information that meets the filtering conditions can be advertised to another area (Type 3 LSAs).
Use the route-map parameter in the redistribute command, or use the distribute-list out command to filter the external
routing information of the AS on the ASBR. Only the routing information that meets the filtering conditions can be
redistributed to the OSPF process (Type 5 and Type 7 LSAs).
2-16
Configuration Guide Configuring OSPFv2
Run the distribute-list in command to filter LSAs received by the router. In the OSPF routing table, only the routes that are
computed based on the LSAs meeting the filtering conditions can be advertised.
Route Cost
Cost from the interface to the directly-connected network segment (cost on the interface)
The default value is the auto cost. Auto cost = Reference bandwidth/Interface bandwidth
Run the auto-costreference-bandwidth command to set the reference bandwidth of auto cost. The default value is
100 Mbps.
Run the ip ospf cost command to manually set the cost of the interface. The configuration priority of this item is higher
than that of the auto cost.
Cost from the interface to a specified neighbor (that is, cost from the local device to a specified neighbor)
The default value is the auto cost.
Use the cost parameter in the neighbor command to modify the cost from the interface to a specified neighbor. The
configuration priority of this item is higher than that of the cost of the interface.
This configuration item is applicable only to P2MP-type interfaces.
Cost from the ABR to the inter-area summarization network segment (that is, the cost of the summarized inter-area
route)
If OSPF routing is compatible with RFC1583, the default value is the minimum cost among all costs of the summarized
links; otherwise, the default value is the maximum cost among all costs of the summarized links.
Run the compatible rfc1583 command to make OSPF routing compatible with RFC1583. By default, OSPF routing is
compatible with RFC1583.
Use the cost parameter in the area range command to modify the cost of inter-area route summarization.
Cost from the ABR to the default network segment (that is, the cost of the default route that is automatically advertised
by the ABR to the stub or NSSA areas)
The default value is 1.
Run the area default-cost command to modify the cost of the default route that the ABR automatically advertise to the
stub or NSSA areas.
Cost from the ASBR to an external network segment (that is, the metric of an external route)
By default, the metric of a redistributed BGP route is 1, the metric of other types of redistributed routes is 20, and the
route type is Type 2 External.
Run the default-metric command to modify the default metric of the external route.
Use the metric,metric-type and route-map parameters in the redistribute command to modify the metric and route
type of the external route.
Cost from the ASBR to the default network segment (that is, the metric of the default route that is manually introduced)
By default, the metric is 1, and the route type is Type 2 External.
Use the metric,metric-type and route-map parameters in the default-information originate command to modify the
metric and route type of the default route that is manually introduced.
Use the metric and metric-type parametersofdefault-information originatein the area nssa command to modify the
metric and type of the default route that is manually introduced to the NSSA area.
2-17
Configuration Guide Configuring OSPFv2
Run the max-metric router-lsa command to set metrics of all routes advertised on the router to the maximum value. In
this way, the total cost of any path that passes through this router will become very large, and the path can hardly
become the shortest path.
Working Principle
Authentication
Authentication prevents routers that illegally access the network and hosts that forge OSPF packet from participating in the
OSPF process. OSPF packets received on the OSPF interface (or at both ends of the virtual link) are authenticated. If
authentication fails, the packets are discarded and the adjacency cannot be set up.
Enabling authentication can avoid learning unauthenticated or invalid routes, thus preventing advertising valid routes to
unauthenticated devices. In the broadcast-type network, authentication also prevents unauthenticated devices from
becoming designated devices, ensuring stability of the routing system and protecting the routing system against intrusions.
MTU Verification
On receiving a DD packet, OSPF checks whether the MTU of the neighbor interface is the same as the MTU of the local
interface. If the MTU of the interface specified in the received DD packet is greater than the MTU of the interface that
receives the packet, the adjacency cannot be set up. Disabling MTU verification can avoid this problem.
Generally, the source address of a packet received by OSPF is in the same network segment as the receiving interface. The
addresses at both ends of a P2P link are configured separately and are not necessarily in the same network segment. In this
scenario, as the peer address information will be notified during the P2P link negotiation process, OSPF checks whether the
source address of the packet is the address advertised by the peer during negotiation. If not, OSPF determines that the
packet is invalid and discards this packet. In particular, OSPF does not verify the address of an unnumbered interface.
In some scenarios, the source address of a packet received by OSPF maynot be in the same network segment as the
receiving interface, and therefore OSPF address verification fails. For example, the negotiated peer address cannot be
obtained on a P2P link. In this scenario, source address verification must be disabled to ensure that the OSPF adjacency can
be properly set up.
Two-Way Maintenance
2-18
Configuration Guide Configuring OSPFv2
OSPF routers periodically send Hello packets to each other to maintain the adjacency. On a large network, a lot of packets
may be sent or received, occupying too much CPU and memory. As a result, some packets are delayed or discarded. If the
processing time of Hello packets exceeds the dead interval, the adjacency will be destroyed.
If the two-way maintenance function is enabled, in addition to the Hello packets, the DD, LSU, LSR, and LSAck packets can
also be used to maintain the bidirectional communication between neighbors, which makes the adjacency more stable.
When a router simultaneously exchanges data with multiple neighbors, its performance may be affected. If the maximum
number of neighbors that concurrently initiate or accept interaction with the OSPF process, the router can interact with
neighbors by batches, which ensures data forwarding and other key services.
Overflow
OSPF requires that routers in the same area store the same LSDB. The number of routers keeps increasing on the network.
Some routers, however, cannot store so much routing information due to the limited system resources. The large amount of
routing information may exhaust the system resources of routers, causing failures of the routers.
The overflow function limit the number of external routes in the LSDB to control the size of the LSDB.
When the number of external routes on a router exceeds the upper limit, the router enters the overflow state. The router
deletes the external routes generated by itself from the LSDB, and does not generate new external routes. In addition, the
router discards the newly received external routes. After the overflow state timer (5s) expires, if the number of external routes
is lower than the upper limit, the normal state is restored.
GR
The control and forwarding separated technology is widely used among routers. On a relatively stable network topology,
when a GR-enabled router is restarted on the control plane, data forwarding can continue on the forwarding plane. In
addition, actions (such as adjacency re-forming and route computation) performed on the control plane do not affect
functions of the forwarding plane. In this way, service interruption caused by route flapping can be avoided, thus enhancing
reliability of the entire network.
Currently, the GR function is used only during active/standby switchover and system upgrade.
2-19
Configuration Guide Configuring OSPFv2
The GR process requires collaboration between the restarter and the helper. The restarter is the router where GR
occurs. The helper is a neighbor of the restarter.
When entering or exiting the GR process, the restarter sends a Grace-LSA to the neighbor, notifying the neighbor to
enter or exit the helper state.
When the adjacency between the restarter and the helper reaches the Full state, the router can exit the GR process
successfully.
After a link fault occurs, OSPF senses the death of the neighbor only after a period of time (about 40s). Then, OSPF
advertises the information and re-computes the SPT. During this period, traffic is interrupted.
After the fast Hello function is enabled (that is, the neighbor dead interval is set to 1s), OSPF can sense the death of a
neighbor within 1s once a link is faulty. This greatly accelerates route convergence and prevents traffic interruption.
BFD is used to test connectivity between devices. A link fault can be detected in as short as 150 ms. After OSPF is
correlated with BFD, OSPF can sense the death of a neighbor in as short as 150 ms once a link is faulty. This greatly
accelerates route convergence and prevents traffic interruption.
Fast reroute prepares a standby route for OSPF. Once the OSPF senses the death of a neighbor, the traffic is
immediately switched over to the standby route, thus preventing traffic interruption.
2-20
Configuration Guide Configuring OSPFv2
iSPF
The OSPF topology is area based. The SPF algorithm is run for independent computation in each area. The standard
SPF algorithm re-computes the topology of the entire area each time even if only the leave nodes change in the area
topology.
When computing the network topology, the incremental SPF (iSPF) corrects only the nodes on the SPT that are
affected by the topological changes, and does not re-build the entire SPT. This can effectively ease the pressure on the
router processors on a large network, especially when the network is not stable.
Related Configuration
Run the areaauthentication command to enable the authentication function in the entire area so that the function takes
effect on all interfaces in this area. If authentication is enabled in area 0, the function takes effect on the virtual link.
Run the ip ospf authentication command to enable authentication on an interface. This configuration takes
precedence over the area-based configuration.
Run the ip ospf authentication-key command to set the text authentication key on an interface.
Run the ip ospfmessage-digest-key command to set the message digest 5 (MD5) authentication key on an interface.
Use the authentication parameter in the area virtual-link command to enable authentication at both ends of a virtual
link. This configuration takes precedence over the area-based configuration.
Use the authentication-key parameter in the area virtual-link command to set the text authentication key at both ends
of a virtual link.
Use the message-digest-key parameter in the area virtual-link command to set the MD5 authentication key at both
ends of a virtual link.
MTU Verification
Run the ip ospf source-check-ignore command to disable source address verification on an interface.
Two-Way Maintenance
2-21
Configuration Guide Configuring OSPFv2
Run the max-concurrent-dd command to modify the maximum number of neighbors that are concurrently interacting with
the current OSPF process. The default value is 5.
Run the ip router ospf max-concurrent-dd command to modify the maximum number of neighbors that are concurrently
interacting with all OSPF processes on the router. The default value is 10.
Overflow
Run the overflow memory-lack command to allow the router to enter the overflow state when the memory is insufficient. By
default, the router is allowed to enter the overflow state when the memory is insufficient.
Run the overflow database command to allow the router to enter the overflow state when the number of LSAs is too large.
By default, the router is not allowed to enter the overflow state when the number of LSAs is too large.
Run the overflow database external command to allow the router to enter the overflow state when the number of
externalLSAs is too large. By default, the router is not allowed to enter the overflow state when the number of external-LSAs
is too large.
GR
By default, the restarter function is disable, and the helper function is enabled.
Fast Hello
Run the ip ospf dead-intervalminimal hello-multiplier command to enable the Fast Hello function on an interface, that is,
the neighbor dead interval is 1s.
Run the bfd interval min_rx multiplier command to set the BFD parameters.
Run the bfd all-interfaces command to correlate OSPF with BFD on all interfaces.
Run the ip ospf bfd command to correlate OSPF with BFD on the current interface.
Fast Reroute
Run the fast-reroute route-map command to enable fast reroute on an OSPF process so that the standby route defined in
the route map can be used.
Run the fast-reroute lfa command to enable fast reroute on an OSPF process so that the standby route can be computed by
using the loop-free standby path.
Run the fast-reroute lfadownstream-paths command to enable fast reroute on an OSPF process so that the standby route
can be computed by using the downstream path.
2-22
Configuration Guide Configuring OSPFv2
Run the set fast-reroute backup-interfacebackup-nexthop command to define a standby route in the route map.
Run the ip ospf fast-reroute protection command to specify theloop-freealternate(LFA) protection mode of an interface.
Run the ip ospf fast-reroute no-eligible-backup command to prevent an interface from becoming a standby interface.
iSPF
Run the ispf enable command to enable iSPF on the OSPF process.
Working Principle
MIB
MIB is the device status information set maintained by a device. You can use the management program to view and set the
MIB node.
Multiple OSPF processes can be simultaneously started on a router, but the OSPF MIB can be bound with only one OSPF
process.
Trap
A Trap message is a notification generated when the system detects a fault. This message contains the related fault
information.
If the Trap function is enabled, the router can proactively send the Trap messages to the network management device.
Syslog
The Syslog records the operations (such as command configuration) performed by users on routers and specific events
(such as network connection failures).
If the Syslog is allowed to record the adjacency changes, the network administrator can view the logs to learn the entire
process that the OSPF adjacency is set up and maintained.
Related Configuration
MIB
By default, the MIB is bound with the OSPF process with the smallest process ID.
Run the enable mib-binding command to bind the MIB with the current OSPF process.
Trap
By default, all traps are disabled, and the device is not allowed to send OSPF traps.
Run the enable traps command to enable a specified trap for an OSPF process.
2-23
Configuration Guide Configuring OSPFv2
Run the snmp-server enable traps ospf command to allow the device to send OSPF traps.
SYSLOG
Run the log-adj-changes command to allow the Syslog to record the adjacency changes.
2.4 Configuration
(Optional) The configurations are mandatory if the physical network is the X.25, frame relay,
or ATM network.
Setting the Network Type
ip ospf network Defines the network type.
neighbor Specifies a neighbor.
ip ospf priority Configures the DR priority.
(Optional) The configurations are recommended if the OSPF routing domain is connected
Configuring Route
with an external network.
Redistribution and
Default Route redistribute Configures route redistribution.
default-information originate Introduces a default route.
(Optional) It is used to reduce interaction of routing information and the size of routing table,
Configuring Stub Area and enhance stability of routes.
and NSSA Area
areastub Configures a stub area.
areanssa Configures an NSSA area.
(Optional) It is used to reduce interaction of routing information and the size of routing table,
and enhance stability of routes.
2-24
Configuration Guide Configuring OSPFv2
(Optional) It is used to manually control interaction of routing information and filter available
OSPF routes.
(Optional) It is used to manually control the shortest route computed by OSPF and determine
whether to select an OSPF route preferentially.
(Optional) It is used to prevent routers that illegally access the network and hosts that forge
OSPF packets from participating in the OSPF protocol process.
(Optional) It is used to prevent the problem that OSPF processes stop running due to
Enabling Overflow
over-consumption of the memory.
2-25
Configuration Guide Configuring OSPFv2
(Optional) It is used to prevent the problem that the adjacency cannot be set up due to the
Disabling Source failure to obtain the peer address.
Address Verification
Disables source address verification on an
ip ospf source-check-ignore
interface.
(Optional) It is used to prevent the problem that the adjacency cannot be set up due to MTU
Disabling MTU
inconsistency on the neighbor interface.
Verification
ip ospf mtu-ignore Disables MTU verification on an interface.
(Optional) It is used to prevent termination of the adjacencydue to the delay or loss of Hello
Enabling Two-Way
packets.
Maintenance
two-way-maintain Enables two-way maintenance.
(Optional) It is used to quickly discover the death of a neighbor to prevent traffic interruption
when a link is faulty.
Correlating OSPF with
bfd interval min_rx multiplier Sets BFD parameters.
BFD
bfd all-interfaces Correlates OSPF with BFD on all interfaces.
Correlates OSPF with BFD on the current
ip ospf bfd
interface.
2-26
Configuration Guide Configuring OSPFv2
(Optional) It is used to quickly switch over services to the standby route to prevent traffic
interruption.
(Optional) It is used to enable the incremental topology computation to ease the pressure on
Enabling iSPF the processor.
(Optional) The configurations enable users to use the SNMP network management software
to manage OSPF.
(Optional) You are advised not to modify protocol control parameters unless necessary.
2-27
Configuration Guide Configuring OSPFv2
Set up an OSPF routing domain on the network to provide IPv4 unicast routing service for users on the network.
Notes
Ensure that the IP unitcast routing function is enabled, that is, ip routing is not disabled; otherwise, OSPF cannot be
enabled.
After ip ospf disable all is configured, the interface neither sends or receives any OSPF packet, nor participates in
OSPF computation even if the interface belongs to the network.
Configuration Steps
Mandatory.
Configuring a Router ID
(Optional) It is strongly recommended that you manually configure the router ID.
If the router ID is not configured, OSPF selects an interface IP address. If the IP address is not configured for any
interface, or the configured IP addresses have been used by other OSPF instances, you must manually configure the
router ID.
Mandatory.
2-28
Configuration Guide Configuring OSPFv2
Verification
Run the show ip route ospf command to verify that the entries of the OSPF routing table are correctly loaded.
Run the ping command to verify that the IPv4 unicast service is correctly configured.
Related Commands
Configuring a Router ID
Command router-idrouter-id
Parameter router-id: Indicates the router ID to be configured. It is expressed in the IP address.
Description
Command OSPF routing process configuration mode
Mode
Usage Guide Different OSPF processes are independent of each other, and can be treated as different routing protocols
that run independently.
Each OSPF process uses a unique router ID.
Command networkip-addresswildcardareaarea-id
Parameter ip-address: Indicates the IP address of the interface.
Description wildcard: Indicates the IP address comparison mode. 0 indicates accurate matching, and 1 indicates that no
comparison is performed.
area-id: Indicates the ID of an OSPF area. An OSPF area is always associated with an address range. To
facilitate management, you can use a subnet as the ID of an OSPF area.
Command OSPF routing process configuration mode
Mode
Usage Guide By defining ip-address and wildcard, you can use one command to associate multiple interfaces with one
OSPF area. To run OSPF on one interface, you must include the primary IP address of the interface in the
IP address range defined by network area. If the IP address range defined by network area contains only
the secondary IP address of the interface, OSPF does not run on this interface. If the interface address
matches the IP address ranges defined in the network commands of multiple OSPF processes, the OSPF
process that the interface is associated with is determined based on the best match method.
2-29
Configuration Guide Configuring OSPFv2
router-id is the ID of an OSPF neighbor router. If you are sure about the value of router-id, run the show ip
ospf neighbor command to confirm the value. You can configure the loopback address as the router ID.
The area virtual-link command defines only the authentication key of the virtual link. To enable OSPF
packet authentication in the areas connected to the virtual link, you must run the area authentication
command.
After the OSPF Fast Hello function is enabled, OSPF finds neighbors and detects neighbor failures faster.
2-30
Configuration Guide Configuring OSPFv2
You can enable the OSPF Fast Hello function by specifying the minimal and hello-multiplier keywords and
the multiplier parameter. The minimal keyword indicates that the death interval is set to 1s, and
hello-multiplier indicates the number of Hello packets sent per second. In this way, the interval at which the
Hello packet is sent decreases to less than 1s.
If the Fast Hello function is configured for a virtual link, the Hello interval field of the Hello packet advertised
on the virtual link is set to 0, and the Hello interval field of the Hello packet received on this virtual link is
ignored.
No matter whether the Fast Hello function is enabled, the death interval must be consistent and the
hello-multiplier values can be inconsistent on routers at both ends of the virtual link. Ensure that at least
one Hello packet can be received within the death interval.
Run the show ip ospf virtual-links command to monitor the death interval and Fast Hello interval
configured for the virtual link.
The dead-interval minimal hello-multiplier and hello-interval parameters introduced for the Fast Hello
function cannot be configured simultaneously.
Configuration Example
Scenario
Configuration
Configure the interface IP addresses on all routers.
Steps
Enable the IPv4 unicast routing function on all routers. (This function is enabled by default.)
2-31
Configuration Guide Configuring OSPFv2
A
A#configure terminal
A(config-if-GigabitEthernet 0/1)#exit
A(config-if-GigabitEthernet 0/2)#exit
A(config)#router ospf 1
A(config-router)#router-id192.168.1.1
B
B#configure terminal
B(config-if-GigabitEthernet 0/1)#exit
B(config-if-GigabitEthernet 0/2)#exit
B(config)#router ospf 1
B(config-router)#router-id192.168.1.2
C
C#configure terminal
C(config-if-GigabitEthernet 0/3)#exit
C(config)#router ospf 1
C(config-router)#router-id192.168.2.2
D
D#configure terminal
2-32
Configuration Guide Configuring OSPFv2
D(config-if-GigabitEthernet 0/3)#exit
D(config)#router ospf 1
D(config-router)#router-id192.168.3.2
Verification
Verify that the OSPF neighbors are correct on all routers.
A
A# show ip ospf neighbor
B
B# show ip ospf neighbor
C
C# show ip ospf neighbor
2-33
Configuration Guide Configuring OSPFv2
D
D# show ip ospf neighbor
D# ping 192.168.2.2
!!!!!
Common Errors
The network segment configured by the network command does not include the interface IP addresses.
The same interface IP address is configured on multiple routers, resulting in a running error of the OSPF network.
Run OSPF to provide the IPv4 unicast routing serviceif the physical network is X.25, frame relay, or ATM.
Notes
The broadcast network sends OSPF packets in multicast mode. Neighbors are automatically discovered, and the
DR/BDR election is required.
2-34
Configuration Guide Configuring OSPFv2
The P2P network sends OSPF packets in multicast mode. Neighbors are automatically discovered.
The NBMA network sends OSPF packets in unicast mode. Neighbors must be manually specified, and the DR/BDR
election is required.
The P2MP network (without the non-broadcast parameter) sends OSPF packets in multicast mode. Neighbors are
automatically discovered.
The P2MP network (with the non-broadcast parameter) sends OSPF packets in unicast mode. Neighbors must be
manually specified.
Configuration Steps
Optional.
Configuring Neighbors
(Optional) If the interface network type is set to NBMA or P2MP (with the non-broadcast parameter), neighbors must
be configured.
Neighbors are configured on routers at both ends of the NBMA or P2MP (with the non-broadcast parameter) network.
(Optional) You must configure the interface priority if a router must be specified as a DR, or a router cannot be specified
as a DR.
Configure the interface priority on a router that must be specified as a DR, or cannot be specified as a DR.
Verification
Run the show ip ospf interface command to verify that the network type of each interface is correct.
Related Commands
2-35
Configuration Guide Configuring OSPFv2
The NBMA type requires full-meshed connections, and all interconnected routers can directly communicate
with each other.
The P2MP type does not raise any requirement.
Configuring Neighbors
This command is applicable only to the OSPF broadcast and NBMA interfaces.
Configuration Example
2-36
Configuration Guide Configuring OSPFv2
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
A
A#configure terminal
B
B#configure terminal
C
C#configure terminal
2-37
Configuration Guide Configuring OSPFv2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Common Errors
The network types configured on interfaces at two ends are inconsistent, causing abnormal route learning.
The network type is set to NBMA or P2MP (with the non-broadcast parameter), but neighbors are not specified.
In the OSPF domain, introduce a unicast route to other AS domains so that the unicast routing service to other AS
domainscan be provided for users in the OSPF domain.
In the OSPF domain, inject a default route to other AS domains so that the unicast routing service to other AS domains
can be provided for users in the OSPF domain.
Notes
Configuration Steps
(Optional) This configuration is required if external routes of the OSPF domain should be introduced to an ASBR.
2-38
Configuration Guide Configuring OSPFv2
(Optional) This configuration is required if the default route should be introduced to an ASBR so that other routers in the
OSPF domain access other AS domains through this ASBR by default.
Verification
On a router inside the OSPF domain, run the show ip route command to verify that the unicast routes to other AS
domains are loaded.
On a router inside the OSPF domain, run the show ip route command to verify that the default route to the ASBR is
loaded.
Run the ping command to verify that the IPv4 unicast service to other AS domains is correct.
Related Commands
Command redistribute {bgp | connected |isis[ area-tag ] |ospfprocess-id | rip | static}[ { level-1 | level-1-2 | level-2} ]
[ match {internal | external [1|2]| nssa-external [1|2]} ] [ metric metric-value] [ metric-type {1|2} ]
[ route-map route-map-name] [ subnets ] [ tagtag-value ]
Parameter bgp: Indicates redistribution from BGP.
Description connected: Indicates redistribution from direct routes.
isis [ area-tag ]: Indicates redistribution from IS-IS.area-tag specifies the IS-IS instance.
ospf process-id: Indicates redistribution from OSPF.process-id specifies an OSPF process. The value
ranges from 1 to 65,535.
rip: Indicates redistribution from RIP.
static: Indicates redistribution from static routes.
level-1 | level-1-2 | level-2: Used only when IS-IS routes are redistributed. Only the routes of the specified
level are redistributed. By default, only level-2 IS-IS routes can be redistributed.
match: Used only when OSPF routes are redistributed. Only the routes meeting the filtering conditions are
redistributed. By default, all OSPF routes can be redistributed.
metric metric-value: Specifies the metric of the OSPF external LSA. metric-value specifies the size of the
metric. The value ranges from 0 to 16,777,214.
metric-type { 1 | 2 }: Setsthe external route type, which can be E-1 or E-2.
route-map route-map-name: Setsthe redistribution filtering rules.
subnets: Specifiesthe non-standard networks for redistribution.
tag tag-value: Specifies the tag value of the route that is redistributed into the OSPF routing domain. The
value ranges from 0 to 4,294,967,295.
Command OSPF routing process configuration mode
Mode
Usage Guide After this command is configured, the router becomes an ASBR, imports related routing information to the
OSPF domain, and advertises the routing information as Type 5 LSAs to other OSPF routers in the domain.
2-39
Configuration Guide Configuring OSPFv2
If you configure redistribution of IS-IS routes without specifying the level parameter, only level-2 routes can
be redistributed by default. If you specify the level parameter during initial configuration of redistribution,
routes of the specified level can be redistributed. If both level-1 and level-2 are configured, the two levels
are combined and saved as level-1-2. For details, see the configuration example.
If you configure redistribution of OSPF routes without specifying the match parameter, OSPF routes of all
sub-types can be distributed by default. The latest setting of the match parameter is used as the initial
match parameter. Only routes that match the sub-types can be redistributed. You can use the no form of
the command to restore the default value of match. For details, see the configuration example.
If route-map is specified, the filtering rules specified in route-map are applicable to original parameters of
redistribution. For redistribution of OSPF or IS-IS routes, the routemap is used for filtering only when the
redistributed routes meet criteria specified by match or level.
The set metric value associated with route-map should fall into the range of 0 to 16,777,214. If the value
exceeds this range, routes cannot be introduced.
The configuration rules for the no form of the redistribute command are as follows:
1. If some parameters are specified in the no form of the command, default values of these parameters will
be restored.
2. If no parameter is specified in the no form of the command, the entire command will be deleted.
For example, if redistribute isis 112 level-2 is configured, you can run the no redistribute isis 112 level-2
command to restore the default value of level-2.
As level-2 itself is the default value of the parameter, the configuration saved is still redistribute isis 112
level-2 after the preceding no form of the command is executed. To delete the entire command, run the no
redistribute isis 112 command.
2-40
Configuration Guide Configuring OSPFv2
OSPF link status database. The external link with the ID 0.0.0.0 describes the default route. On an OSPF
neighbor, you can run the show ip route command to see the default route.
The metric of the external default route can only be defined in the default-information originate command,
instead of the default-metric command.
OSPF has two types of external routes. The metric of the Type 1 external route changes, but the metric of
the Type 2 external route is fixed. If two parallel paths to the same destination have the same route metric,
the priority of the Type 1 route is higher than that of the Type 2 route. Therefore, the show ip route
command displays only the Type 1 route.
A router in the stub area cannot generate an external default route.
The set metric value associated with route-map should fall into the range of 0 to 16,777,214. If the value
exceeds this range, routes cannot be introduced.
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
2-41
Configuration Guide Configuring OSPFv2
D
D# configure terminal
D(config)#router ospf 1
Verification
On Router D, run the show ip ospf database external brief command to verify that an LSA
corresponding to an external route is generated.
On Router C, run the show ip route ospf command to verify that the external static route has been
introduced.
D
D# show ip ospf database external brief
C
C# show ip route ospf
Scenario
2-42
Configuration Guide Configuring OSPFv2
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
D
D# configure terminal
D(config)#router ospf 1
Verification
On Router D, run the show ip ospf database external brief command to verify that an LSA
corresponding to the default route is generated.
On Router C, run the show ip route ospf command to verify that the OSPF default route exists.
D
D#show ip ospf database external brief
C
C# show ip route ospf
Common Errors
The subnet route is not introduced because the subnets parameter in the redistribute command is not configured.
A routing loop is formed because the default-information originate always command is configured on multiple
routers.
Routes cannot be introduced because route redistribution is configured on a router in the stub area.
Configure an area located on the stub as a stub area to reduce interaction of routing information and the size of routing
table, and enhance stability of routes.
2-43
Configuration Guide Configuring OSPFv2
Notes
A router in the stub area cannot introduce external routes, but a router in the NSSA area can introduce external routes.
Configuration Steps
(Optional) This configuration is required if you wish to reduce the size of the routing table on routers in the area.
The area must be configured as a stub area on all routers in this area.
(Optional) This configuration is required if you wish to reduce the size of the routing table on routers in the area and
introduce OSPF external routes to the area.
The area must be configured as an NSSA area on all routers in this area.
Verification
On a router in the stub area, run the show ip route command to verify that the router is not loaded with any external
routes.
On a router in the NSSA area, run the show ip ospf database command to verify that the introduced external route
generates Type 7 LSAs.
On a router in the backbone area, run the show ip route command to verify that the router is loaded with external
routes introduced from the NSSA area.
Related Commands
2-44
Configuration Guide Configuring OSPFv2
routes of the OSPF routing domain, including the internal default route generated by an ABR. A router in the
stub area cannot learn external routes of the OSPF routing domain.
To configure a totally stub area, add the no-summary keyword when running the area stub command on
the ABR. A router in the totally stub area can learn only the internal routes of the local area, including the
internal default route generated by an ABR.
You can run either the area stub or area default-cost command to configure an OSPF area as a stub area.
If area stub is used, you must configure this command on all routers connected to the stub area. If area
default-cost is used, run this command only on the ABR in the stub area. The area default-cost command
defines the initial cost (metric) of the internal default route.
2-45
Configuration Guide Configuring OSPFv2
cost of the default route sent from the ABR/ASBR to the NSSA area. By default, the cost of the default route
sent to the NSSA area is 1.
If an NSSA area has two or more ABRs, the ABR with the largest router ID is elected by default as the
translator for converting Type 7 LSAs into Type 5 LSAs. If the current device is always the translator ABR for
converting Type 7 LSAs into Type 5 LSAs, use the translator always parameter.
If the translator role of the current device is replaced by another ABR, the conversion capability is retained
during the time specified by stability-interval. If the router does not become a translator again during
stability-interval, LSAs that are converted from Type 7 to Type 5 will be deleted from the AS after
stability-interval expires.
To prevent a routing loop, LSAs that are converted from Type 7 to Type 5 will be deleted from the AS
immediately after the current device loses the translator role even if stability-interval does not expire.
In the same NSSA area, it is recommended that translator always be configured on only one ABR.
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
2-46
Configuration Guide Configuring OSPFv2
D
D# configure terminal
D(config)#router ospf 1
A
A# configure terminal
A(config)#router ospf 1
A(config-router)#area 1 stubno-summary
C
C# configure terminal
C(config)#router ospf 1
C(config-router)#area 1 stub
Verification On Router C, run the show ip route ospf command to display the routing table. Verify that there is only one
default inter-area route, and no external static route is introduced from Router D.
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
2-47
Configuration Guide Configuring OSPFv2
B
B# configure terminal
B(config)#router ospf 1
B(config-router)#area 2 nssa
D
D# configure terminal
D(config)#router ospf 1
D(config-router)#area 2 nssa
Verification
On Router D, verify that the Type 7 LSA, 172.10.10.0/24, is generated.
D
D# show ip ospf database nssa-external
LS age: 61
LS Type: AS-NSSA-LSA
Checksum: 0xc8f8
Length: 36
TOS: 0
Metric: 20
2-48
Configuration Guide Configuring OSPFv2
B
B# show ip ospf database nssa-external
LS age: 314
LS Type: AS-NSSA-LSA
Checksum: 0xc8f8
Length: 36
TOS: 0
Metric: 20
LS age: 875
LS Type: AS-external-LSA
Checksum: 0xd0d3
Length: 36
2-49
Configuration Guide Configuring OSPFv2
TOS: 0
Metric: 20
Common Errors
Configurations of the area type are inconsistent on routers in the same area.
External routes cannot be introduced because route redistribution is configured on a router in the stub area.
Summarize routes to reduce interaction of routing information and the size of routing table, and enhance stability of
routes.
Notes
The address range of summarized routes may exceed the actual network range in the routing table. If data is sent to a
network beyond the summarization range, a routing loop may be formed and the router processing load may increase.
To prevent these problems, a discard route must be added to the routing table or shield or filter routes.
Configuration Steps
(Optional) This configuration is required when routes of the OSPF area need to be summarized.
Unless otherwise required, this configuration should be performed on an ABR in the area where routes to be
summarized are located.
(Optional) This configuration is required when routes external to the OSPF domain need to be summarized.
Unless otherwise required, this configuration should be performed on an ASBR to which routes to be summarized are
introduced.
Verification
2-50
Configuration Guide Configuring OSPFv2
Run the show ip route ospf command to verify that individual routes do not exist and only the summarized route exists.
Related Commands
2-51
Configuration Guide Configuring OSPFv2
When configured on the NSSA ABR translator, summary-address summarizes redistributed routes and
routes obtained based on the LSAs that are converted from Type 7 to Type 5. When configured on the
ASBR (not an NSSA ABR translator), summary-address summarizes only redistributed routes.
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
2-52
Configuration Guide Configuring OSPFv2
B
B# configure terminal
B(config)#router ospf 1
Verification On Router A, verify that the entry 172.16.0.0/16 is added to the routing table.
A
A#show ip route ospf
Common Errors
Inter-area route summarization cannot be implemented because the area range command is configured on a non-ABR
device.
Routes that do not meet filtering conditions cannot be loaded to the routing table, or advertised to neighbors. Network
users cannot access specified destination network.
Notes
Filtering routes by using the distribute-list in command affects forwarding of local routes, but does not affect route
computation based on LSAs. Therefore, if route filtering is configured on the ABR, Type 3 LSAs will still be generated
and advertised to other areas because routes can still be computed based on LSAs. As a result, black-hole routes are
generated. In this case, you can run the area filter-list or area range (containing the not-advertise parameter)
command on the ABR to prevent generation of black-hole routes.
Configuration Steps
(Optional) This configuration is recommended if users should be restricted from accessing the network in a certain
OSPF area.
Unless otherwise required, this configuration should be performed on an ABR in the area where filtered routes are
located.
(Optional) This configuration is required if external routes introduced by the ASBR need to be filtered.
Unless otherwise required, this configuration should be performed on an ASBR to which filtered routes are introduced.
2-53
Configuration Guide Configuring OSPFv2
(Optional) This configuration is required if users should be restricted from accessing a specified destination network.
Unless otherwise required, this configuration should be performed on a router that requires route filtering.
Verification
Run the show ip route command to verify that the router is not loaded with routes that have been filtered out.
Run the ping command to verify that the specified destination network cannot be accessed.
Related Commands
2-54
Configuration Guide Configuring OSPFv2
Command distribute-list { [ access-list-number | name ] | prefix prefix-list-name } out [bgp | connected |isis[area-tag]
| ospf process-id | rip | static]
Parameter access-list-number | name: Uses the ACL for filtering.
Description prefix prefix-list-name: Uses the prefixlist for filtering.
bgp | connected | isis [ area-tag ] | ospf process-id | rip | static: Indicates the source of routes to be
filtered.
Command OSPF routing process configuration mode
Mode
Usage Guide distribute-list out is similar to redistribute route-map, and is used to filter routes that are redistributed
from other protocols to OSPF. The distribute-list out command itself does not redistribute routes, and is
generally used together with the redistribute command. The ACL and the prefixlist filtering rules are
mutually exclusive in the configuration. That is, if the ACL is used for filtering routes coming from a certain
source, the prefixlist cannot be configured to filter the same routes.
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
2-55
Configuration Guide Configuring OSPFv2
Scenario
A
A# configure terminal
A(config)#router ospf 1
Verification
On Router A, check the routing table. Verify that only the entry 172.16.5.0/24 is loaded.
A
A# show ip route ospf
Common Errors
Filtering routes by using the distribute-list in command affects forwarding of local routes, but does not affect route
computation based on LSAs. Therefore, if route filtering is configured on the ABR, Type 3 LSAs will still be generated
and advertised to other areas because routes can still be computed based on LSAs. As a result, black-hole routes are
generated.
2-56
Configuration Guide Configuring OSPFv2
Change the OSPF routes to enable the traffic pass through specified nodes or avoid passing through specified nodes.
Change the sequence that a router selects routes so as to change the priorities of OSPF routes.
Notes
If you run the ip ospf cost command to configure the cost of an interface, the configured cost will automatically
overwrite the cost that is computed based on the auto cost.
Configuration Steps
Optional.
A router is connected with lines with different bandwidths. This configuration is recommended if you wish to
preferentially select the line with a larger bandwidth.
Optional.
A router is connected with multiple lines. This configuration is recommended if you wish to manually specify a
preferential line.
Optional.
This configuration is mandatory if the cost of external routes of the OSPF domain should be specified when external
routes are introduced to an ASBR.
Optional.
A router may be unstable during the restart process or a period of time after the router is restarted, and users do not
want to forward data through this router. In this case, this configuration is recommended.
Configuring the AD
Optional.
This configuration is mandatory if you wish to change the priorities of OSPF routes on a router that runs multiple unicast
routing protocols.
Verification
Run the show ip ospf interface command to verify that the costs of interfaces are correct.
Run the show ip route command to verify that the costs of external routes introduced to the ASBR are correct.
Restart the router. Within a specified period of time, data is not forwarded through the restarted router.
2-57
Configuration Guide Configuring OSPFv2
Related Commands
2-58
Configuration Guide Configuring OSPFv2
Description cost: Indicates the cost of the default summarized route injected to the stub or NSSA area. The value ranges
from 0 to 16,777,215.
Command OSPF routing process configuration mode
Mode
Usage Guide This command takes effect only on an ABR in a stub area or an ABR/ASBR in an NSSA area.
An ABR in a stub area or an ABR/ASBR in an NSSA area is allowed to advertise an LSA indicating the
default route in the stub or NSSA area. You can run the area default-cost command to modify the cost of
the advertised LSA.
2-59
Configuration Guide Configuring OSPFv2
metrics, that is, the costs of outbound interfaces. If the include-stub parameter is configured, the stub links
will advertise the maximum metric.
If an ABR does not wish to transfer inter-area traffic, use the summary-lsa parameter to set the metric of the
Summary LSA to the maximum metric.
If an ASBR does not wish to transfer external traffic, use the external-lsa parameter to set the metric of the
external LSA to the maximum metric.
The max-metric router-lsa command is generally used in the following scenarios:
Restart a device. After the device is restarted, IGP generally converges faster, and other devices attempt to
forward traffic through the restarted device. If the current device is still building the BGP routing table and
some BGP routes are not learned yet, packets sent these networks will be discarded. In this case, you can
use the on-startup parameter to set a delay after which the restarted device acts as the transmission mode.
Add a device to the network but the device is not used to transfer traffic. The device is added to the
network. If a candidate path exists, the current device is not used to transfer traffic. If a candidate path
does not exist, the current device is still used to transfer traffic.
Delete a device gracefully from the network. After the max-metric router-lsa command is executed,
the current device advertises the maximum metric among all metrics of routes. In this way, other
devices on the network can select the standby path for data transmission before the device is shut
down.
In the earlier OSPF version (RFC1247 or earlier), the links with the maximum metric (0xFFFF) in the LSAs
do not participate in the SPF computation, that is, no traffic is sent to routers that generate these LSAs.
Configuring RFC1583Compatibility
Configuring the AD
2-60
Configuration Guide Configuring OSPFv2
Mode
Usage Guide Use this command to specify different ADs for different types of OSPF routes.
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
A
A# configure terminal
Verification On Router A, check the routing table. The next hop of the optimum path to 172.16.1.0/24 is Router B.
A
A# show ip route ospf
Common Errors
2-61
Configuration Guide Configuring OSPFv2
If the cost of an interface is set to 0 in the ip ospf cost command, a route computation error may occur. For example, a
routing loop is obtained.
All routers connected to the OSPF network must be authenticated to ensure stability of OSPF and protect OSPF
against intrusions.
Notes
If authentication is configured for an area, the configuration takes effect on all interfaces that belong to this area.
If authentication is configured for both an interface and the area to which the interface belongs, the configuration for the
interface takes effect preferentially.
Configuration Steps
(Optional) This configuration is recommended if the same authentication type should be used on all interfaces in the
same area.
(Optional) This configuration is recommended if the different authentication types should be used on different interfaces
in the same area.
Optional.
This configuration is required if a router accesses a network that requires plain text authentication.
(Optional) MD5 authentication features a high security, and therefore is recommended. You must configure either plain
text authentication or MD5 authentication.
This configuration is required if a router accesses a network that requires MD5 authentication.
Verification
If routers are configured with different authentication keys, run the show ip ospf neighbor command to verify that there
is no OSPF neighbor.
2-62
Configuration Guide Configuring OSPFv2
If routers are configured with the same authentication key, run the show ip ospf neighbor command to verify that there
are OSPF neighbors.
Related Commands
2-63
Configuration Guide Configuring OSPFv2
Configuration Example
2-64
Configuration Guide Configuring OSPFv2
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
Configure the authentication type and MD5 authentication key on all routers.
A
A# configure terminal
A(config)#router ospf 1
A(config-router)#exit
B
B# configure terminal
B(config)#router ospf 1
B(config-router)#exit
Verification On Router A and Router B, verify that the OSPF neighbor status is correct.
A
A#show ip ospf neighbor
B
A#show ip ospf neighbor
2-65
Configuration Guide Configuring OSPFv2
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
Configure the authentication type and MD5 authentication key on all routers.
A
A# configure terminal
A(config)#router ospf 1
A(config-router)#exit
B
B# configure terminal
B(config)#router ospf 1
B(config-router)#exit
Verification On Router A and Router B, verify that the OSPF neighbor status is correct.
Neighbor ID Pri State Dead Time Address Interface
Common Errors
2-66
Configuration Guide Configuring OSPFv2
New routes are not loaded to routers when the router memory is insufficient.
New routes are not loaded to routers when the usage of the database space reaches the upper limit.
Notes
After a router enters the overflow state, you can run the clear ip ospf process command, or stop and then restart the
OSPF to exit the overflow state.
Configuration Steps
Optional.
This configuration is recommended if a large number of routes exist in the domain and may cause insufficiency of the
router memory.
Optional.
This configuration is recommended if a large number of routes exist in the domain and may cause insufficiency of the
router memory.
Optional.
This configuration is recommended if the ASBR introduces a large number of external routes and the router memory
may be insufficient.
Verification
After the memory becomes insufficient, add new routers to the network, and run the show ip route command to verify
that new routes are not loaded.
After the usage of the database space reaches the upper limit, add new routers to the network, and run the show ip
route command to verify that new routes are not loaded.
Related Commands
2-67
Configuration Guide Configuring OSPFv2
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
2-68
Configuration Guide Configuring OSPFv2
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
B
B# configure terminal
A
A# configure terminal
Verification On Router B, configure 11 static routes (192.100.1.0/24 to 192.100.11.0/24). On Router A, verify that only
10 static routes are loaded.
2-69
Configuration Guide Configuring OSPFv2
A
A# show ip route ospf
Common Errors
The OSPF adjacency is abnormal because the maximum number of LSAs is inconsistent on different routers.
Control the maximum number of concurrent neighbors on the OSPF process to ease the pressure on the device.
Notes
Configuration Steps
(Optional) This configuration is recommended if you wish to set up the OSPF adjacencymore quickly when a router is
connected with a lot of other routers.
Verification
Run the show ip ospf neighbor command to display the number of neighbors that are concurrently interacting with the
OSPF process.
Related Commands
2-70
Configuration Guide Configuring OSPFv2
Command max-concurrent-ddnumber
Parameter number: Specifies the maximum number of neighbors that are concurrently interacting with the OSPF
Description process. The value ranges from 1 to 65,535.
Command OSPF routing process configuration mode
Mode
Usage Guide When the performance of a router is affected because the router exchanges data with multiple neighbors,
you can configure this command to restrict the maximum of neighbors with which one OSPF process can
concurrently initiates or accepts interaction.
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
2-71
Configuration Guide Configuring OSPFv2
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
Core
Core# configure terminal
Verification On therouter Core, check the neighbor status and verify that at most eight neighbors concurrently interact
with the OSPF process.
The unicast routing service can be provided even if the interface IP addresses of neighbor routers are not in the same
network segment.
Notes
Configuration Steps
(Optional) This configuration is mandatory if an adjacency should be set up between routers with interface IP addresses
in different network segments.
This configuration is performed on routers with interface IP addresses in different network segments.
Verification
Related Commands
2-72
Configuration Guide Configuring OSPFv2
receiving interface. The addresses at both ends of a P2P link are configured separately and are not
necessarily in the same network segment. In this scenario, as the peer address information will be notified
during the P2P link negotiation process, OSPF checks whether the source address of the packet is the
address advertised by the peer during negotiation. If not, OSPF determines that the packet is invalid and
discards this packet. In particular, OSPF does not verify the address of an unnumbered interface. In some
scenarios, the source address may not meet the preceding requirement, and therefore OSPF address
verification fails. For example, the negotiated peer address cannot be obtained on a P2P link. In this
scenario, source address verification must be disabled to ensure that the OSPF adjacency can be properly
set up.
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
A
A# configure terminal
B
B# configure terminal
2-73
Configuration Guide Configuring OSPFv2
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
A
A# configure terminal
B
B# configure terminal
The unicast routing service can be provided even if the MTUs of interfaces on neighbor routers are different.
Notes
Configuration Steps
2-74
Configuration Guide Configuring OSPFv2
(Optional) MTU verification is disabled by default. You are advised to retain the default configuration.
Verification
Related Commands
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
Disable MTU verification on all routers. (By default, the function of disabling MTU verification is
enabled.)
2-75
Configuration Guide Configuring OSPFv2
A
A# configure terminal
B
B# configure terminal
Verification
On Router A, verify that the OSPF neighbor information is correct.
A
A# show ip ospfneighbor
Notes
Configuration Steps
(Optional) This function is enabled by default. You are advised to retain the default configuration.
Verification
Related Commands
Command two-way-maintain
Parameter N/A
2-76
Configuration Guide Configuring OSPFv2
Description
Command OSPF routing process configuration mode
Mode
Usage Guide On a large network, a lot of packets may be sent or received, occupying too much CPU and memory. As a
result, some packets are delayed or discarded. If the processing time of Hello packets exceeds the dead
interval, the adjacency will be destroyed due to timeout.If the two-way maintenance function is enabled, in
addition to the Hello packets, the DD, LSU, LSR, and LSAck packets can also be used to maintain the
bidirectional communication between neighbors when a large number of packets exist on the network. This
prevents termination of the adjacency caused by delayed or discarded Hello packets.
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
On Router A, enable the two-way maintenance function. (This function is enabled by default.)
A
A# configure terminal
A(config)#routerospf 1
A(config-router)#two-way-maintain
Verification When the adjacency is being set up, Router A checks the neighbor dead interval and updates the dead
interval without waiting for Router B to send a Hello packet.
A
A# show ip ospfneighbor
2-77
Configuration Guide Configuring OSPFv2
2.4.14 Enabling GR
Configuration Effect
When a distributed router switches services from the active board to the standby board, data forwarding continues and
is not interrupted.
When the OSPF process is being restarted, data forwarding continues and is not interrupted.
Notes
The grace period cannot be shorter than the neighbor dead time of the neighbor router.
Configuration Steps
(Optional) This function is enabled by default. You are advised to retain the default configuration.
(Optional) This function is enabled by default. You are advised to retain the default configuration.
Verification
When a distributed router switches services from the active board to the standby board, data forwarding continues and
is not interrupted.
When the OSPF process is being restarted, data forwarding continues and is not interrupted.
Related Commands
2-78
Configuration Guide Configuring OSPFv2
different OSPF processes based on the actual conditions. This command is used to configure the GR
restarter capability of a device. The grace period is the maximum time of the entire GR process, during
which link status is rebuilt so that the original state of the OSPF process is restored. After the grace period
expires, OSPF exits the GR state and performs common OSPF operations.
Run thegraceful-restart command to set the grace period to 120s. The graceful-restart grace-period
command allows you to modify the grace period explicitly.
The precondition for successful execution of GR and uninterrupted forwarding is that the topology remains
stable.If the topology changes, OSPF quickly converges without waiting for further execution of GR, thus
avoiding long-time forwarding black-hole.
Disabling topology detection: If OSPF cannot converge in time when thetopology changes during the hot
standby process, forwarding black-hole may appear in a long time.
Enabling topology detection: Forwarding may be interrupted when topology detection is enabled, but the
interruption time is far shorter than that when topology detection is disabled.
In most cases, it is recommended that topology detection be enabled. In special scenarios, topology
detection can be disabled if the topology changes after the hot standby process, but it can be ensured that
the forwarding black-hole will not appearin a long time. This can minimize the forwarding interruption time
during the hot standby process.
If the Fast Hello function is enabled, the GR function cannot be enabled.
2-79
Configuration Guide Configuring OSPFv2
because regional network changes may trigger termination of GR and consequently reduce the
convergence of the entire network.
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
On Router A, Router C, and Router D, enable the GR helper function. (This function is enabled by
default.)
B
B# configure terminal
B(config-router)# graceful-restart
2-80
Configuration Guide Configuring OSPFv2
Verification
Trigger a hot standby switchover on Router B, and verify that the routing tables of destination networks
1 and 2 remain unchanged on Router A during the switchover.
Trigger a hot standby switchover on Router B, ping destination network 1 from Router A, and verify that
data forwarding is not interrupted during the switchover.
Common Errors
Traffic forwarding is interrupted during the GR process because the configured grace period is shorter than the
neighbor dead time of the neighbor router.
Once a link is faulty, OSPF can quickly detect the failure of the route. This configuration helps shorten the traffic
interruption time.
Notes
If BFD is configured for both a process and an interface, the configuration for the interface takes effect preferentially.
Configuration Steps
(Optional) This configuration is required if you wish to accelerate OSPF network convergence.
Verification
Run the show bfd neighbor command to verify that the BFD neighbors are normal.
Related Commands
2-81
Configuration Guide Configuring OSPFv2
Based on the actual environment, you can run the ip ospf bfd command to enable BFD on a specified
interface for link detection, or run the bfd all-interfaces command in OSPF process configuration mode to
enable BFD on all interface of the OSPF process, or run the ospf bfd disable command to disable BFD on
a specified interface.
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
2-82
Configuration Guide Configuring OSPFv2
A
A# configure terminal
A(config-router)#bfd all-interfaces
B
B(config)# interface GigabitEthernet 0/1
B(config-router)#bfd all-interfaces
Verification
On Router A and Router B, verify that the BFD state is Up.
Disconnect Router A from the switch. On Router A, verify that a neighbor is found disconnected during
BFD, and the corresponding OSPF route is deleted.
A
A# show ip ospf neighbor
B
B# show ip ospf neighbor
Once OSPF detects a route failure, the router can immediately switch to the second-best route. This configuration helps
shorten the traffic interruption time.
Notes
The LAF configuration for fast reroute is mutually exclusive with the virtual link configuration.
2-83
Configuration Guide Configuring OSPFv2
Configuration Steps
(Optional) This configuration is required if you wish to increase the OSPF network convergence speed to the
millisecond level.
This configuration is performed on a router that has multiple paths to a destination network.
(Optional) This configuration is mandatory if you wish that data traffic is not switched over to a specified path after the
best path fails. After the best path fails, the traffic will be switched over another second-best path, but a new best path
will be selected based on the interface costs after OSPF converges again.
Verification
Run the show ip route fast-reroute command to verify that both the best and second-best paths exist.
Related Commands
2-84
Configuration Guide Configuring OSPFv2
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
2-85
Configuration Guide Configuring OSPFv2
Scenario
A
A# configure terminal
A(config-router)# exit
A(config-if-GigabitEthernet 0/1)#carrier-delay 0
A(config-if-GigabitEthernet 0/2)#carrier-delay 0
Verification On Router A, check the routing table and verify that a standby route exists for the entry 192.168.4.0/24.
2-86
Configuration Guide Configuring OSPFv2
Notes
Configuration Steps
Configuring iSPF
(Optional) This configuration is recommended if you wish to accelerate route convergence in a single area with more
than 100 routers.
Verification
Related Commands
Configuring iSPF
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Configuring iSPF
2-87
Configuration Guide Configuring OSPFv2
Scenario
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
Core1
Core1# configure terminal
Core2
Core2# configure terminal
Access1
Access1# configure terminal
2-88
Configuration Guide Configuring OSPFv2
Access2
Access2# configure terminal
Enable two-way-maintain
Enable ispf
2-89
Configuration Guide Configuring OSPFv2
Graceful-restart disabled
Area 1
Use the network management software to manage OSPF parameters and monitor the OSPF running status.
Notes
You must enable the MIB function of the SNMP-Server before enabling the OSPF MIB function.
You must enable the Trap function of the SNMP-Server before enabling the OSPF Trap function.
You must enable the logging function of the device before outputting the OSPF logs.
Configuration Steps
(Optional) This configuration is required if you want to use the network management software to manage parameters of
a specified OSPF process.
2-90
Configuration Guide Configuring OSPFv2
(Optional) This configuration is required if you want to use the network management software to monitor the OSPF
running status.
(Optional) This function is enabled by default. You are advised to retain the default configuration. If you want to reduce
the log output, disable this function.
Verification
Use the network management software to monitor the OSPF running status.
Related Commands
2-91
Configuration Guide Configuring OSPFv2
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
2-92
Configuration Guide Configuring OSPFv2
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
A
A# configure terminal
Verification Use the MIB tool to read and set the OSPF parameters and display the OSPF running status.
Common Errors
Configurations on the SNMP-Server are incorrect. For example, the MIB or trap function is not enabled.
Notes
The neighbor dead time cannot be shorter than the Hello interval.
Configuration Steps
(Optional) You are advised to retain the default configuration. This configuration can be adjusted if you wish to
accelerate OSPF convergence when a link fails.
2-93
Configuration Guide Configuring OSPFv2
(Optional) You are advised to adjust this configuration if a lot of routes exist in the user environment and network
congestion is serious.
(Optional) You are advised to retain the default configuration. This configuration can be adjusted if a lot of routes exist in
the user environment.
Verification
Run the show ip ospfandshow ip ospf neighbor commands to display the protocol running parameters and status.
Related Commands
2-94
Configuration Guide Configuring OSPFv2
topological changes more quickly, but the network traffic increases. The Hello interval must be the same on
all routers in the same network segment. If you want to manually modify the neighbor dead interval, ensure
that the neighbor dead interval is longer than the Hello interval.
2-95
Configuration Guide Configuring OSPFv2
The retransmission delay can be set to a greater value on a serial line or virtual link to prevent unnecessary
retransmission. The LSU retransmission delay of a virtual link is defined by the retransmit-interval
parameter in the area virtual-link command.
2-96
Configuration Guide Configuring OSPFv2
Description ms.
transmit-count: Indicates the number of LS-UPD packets in a group. The value ranges from 1 to 200.
Command OSPF routing process configuration mode
Mode
Usage Guide If the number of LSAs is large and the device load is heavy in an environment, properly configuring
transimit-time and transimit-count can limit the number of LS-UPD packets flooded on a network.
If the CPU usage is not high and the network bandwidth load is not heavy, reducing the value of
transimit-time and increasing the value of transimit-count can accelerate the environment convergence.
2-97
Configuration Guide Configuring OSPFv2
spf-max-waittime: Indicates the maximum interval between two SPF computations. The unit is ms. The
value ranges from 1 to 600,000.
number: indicates the metric of the summarized route.
Command OSPF routing process configuration mode
Mode
Usage Guide spf-delay indicates the minimum time between the occurrence of the topological change and the start of
SPF computation. spf-holdtime indicates the minimum interval between the first SPF computation and the
second SPF computation. After that, the interval between two SPF computations must be at least twice of
the previous interval. When the interval reaches spf-max-waittime, the interval cannot increase again. If
the interval between two SPF computations already exceeds the required minimum value, the interval is
computed by starting from spf-holdtime.
You can set spf-delay and spf-holdtime to smaller values to accelerate topology convergence, and set
spf-max-waittime to a larger value to reduce SPF computation. Flexible settings can be used based on
stability of the network topology.
Compared with the timers spf command, this command supports more flexible settings to accelerate the
convergence speed of SPF computation and further reduce the system resources consumed by SPF
computation when the topology continuously changes. Therefore, you are advised to use the timers throttle
spf command for configuration.
1. The value of spf-holdtime cannot be smaller than the value of spf-delay; otherwise, spf-holdtime will
be automatically set to the value of spf-delay.
2. The value of spf-max-waittime cannot be smaller than the value of spf-holdtime; otherwise,
spf-max-waittime will be automatically set to the value of spf-holdtime.
3. The configurations of timers throttle spf and timers spf are mutually overwritten.
4. When both timers throttle spf and timers spf are not configured, the default values of timers
throttle spf prevail.
Configuration Example
The following configuration examples assume that the OSPF basic functions have been configured. For details about
the OSPF basic functions, see section 2.4.1 "Configuring OSPF Basic Functions."
Scenario
2-98
Configuration Guide Configuring OSPFv2
Configuration
Configure the interface IP addresses on all routers. (Omitted)
Steps
Configure the OSPF basic functions on all routers. (Omitted)
A
A# configure terminal
B
B# configure terminal
Verification Check the interface parameters on Router A. Verify that the Hello interval is 10s and the dead interval is 50s.
A
A# show ip ospf interface
Timer intervals configured, Hello 15, Dead 50, Wait 40, Retransmit 5
Common Errors
The configured neighbor dead time is shorter than the Hello interval.
2-99
Configuration Guide Configuring OSPFv2
Notes
Configuration Steps
(Optional) Perform this operation when OSPF packets are expected to be sent over the super VLAN, without
consuming a large number of device resources to prevent neighbor down.
Verification
Related Commands
Configuration Example
The following configuration is performed based on OSPF basic functions. For details about OSPF basic functions, see
the preceding section 2.4.1 "Configuring OSPF Basic Functions."
2-100
Configuration Guide Configuring OSPFv2
Scenario
Configuration
Configure a super VLAN.
Steps
Configure interface IP addresses for all devices.
A
A# configure terminal
B
B# configure terminal
Verification Check whether a large number of packets are received over the OSPF interface on device A.
A
A# show ip ospf interface vlan 300
2.5 Monitoring
Clearing
Running the clear commands may lose vital information and thus interrupt services.
Description Command
Clears and resets an OSPF process. clear ip ospf [ process-id] process
Displaying
Description Command
2-101
Configuration Guide Configuring OSPFv2
Description Command
Displays the OSPF process show ip ospf [ process-id ]
configurations.
Displays the OSPF internal routing show ip ospf[ process-id ] border-routers
table, including routes to ABRs and
ASBRs.
Displays information about the OSPF show ip ospf [ process-id area-id] database [{ asbr-summary | external | network |
LSDB. nssa-external | opaque-area | opaque-as | opaque-link | router |
summary }][ { adv-router ip-address| self-originate } |link-state-id |
brief ][ database-summary | max-age | detail]
Displays OSPF-enabled interfaces. show ip ospf [ process-id ] interface [ interface-type interface-number | brief ]
Displays the OSPF neighbor list. show ip ospf [ process-id ] neighbor [ detail ] [ interface-typeinterface-number ]
[ neighbor-id ]
Displays the OSPF routing table. show ip ospf [ process-id ] route[ count ]
Displays the number of times SPT is show ip ospf [ process-id ] spf
computed in the OSPF area.
Displays the summarized route of show ip ospf[ process-id ] summary-address
OSPF redistributed routes.
Displays the OSPF network topology show ip ospf [process-id[ area-id] ] topology[ adv-routeradv-router-id [ router-id ] |
information. self-originate[ router-id ] ]
Displays OSPF virtual links. show ip ospf [ process-id ] virtual-links [ ip-address]
Debugging
System resources are occupied when debugging information is output. Therefore, disable debugging immediately after
use.
Description Command
Debugs OSPF events. debug ip ospf events [abr|asbr|lsa|nssa|os|restart| router|slink| vlink]
Debugs OSPF interfaces. debug ip ospf ifsm [events|status|timers]
Debugs OSPF neighbors. debug ip ospf nfsm [events | status | timers]
Debugs the OSPF NSM. debug ip ospf nsm [interface | redistribute | route]
Debugs OSPF LSAs. debug ip ospf lsa [flooding | generate | install | maxage | refresh]
Debugs OSPF packets. debug ip ospf packet [dd|detail|hello|ls-ack|ls-request|ls-update|recv|send]
Debugs OSPF routes. debug ip ospf route [ase | ia | install | spf | time]
2-102
Configuration Guide Configuring OSPFv3
3 Configuring OSPFv3
3.1 Overview
Open Shortest Path First (OSPF) is an Interior Gateway Protocol (IGP) that is used within the Autonomous System (AS) to
allow routers to obtain a route to a remote network.
OSPF Version 2 (OSPFv2) is applicable to IPv4, and OSPF Version 3 (OSPFv3) is applicable to IPv6. The protocol
running mechanism and most configurations are the same.
Wide scope of application: OSPF is applicable to a larger-scale network that supports hundreds of routers.
Fast convergence: Once the network topology changes, notifications can be quickly sent between routers to update
routes.
No self-loop: Only the link status information is synchronized between routers. Each router computes routes
independently, and a self-loop will not occur.
Area division: A large routing domain is divided into multiple small areas to save system resources and network
bandwidth and ensure stability and reliability of routes.
Route classification: Routes are classified into several types to support flexible control.
Multicast transmission: Protocol packets are sent using the multicast address to avoid interfering with irrelevant entities
and save system resources.
In this chapter, the term "router" refers to any network device that supports the routing function. These network devices
can be L3 switches, routers, or firewall.
Unless otherwise specified, "OSPF" in the following descriptions refers to OSPFv3.
RFC2740 This document describes the modifications to OSPF to support version 6 of the Internet
Protocol (IPv6).
draft-ietf-ospf-ospfv This document describes the OSPFv3 graceful restart. The OSPFv3 graceful restart is identical
3-graceful-restart to OSPFv2 except for the differences described in this document. These differences include the
format of the grace Link State Advertisements (LSA) and other considerations.
draft-ietf-ospf-ospfv This memo defines a portion of the Management Information Base (MIB) for use with network
3-mib-11 management protocols in IPv6-based internets. In particular, it defines objects for managing the
Open Shortest Path First Routing Protocol for IPv6.
3-1
Configuration Guide Configuring OSPFv3
3.2 Applications
Application Description
Intra-Domain Interworking OSPF runs within the AS, which is divided into several areas.
Inter-Domain Interworking Several ASs are interconnected. OSPF runs within each AS, and BGP runs
between ASs.
OSPF runs within the AS. If the number of routers exceeds 40, it is recommended that the AS be divided into several areas.
Generally, high-end devices featuring reliable performance and fast processing speed are deployed in a backbone area, and
low-end or medium-range devices with relatively lower performance can be deployed in a normal area. All normal areas must
be connected to the backbone area. It is recommended that a normal area located on the stub be configured as a stub area.
As shown in Figure 3-1, the network is divided into four areas. Communication between these areas must go through the
backbone area, that is, area 0.
Remark A, B, C, D, E, and H are located in the backbone area, and are backbone routers.
s Area 3 is configured as a stub area.
Deployment
3-2
Configuration Guide Configuring OSPFv3
Several ASs are interconnected. OSPF runs within each AS, and BGP runs between ASs.Generally, OSPF and BGP learn
the routing information from each other.
As shown in Figure 3-2, unicast routing is implemented within AS 100 and AS 200 using OSPF, and between the two ASs
using BGP.
Figure 3-2Interworking Between OSPF and BGP
Deployment
3.3 Features
Basic Concepts
Routing Domain
All routers in an AS must be interconnected and use the same routing protocol. Therefore, an AS is also called a routing
domain.
An AS on which OSPF runs is also called OSPF routing domain, or OSPF domain for short.
OSPF Process
OSPF supports multiple instances, and each instance corresponds to an OSPF process.
One or more OSPF processes can be started on a router. Each OSPF process runs OSPF independently, and the processes
are mutually isolated.
An OSPF packet header contains the Instance ID field, and multiple OSPF instances can run concurrently on a single link.
The process ID is valid only on the local device.
RouterID
3-3
Configuration Guide Configuring OSPFv3
The router ID uniquely identifies a router in an OSPF domain. Router IDs of any two routers cannot be the same.
If multiple OSPF processes exist on a router, each OSPF process uses one router ID. Router IDs of any two OSPF
processes cannot be the same.
Area
OSPF supports multiple areas. An OSPF domain is divided into multiple areas to ease the computing pressure of a
large-scale network.
An area is a logical group of routers, and each group is identified by an area ID. The border between areas is a router. A
router may belong to one area or multiple areas. One network segment (link) can belong to only one area, or each
OSPF-enabled interface must belong to a specified area.
Area 0 is the backbone area, and other areas are normal areas. Normal areas must be directly connected to the backbone
area.
Figure 3-3Division of the OSPF Areas
OSPF Router
The following types of routers are defined in OSPF, and assigned with different responsibilities:
Internal router
All interface of an interval router belong to the same OSPF area. As shown in Figure 3-3, A, C, F, G, I, M, J, K, and L
are internal routers.
Area border router (ABR)
An ABR is used to connect the backbone area with a normal area. An ABR belongs to two or more areas, and one of
the areas must be the backbone area. As shown in Figure 3-3, B, D, E, and H are ABRs.
Backbone router
A backbone router has at least one interface that belongs to the backbone area. All ABRs and all routers in area 0 are
backbone routers. As shown in Figure 3-3, A, B, C, D, E, and H are backbone routers.
AS boundary router (ASBR)
3-4
Configuration Guide Configuring OSPFv3
An ASBR is used to exchange routing information with other ASs. An ASBR is not necessarily located on the border of
an AS. It may be a router inside an area, or an ABR. As shown in Figure 3-3, A is an ASBR.
Virtual Link
OSPF supports virtual links. A virtual link is a logical link that belongs to the backbone area. It is used to resolve the problems
such as a discontinuous backbone area or a failure to directly connect a normal area to the backbone area on the physical
network. A virtual link supports traversal of only one normal area, and this area is called transit area. Routers on both ends of
a virtual link are ABRs.
Figure 3-4Discontinuous Backbone Area on the Physical Network
As shown in Figure 3-4, a virtual link is set up between A and B to connect two separated parts of Area 0. Area 1 is a transit
area, and A and B are ABRs of Area 1.
Figure 3-5Failure to Directly Connect a Normal Area to the Backbone Area on the Physical Network
As shown in Figure 3-5, a virtual link is set up between A and B to extend Area 0 to B so that Area 0 can be directly
connected to Area 2 on B. Area 1 is a transit area, A is an ABR of Area 1, and B is an ABR of Area 0 and Area 2.
LSA
OSPF describes the routing information by means of Link State Advertisement (LSA).
LSA Type Description
Router-LSA(Type1) This LSA is originated by every router. It describes the link state and cost of the
router, and is advertised only within the area where the originating router is located.
Network-LSA(Type2) This LSA is originated by a designated router (DR). It describes the state of the
current link, and is advertised only within the area where the DR is located.
Inter-Area-Prefix-LSA(Type3) This LSA is originated by an ABR. It describes a route to another area, and is
3-5
Configuration Guide Configuring OSPFv3
Stub areas, NSSA areas, totally stub areas, and totally NSSA areas are special forms of normal areas and help reduce
the load of routers and enhance reliability of OSPF routes.
OSPF Packet
The following table lists the protocol packets used by OSPF. These OSPF packets are encapsulated in IP packets and
transmitted in multicast or unicast mode.
Packet Type Description
Hello Hello packets are sent periodically to discover and maintain OSPF neighbor
relationships.
Database Description (DD) DD packets carry brief information about the local Link-State Database (LSDB) and
are used to synchronize the LSDBs between OSPF neighbors.
Link State Request (LSR) LSR packets are used to request the required LSAs from neighbors. LSR packets
are sent only after DD packets are exchanged successfully between OSPF
neighbors.
Link State Update (LSU) LSU packets are used to send the required LSAs to peers.
Link State Acknowledgment LSAck packets are used to acknowledge the received LSAs.
(LSAck)
Overview
Feature Description
Link-State Routing Run OSPF on the router to obtain routes to different destinations on the network.
Protocols
OSPF Route Properly plan or optimize OSPF routes through manual configuration to implement
Management management of OSPF routes.
3-6
Configuration Guide Configuring OSPFv3
Feature Description
Enhanced Security Use functions such as authentication and BFD correlation to enhance security, stability, and
and Reliability reliability of OSPF.
Network Use functions such as the MIB and Syslog to facilitate OSPF management.
Management
Functions
Working Principle
Routers send Hello packets through all OSPF-enabled interfaces (or virtual links). If Hello packets can be exchanged
between two routers, and parameters carried in the Hello packets can be successfully negotiated, the two routers become
neighbors. Routers that are mutually neighbors find their own router IDs from Hello packets sent from neighbors, and
bidirectional communication is set up.
A Hello packet includes, but is not limited to, the following information:
Neighbor dead interval of the originating router interface (or virtual link)
3-7
Configuration Guide Configuring OSPFv3
After bidirectional communication is set up between neighbor routers, the DD, LSR, LSU, and LSAck packets are used to
exchange LSAs and set up the adjacency. The brief process is as follows:
The LSA is exchanged between neighbors. When a router receives the LSA from its neighbor, it copies the LSA and
saves the copy in the local LSDB, and then advertises the LSA to other neighbors.
When the router and its neighbors obtain the same LSDB, full adjacency is achieved.
OSPF will be very quiet without changes in link costs or network addition or deletion. If any change takes place, the
changed link states are advertised to quickly synchronize the LSDB.
After the complete LSDB is obtained from the router, the Dijkstra algorithm is run to generate an SPT from the local router to
each destination network. The SPT records the destination networks, next-hop addresses, and costs. OSPF generates a
routing table based on the SPT.
If changes in link costs or network addition or deletion take place, the LSDB will be updated. The router again runs the
Dijkstra algorithm, generates a new SPT, and updates the routing table.
The Dijkstra algorithm is used to find a shortest path from a vertex to other vertices in a weighted directed graph.
A router does not necessarily need to exchange LSAs with every neighbor and set up an adjacency with every neighbor. To
improve efficiency, OSPF classifies networks that use various link layer protocols into five types so that LSAs are exchanged
in different ways to set up an adjacency:
Broadcast
The DR (or BDR) exchanges LSAs with all other routers to set up an adjacency. Except the DR and BDR, all other
routers do not exchange LSAs with each other, and the adjacency is not set up.
Ethernet and fiber distributed data interface (FDDI) belong to the broadcast network type by default.
Neighbors are manually configured, and the DR and BDR are elected.
The DR (or BDR) exchanges LSAs with all other routers to set up an adjacency. Except the DR and BDR, all other
routers do not exchange LSAs with each other, and the adjacency is not set up.
Point-to-point (P2P)
LSAs are exchanged between routers at both ends of the link, and the adjacency is set up.
PPP, HDLC, and LAPB belong to the P2P network type by default.
Point-to-multipoint(P2MP)
3-8
Configuration Guide Configuring OSPFv3
LSAs are exchanged between any two routers, and the adjacency is set up.
Networks without any link layer protocol belong to the P2MP network type by default.
P2MP broadcast
LSAs are exchanged between any two routers, and the adjacency is set up.
Networks without any link layer protocol belong to the P2MP network type by default.
Figure 3-6
Display the OSPF routes (marked in red) in the routing table of Router C.
O - OSPF intra area, OI - OSPF inter area, OE1 - OSPF external type 1, OE2 - OSPF external type 2
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
3-9
Configuration Guide Configuring OSPFv3
A mark is displayed in front of each OSPF route to indicate the type of the route. There are six types of OSPF routes:
O: Intra-area route
This type of route describes how to arrive at a destination network in the local area. The cost of this type of route is
equal to the cost of the route from the local router to the destination network.
This type of route describes how to arrive at a destination network in another area. The cost of this type of route is equal
to the cost of the route from the local router to the destination network.
This type of route describes how to arrive at a destination network outside the AS. The cost of this type of route is equal
to the cost of the route from the local router to the ASBR plus the cost of the route from the ASBR to the destination
network. This type of route does not exist on routers in the stub or NSSA area.
This type of route describes how to arrive at a destination network outside the AS. The cost of this type of route is equal
to the cost of the route from the ASBR to the destination network. This type of route does not exist on routers in the stub
or NSSA area.
This type of route describes how to arrive at a destination network outside the AS through the ASBR in the NSSA area.
The cost of this type of route is equal to the cost of the route from the local router to the ASBR plus the cost of the route
from the ASBR to the destination network. This type of route exists only on routers in the NSSA area.
This type of route describes how to arrive at a destination network outside the AS through the ASBR in the NSSA area.
The cost of this type of route is equal to the cost of the route from the ASBR to the destination network. This type of
route exists only on routers in the NSSA area.
Reliability of OE2 and ON2 routes is poor. OSPF believes that the cost of the route from the ASBR to a destination
outside an AS is far greater than the cost of the route to the ASBR within the AS. Therefore, when the route cost is
computed, only the cost of the route from the ASBR to a destination outside an AS is considered.
Related Configuration
Enabling OSPF
3-10
Configuration Guide Configuring OSPFv3
Run the ipv6 ospfarea command to enable OSPF on an interface and specify the area ID.
Run the area virtual-link command to create a virtual link on the router. The virtual link can be treated as a logical interface.
Router ID
By default, the OSPF process elects the largest IPv4 address among the IPv4 addresses of all the loopback interfaces as the
router ID. If the loopback interfaces configured with IPv4 addresses are not available, the OSPF process elects the largest
IPv4 address among the IPv4 addresses of all the physical ports as the router ID.
Alternatively, you can run the router-id command to manually specify the router ID.
Run the ipv6 ospf hello-interval command to modify the Hello interval on the interface. The default value is 10s (or 30s for
NBMA networks).
Run the ipv6 ospf dead-interval command to modify the neighbor dead interval on the interface. The default value is four
times the Hello interval.
Use the poll-interval parameter in the ipv6 ospf neighbor command to modify the neighbor polling interval on the NBMA
interface. The default value is 120s.
Run the ipv6 ospf transmit-delay command to modify the LSU packet transmission delay on the interface. The default
value is 1s.
Run the ipv6 ospf retransmit-interval command to modify the LSU packet retransmission interval on the interface. The
default value is 5s.
Use the hello-interval parameter in the area virtual-link command to modify the Hello interval on the virtual link. The default
value is 10s.
Use the dead-interval parameter in the area virtual-link command to modify the neighbor dead interval on the virtual link.
The default value is four times the Hello interval.
Use the transmit-delay parameter in the area virtual-link command to modify the LSU packet transmission delay on the
virtual link. The default value is 1s.
Use the retransmit-interval parameter in the area virtual-link command to modify the LSU packet retransmission interval
on the virtual link. The default value is 5s.
Run the timers throttle lsa all command to modify parameters of the exponential backoff algorithm that generates LSAs.
The default values of these parameters are 0 ms, 5000 ms, and 5000 ms.
Run the timers pacing lsa-group command to modify the LSA group update interval. The default value is 30s.
Run the timers pacing lsa-transmit command to modify the LS-UPD packet sending interval and the number of sent
LS-UPD packets. The default values are 40 ms and 1.
Run the timers lsa arrival command to modify the delay after which the same LSA is received. The default value is 1000 ms.
Run the timers throttle spf command to modify the SPT computation delay, minimum interval between two SPT
computations, and maximum interval between two SPT computations. The default values are 1000 ms, 5000 ms, and 10000
ms.
By default, Ethernet and FDDI belong to the broadcast type, X.25, frame relay, and ATM belong to the NBMA type, and PPP,
HDLC, and LAPB belong to the P2P type.
3-11
Configuration Guide Configuring OSPFv3
Run the ipv6 ospf network command to manually specify the network type of an interface.
Run the ipv6 ospf neighbor command to manually specify a neighbor. For the NBMA and P2MP non-broadcast types, you
must manually specify neighbors.
Run the ipv6 ospf priority command to adjust the priorities of interfaces, which are used for DR/BDR election. The DR/BDR
election is required for the broadcast and NBMA types. The router with the highest priority wins in the election, and the router
with the priority of 0 does not participate in the election. The default value is 1.
Working Principle
The (totally) stub and (totally) NSSA areas help reduce the protocol interaction load and the size of the routing table.
If an appropriate area is configured as a (totally) stub or NSSA area, advertisement of a large number of Type 5 and
Type 3 LSAs can be avoided within the area.
The ABR uses Type 3 LSAs to advertise a default route to the (totally) stub or NSSA area.
The ABR converts Type 7 LSAs in the totally NSSA area to Type 5 LSAs, and advertise Type 5 LSAs to the backbone
area.
If an area is appropriately configured as a (totally) stub area or an NSSA area, a large number of OE1, OE2, and OI
routes will not be added to the routing table of a router in the area.
Area Routes Available in the Routing Table of a Router Inside the Area
Non (totally) stub area and O: a route to a destination network in the local area
NSSA area OI: a route to a destination network in another area
OE1 or OE2: a route or default route to a destination network segment outside the AS
(via any ASBR in the AS)
Stub area O: a route to a destination network in the local area
OI: a route or a default route to a destination network in another area
3-12
Configuration Guide Configuring OSPFv3
Area Routes Available in the Routing Table of a Router Inside the Area
Totally stub area O: a route to a destination network in the local area
OI: a default route
NSSA area O: a route to a destination network in the local area
OI: a route or a default route to a destination network in another area
ON1 or ON2: a route or default route to a destination network segment outside the AS
(via an ASBR in the local area)
Totally NSSA area O: a route to a destination network in the local area
OI: a default route
ON1 or ON2: a route or default route to a destination network segment outside the AS
(via an ASBR in the local area)
Route Redistribution
Route redistribution refers to the process of introducing routes of other routing protocols, routes of other OSPF processes,
static routes, and direct routes that exist on the device to an OSPF process so that these routes can be advertised to
neighbors using Type 5 and Type 7 LSAs. A default route cannot be introduced during route redistribution.
Route redistribution is often used for interworking between ASs. You can configure route redistribution on an ASBR to
advertise routes outside an AS to the interior of the AS, or routes inside an AS to the exterior of the AS.
By configuring a command on an ASBR, you can introduce a default route to an OSPF process so that the route can be
advertised to neighbors using Type 5 and Type 7 LSAs.
Default route introduction is often used for interworking between ASs. One default route is used to replace all the routes
outside an AS.
Route Summarization
Route summarization is a process of summarizing routing information with the same prefix into one route, and advertising the
summarized route (replacing a large number of individual routes) to neighbors. Route summarization helps reduce the
protocol interaction load and the size of the routing table.
By default, the ABR advertises inter-area routing information by using Type3 LSAs within a network segment, and advertises
redistributed routing information by using Type 5 and Type 7 LSAs.If continuous network segments exist, it is recommended
that you configure route summarization.
Route Filtering
OSPF supports route filtering to ensure security and facilitate control when the routing information is being learned,
exchanged, or used.
Using configuration commands, you can configure route filtering for the following items:
Interface: The interface is prevented from sending routing information (any LSAs) or exchanging routing information
(any LSAs) with neighbors.
Routing information outside an AS: Only the routing information that meets the filtering conditions can be redistributed
to the OSPF process (Type 5 and Type 7 LSAs).
3-13
Configuration Guide Configuring OSPFv3
LSAs received by a router: In the OSPF routing table, only the routes that are computed based on the LSAs meeting the
filtering conditions can be advertised.
Route Cost
If redundancy links or devices exist on the network, multiple paths may exist from the local device to the destination network.
OSPF selects the path with the minimum total cost to form an OSPF route. The total cost of a path is equal to the sum of the
costs of individual links along the path.The total cost of a path can be minimized by modifying the costs of individual links
along the path. In this way, OSPF selects this path to form a route.
Using configuration commands, you can modify the following link costs:
Cost from an interface to a directly connected network segment and cost from the interface to a neighbor
Cost from an ASBR to an external network segment and cost from the ASBR to the default network segment
Both the cost and the metric indicate the cost and are not differentiated from each other.
The administrative distance (AD) evaluates reliability of a route, and the value is an integer ranging from 0 to 255. A smaller
AD value indicates that the route is more trustworthy. If multiples exist to the same destination, the route preferentially selects
a route with a smaller AD value. The route with a greater AD value becomes a floating route, that is, a standby route of the
optimum route.
By default, the route coming from one source corresponds to an AD value. The AD value is a local concept. Modifying the AD
value affects route selection only on the current router.
Route Directly-connecte Static EBGP OSPF IS-IS RIP IBGP Unreachabl
Source d network route Route Route Route Route Route e Route
Default 0 1 20 110 115 120 200 255
AD
Related Configuration
Run the area stub command to configure a specified area as a stub area.
Run the area nssa command to configure a specified area as an NSSA area.
By default, routes are not redistributed and the default route is not introduced.
3-14
Configuration Guide Configuring OSPFv3
After configuring route redistribution and default route introduction, the router automatically becomes an ASBR.
Route Summarization
By default, routes are not summarized. If route summarization is configured, a discard route will be automatically added.
Run the area range command to summarize routes (Type 3 LSA) distributed between areas on the ABR.
Run the summary-prefix command to summarize redistributed routes (Type 5 and Type 7 LSAs) on the ASBR.
Route Filtering
Run the passive-interface command to configure a passive interface. Routing information (any LSAs) cannot be exchanged
on a passive interface.
Use the route-map parameter in the redistribute command, or use the distribute-list out command to filter the external
routing information of the AS on the ASBR. Only the routing information that meets the filtering conditions can be
redistributed to the OSPF process (Type 5 LSAs).
Run the distribute-list in command to filter LSAs received by the router. In the OSPF routing table, only the routes that are
computed based on the LSAs meeting the filtering conditions can be advertised.
Route Cost
Cost from the interface to the directly-connected network segment (cost on the interface)
The default value is the auto cost. Auto cost = Reference bandwidth/Interface bandwidth
Run the auto-cost reference-bandwidth command to set the reference bandwidth of the auto cost. The default value
is 100 Mbps.
Run the ipv6 ospf cost command to manually set the cost of the interface. The configuration priority of this item is
higher than that of the auto cost.
Cost from the interface to a specified neighbor (that is, cost from the local device to a specified neighbor)
The default value is the auto cost.
Use the cost parameter in the ipv6 ospf neighbor command to modify the cost from the interface to a specified
neighbor. The configuration priority of this item is higher than that of the cost of the interface.
This configuration item is applicable only to P2MP-type interfaces.
Cost from the ABR to the default network segment (that is, the cost of the default route that is automatically advertised
by the ABR to the stub or NSSA areas)
The default value is 1.
Run the area default-cost command to modify the cost of the default route that the ABR automatically advertise to the
stub areas.
Cost from the ASBR to an external network segment (that is, the metric of an external route)
By default, the metric of a redistributed BGP route is 1, the metric of other types of redistributed routes is 20, and the
route type is Type 2 External.
Run the default-metric command to modify the default metric of the external route.
3-15
Configuration Guide Configuring OSPFv3
Use the metric,metric-type, and route-map parameters in the redistribute command to modify the metric and route
type of the external route.
Cost from the ASBR to the default network segment (that is, the metric of the default route that is manually introduced)
By default, the metric is 1, and the route type is Type 2 External.
Use the metric,metric-type, and route-map parameters in the default-information originate command to modify the
metric and route type of the default route that is manually introduced.
Use the metric and metric-type parameters of default-information originate in the area nssa command to modify
the metric and type of the default route that is manually introduced to the NSSA area.
Working Principle
Authentication
OSPFv3 uses the authentication mechanism, that is, IP authentication header (AH) and IP Encapsulating Security Payload
(ESP), provided by IPv6 to prevent unauthorized routers that access the network and hosts that forge OSPF packets to
participate in OSPF routing. OSPF packets received on the OSPF interface (or at both ends of a virtual link) are
authenticated. If authentication fails, the packets are discarded and the adjacency cannot be set up.
Enabling authentication can avoid learning unauthenticated or invalid routes, thus preventing advertising valid routes to
unauthenticated devices. In the broadcast-type network, authentication also prevents unauthenticated devices from
becoming designated devices, ensuring stability of the routing system and protecting the routing system against intrusions.
MTU Verification
On receiving a DD packet, OSPF checks whether the MTU of the neighbor interface is the same as the MTU of the local
interface. If the MTU of the interface specified in the received DD packet is greater than the MTU of the interface that
receives the packet, the adjacency cannot be set up. Disabling MTU verification can avoid this problem.
Two-Way Maintenance
OSPF routers periodically send Hello packets to each other to maintain the adjacency. On a large network, a lot of packets
may be sent or received, occupying too much CPU and memory. As a result, some packets are delayed or discarded. If the
processing time of Hello packets exceeds the dead interval, the adjacency will be destroyed.
If the two-way maintenance function is enabled, in addition to the Hello packets, the DD, LSU, LSR, and LSAck packets can
also be used to maintain the bidirectional communication between neighbors, which makes the adjacency more stable.
3-16
Configuration Guide Configuring OSPFv3
When a router simultaneously exchanges data with multiple neighbors, its performance may be affected. If the maximum
number of neighbors that concurrently initiate or accept interaction with the OSPF process, the router can interact with
neighbors by batches, which ensures data forwarding and other key services.
GR
The control and forwarding separated technology is widely used among routers. On a relatively stable network topology,
when a GR-enabled router is restarted on the control plane, data forwarding can continue on the forwarding plane. In
addition, actions (such as adjacency re-forming and route computation) performed on the control plane do not affect
functions of the forwarding plane. In this way, service interruption caused by route flapping can be avoided, thus enhancing
reliability of the entire network.
Currently, the GR function is used only during active/standby switchover and system upgrade.
The GR process requires collaboration between the restarter and the helper. The restarter is the router where GR
occurs. The helper is a neighbor of the restarter.
When entering or exiting the GR process, the restarter sends a Grace-LSA to the neighbor, notifying the neighbor to
enter or exit the helper state.
When the adjacency between the restarter and the helper reaches the Full state, the router can exit the GR process
successfully.
3-17
Configuration Guide Configuring OSPFv3
After a link fault occurs, it takes a period of time (about 40s) before OSPF can sense the death of the neighbor. Then, OSPF
advertises the information and re-computes the SPT. During this period, traffic is interrupted.
After the fast Hello function is enabled (that is, the neighbor dead interval is set to 1s), OSPF can sense the death of a
neighbor within 1s once a link is faulty. This greatly accelerates route convergence and prevents traffic interruption.
BFD is used to test connectivity between devices. A link fault can be detected in as short as 150 ms. After OSPF is
correlated with BFD, OSPF can sense the death of a neighbor in as short as 150 ms once a link is faulty. This greatly
accelerates route convergence and prevents traffic interruption.
Related Configuration
Run the area authentication command to enable authentication in the entire area so that the authentication function
takes effect on all interfaces in this area. If authentication is enabled in area 0, the function also takes effect on the
virtual link.
Run the area encryption command to enable encryption and authentication in the entire area so that the
encryptionand authentication functions take effect on all interfaces in this area. If encryptionand authentication are
enabled in area 0, the functions also take effect on the virtual link.
Run the ipv6 ospf authentication command to enable authentication on an interface. This configuration takes
precedence over the area-based configuration.
Run the ipv6 ospf encryption command to enable encryptionand authentication on an interface. This configuration
takes precedence over the area-based configuration.
Use the authentication parameter in the area virtual-link command to enable authentication at both ends of a virtual
link. This configuration takes precedence over the area-based configuration.
Use the encryption parameter in the area virtual-link command to enable encryptionand authentication at both ends
of a virtual link. This configuration takes precedence over the area-based configuration.
MTU Verification
Run the ipv6 ospf mtu-ignore command to disable MTU verification on an interface.
Two-Way Maintenance
Run the max-concurrent-dd command to modify the maximum number of neighbors that are concurrently interacting with
the current OSPF process. The default value is 5.
3-18
Configuration Guide Configuring OSPFv3
Run the ipv6 router ospf max-concurrent-dd command to modify the maximum number of neighbors that are concurrently
interacting with all OSPF processes on the router. The default value is 10.
GR
By default, the restarter function is disabled, and the helper function is enabled.
Fast Hello
Run the ipv6 ospf dead-interval minimal hello-multiplier command to enable the Fast Hello function on an interface, that
is, the neighbor dead interval is 1s.
Run the bfd interval min_rx multiplier command to set the BFD parameters.
Run the bfd all-interfaces command to correlate OSPF with BFD on all interfaces.
Run the ipv6 ospf bfd command to correlate OSPF with BFD on the current interface.
Working Principle
MIB
MIB is the device status information set maintained by a device. You can use the management program to view and set the
MIB node.
Multiple OSPF processes can be simultaneously started on a router, but the OSPF MIB can be bound with only one OSPF
process.
Trap
A trap message is a notification generated when the system detects a fault. This message contains the related fault
information.
If the trap function is enabled, the router can proactively send the trap messages to the network management device.
Syslog
The Syslog records the operations (such as command configuration) performed by users on routers and specific events
(such as network connection failures).
3-19
Configuration Guide Configuring OSPFv3
If the syslog is allowed to record the adjacency changes, the network administrator can view the logs to learn the entire
process that the OSPF adjacency is set up and maintained.
Related Configuration
MIB
By default, the MIB is bound with the OSPF process with the smallest process ID.
Run the enable mib-binding command to bind the MIB with the current OSPF process.
Trap
By default, all traps functions are disabled, and the device is not allowed to send OSPF traps.
Run the snmp-server enable traps ospf command to allow the device to send OSPF traps.
Run the enable traps command to enable a specified trap function for an OSPF process.
Syslog
Run the log-adj-changes command to allow the Syslog to record the adjacency changes.
3.4 Configuration
(Optional) The configurations are mandatory if the physical network is the X.25, frame
relay, or ATM network.
Setting the Network
ipv6 ospf network Defines the network type.
Type
ipv6 ospf neighbor Specifies a neighbor.
ipv6 ospf priority Configures the DR priority.
(Optional) It is used to reduce interaction of routing information and the size of routing
Configuring the Stub
table, and enhance stability of routes.
Area and NSSA Area
areastub Configures a stub area.
3-20
Configuration Guide Configuring OSPFv3
(Optional) It is used to reduce interaction of routing information and the size of routing
table, and enhance stability of routes.
Configuring Route Summarizes routes that are advertised
arearange
Summarization between areas.
Summarizes routes that are introduced
summary-prefix
through redistribution.
(Optional) It is used to manually control the shortest route computed by OSPF and
determine whether to select an OSPF route preferentially.
Modifies the reference bandwidth of the
auto-costreference-bandwidth
auto cost.
Modifies the cost in the outbound
Modifying the Route ipv6 ospf cost
direction of an interface.
Cost and AD
Modifies the cost of the default route in a
areadefault-cost
stub or an NSSA area.
Modifies the default metric of a
default-metric
redistributed route.
distance Modifies the OSPF AD.
(Optional) It is used to prevent routers that illegally access the network and hosts that
forge OSPF packets from participating in the OSPF protocol process.
Enables authentication and sets the
areaauthentication
authentication mode in an area.
Enables encryption and authentication
areaencryption and sets the authentication mode in an
Enabling Authentication
area.
Enables authentication and sets the
ipv6 ospf authentication
authentication mode on an interface.
Enables encryption and authentication
ipv6 ospf encryption and sets the authentication mode on an
interface.
Modifying the Maximum (Optional) It is used to prevent the problem of performance deterioration caused by
Number of Concurrent over-consumption of the CPU.
Neighbors max-concurrent-dd Modifies the maximum number of con
3-21
Configuration Guide Configuring OSPFv3
(Optional) It is used to prevent the problem that the adjacency cannot be set up due to
Disabling MTU
MTU inconsistency on the neighbor interface.
Verification
ipv6 ospf mtu-ignore Disables MTU verification on an interface.
(Optional) It is used to prevent termination of the adjacency due to the delay or loss of
Enabling Two-Way
Hello packets.
Maintenance
two-way-maintain Enables two-way maintenance.
(Optional) The configurations enable users to use the SNMP network management
software to manage OSPF.
enable mib-binding Bind MIB to the OSPF process.
Configuring Network
Enables the trap function of the OSPF
Management Functions enable traps
process.
Allows the syslogs to record the changes
log-adj-changes
in adjacency status.
(Optional) You are advised not to modify protocol control parameters unless
necessary.
ipv6 ospf hello-interval Modifies the Hello interval on an interface.
Modifying Protocol
Modifies the neighbor death interval on an
Control Parameters ipv6 ospf dead-interval
interface.
Modifies the LSU packet transmission
ipv6 ospf transmit-delay
delay on an interface.
3-22
Configuration Guide Configuring OSPFv3
Set up an OSPF routing domain on the network to provide IPv6 unicast routing service for users on the network.
Notes
Ensure that the IPv6 routing function is enabled, that is, ipv6 routing is not disabled; otherwise, OSPF cannot be
enabled.
Configuration Steps
Mandatory.
Configuring a Router ID
(Optional) It is strongly recommended that you manually configure the router ID.
If the router ID is not configured, OSPF selects an interface IP address. If the IP address is not configured for any
interface, or the configured IP addresses have been used by other OSPF instances, you must manually configure the
router ID.
3-23
Configuration Guide Configuring OSPFv3
Mandatory.
Verification
Run the show ipv6 route ospf command to verify that the entries of the OSPF routing table are correctly loaded.
Run the ping command to verify that the IPv6 unicast service is correctly configured.
Related Commands
Configuring a Router ID
Command router-idrouter-id
Parameter router-id: Indicates the ID of the device, which is expressed in the IPv4 address.
Description
Command OSPF routing process configuration mode
Mode
Usage Guide Every device where OSPFv3 run must be identified by using a router ID. You can configure any IPv4
address as the router ID of the device, and ensure that the router ID is unique in an AS. If multiple
OSPFv3 processes run on the same device, the router ID of each process must also be unique.
After the router ID changes, OSPF performs a lot of internal processing. Therefore, you are advised
not to change the router ID unless necessary. When an attempt is made to modify the router ID, a
prompt is displayed, requesting you to confirm the modification. After the OSPFv3 process is enabled,
you are advised to specify the router ID before configuring other parameters of the process.
3-24
Configuration Guide Configuring OSPFv3
Usage Guide Run this command in interface configuration mode to enable the interface to participate in OSPFv3,
and then run the ipv6 router ospf command to configure the OSPFv3 process. After the OSPFv3
process is configured, the interface will automatically participate in the related process.
Run the no ipv6 ospfarea command so that the specified interface no longer participates in the
OSPFv3 routing process.
Run the no ipv6 router ospf command so that all interfaces no longer participate in the OSPFv3
routing process.
The adjacency can be set up only between devices with the same instance-id.
After this command is configured, all prefix information on the interface will participate in the OSPFv3
process.
3-25
Configuration Guide Configuring OSPFv3
Usage Guide In an OSPFv3 AS, all areas must be connected to the backbone area to properly learn the routing
information of the entire OSPFv3 AS. If an area cannot be directly connected to the backbone area,
the virtual link can be used to connect this area to the backbone area.
The area where the virtual link is located cannot be a stub or NSSA area.
At both ends of neighbors between which the virtual link is set up, settings of hello-interval,
dead-interval, and instance must be consistent; otherwise, the adjacency cannot be set up properly.
Configuration Example
Scenario
A(config-if-GigabitEthernet 0/1)#exit
3-26
Configuration Guide Configuring OSPFv3
A(config-if-GigabitEthernet 0/2)#exit
A(config-router)#router-id1.1.1.1
B
B#configure terminal
B(config-if-GigabitEthernet 0/1)#exit
B(config-if-GigabitEthernet 0/2)#exit
B(config-router)#router-id2.2.2.2
C
C#configure terminal
C(config-if-GigabitEthernet 0/3)#exit
C(config-router)#router-id3.3.3.3
D
D#configure terminal
D(config-if-GigabitEthernet 0/3)#exit
3-27
Configuration Guide Configuring OSPFv3
D(config-router)#router-id4.4.4.4
Verification Verify that the OSPF neighbors are correct on all routers.
Verify that the routing table is correctly loaded on all routers.
Verify that 2001:2::2/64 can be pinged successfully on Router D.
A
A#show ipv6 ospf neighbor
IA - Inter area
B
B# show ipv6 ospf neighbor
3-28
Configuration Guide Configuring OSPFv3
IA - Inter area
C
C# show ipv6 ospf neighbor
IA - Inter area
D
D# show ipv6 ospf neighbor
3-29
Configuration Guide Configuring OSPFv3
IA - Inter area
D#
D#ping 2001:2::2
!!!!!
Common Errors
OSPF cannot be enabled because the IPv6 unicast routing function is disabled.
If the physical network is X.25, Frame Relay, or ATM, OSPF can also run to provide the IPv6 unicast routing service.
Notes
The broadcast network sends multicast OSPF packets, automatically discovers neighbors, and elects a DR and a BDR.
The P2P network sends multicast OSPF packets and automatically discovers neighbors.
The NBMA network sends unicast OSPF packets. Neighbors must be manually specified, and a DR and a BDR must be
elected.
3-30
Configuration Guide Configuring OSPFv3
The P2MP network (without carrying the non-broadcast parameter) sends multicast OSPF packets. Neighbors are
automatically discovered.
The P2MP network (carrying the non-broadcast parameter) sends unicast OSPF packets. Neighbors must be
manually specified.
Configuration Steps
Optional.
Configuring a Neighbor
(Optional)If the interface network type is set to NBMA or P2MP (carrying the non-broadcast parameter), neighbors
must be configured.
Neighbors are configured on routers at both ends of the NBMA or P2MP (carrying the non-broadcast parameter)
network.
(Optional)You must configure the interface priority if a router must be specified as a DR, or a router cannot be specified
as a DR.
Configure the interface priority on a router that must be specified as a DR, or cannot be specified as a DR.
Verification
Run the show ipv6 ospf interface command to verify that the network type of each interface is correct.
Related Commands
3-31
Configuration Guide Configuring OSPFv3
Configuring a Neighbor
Configuration Example
Scenario
3-32
Configuration Guide Configuring OSPFv3
B
B#configure terminal
C
C#configure terminal
Interface ID 2
IPv6 Prefixes
Timer interval configured, Hello 30, Dead 120, Wait 40, Retransmit 10
Common Errors
3-33
Configuration Guide Configuring OSPFv3
The network types configured on interfaces at two ends are inconsistent, causing abnormal route learning.
The network type is set to NBMA or P2MP (non-broadcast), but neighbors are not specified.
Introduce unicast routes for other AS domains to the OSPF domain to provide the unicast routing service to other AS
domains for users in the OSPF domain.
In the OSPF domain, inject a default route to another AS domain so that the unicast routing service to another AS
domain can be provided for users in the OSPF domain.
Notes
Configuration Steps
(Optional)This configuration is mandatory if external routes of the OSPF domain should be introduced to the ASBR.
(Optional)Perform this configuration if the default route should be introduced to an ASBR so that other routers in the
OSPF domain access other AS domains through this ASBR by default.
Verification
On a router inside the OSPF domain, run the show ipv6 route ospf command to verify that the unicast routes to other
AS domains are loaded.
On a router inside the OSPF domain, run the show ipv6 route ospf command to verify that the default route to the
ASBR is loaded.
Run the ping command to verify that the IPv6 unicast service to other AS domains is correct.
Related Commands
Command redistribute {bgp | connected |isis[area-tag] |ospfprocess-id| rip | static}[{level-1 | level-1-2 | level-2} |
match {internal | external [1|2]nssa-external [1|2]} | metric metric-value|metric-type {1|2} | route-map
route-map-name |tagtag-value]
Parameter bgp: Indicates redistribution from BGP.
Description connected: Indicates redistribution from direct routes.
3-34
Configuration Guide Configuring OSPFv3
isis [ area-tag ]: Indicates redistribution from IS-IS.area-tag specifies the IS-IS instance.
ospfprocess-id: Indicates redistribution from OSPF.process-id specifies an OSPF instance. The value
ranges from 1 to 65535. 1-65535
rip: Indicates redistribution from RIP.
static: Indicates redistribution from static routes.
level-1 | level-1-2 | level-2: Used only when IS-IS routes are redistributed. Only the routes of the specified
level are redistributed. By default, only level-2 IS-IS routes can be redistributed.
match: Used only when OSPF routes are redistributed. Only the routes that match the specified criteria are
redistributed. By default, all OSPF routes can be redistributed.
metricmetric-value: Indicates the metric of the OSPF external LSA. metric-value specifies the size of the
metric. The value ranges from 0 to 16,777,214.
metric-type {1|2}: Indicates the external route type, which can be E-1 or E-2.
route-maproute-map-name: Sets the redistribution filtering rules.
tagtag-value: Specifies the tag value of the route that is redistributed into the OSPF routing domain. The
value ranges from 0 to 4294967295.
Command OSPF routing process configuration mode
Mode
Usage Guide When the device supports multiple routing protocols, collaboration between protocols is very important. To
run multiple routing protocols concurrently, the device must be able to redistribute routing information of a
protocol to another protocol. This applies to all routing protocols.
During redistribution of IS-IS routes, level-1,level-2, or level-1-2 can be configured to indicate that IS-IS
routes of the specified level(s) will be redistributed. By default, IS-IS routes of level 2 are redistributed.
During redistribution of OSPFv3 routes, match can be configured to indicate that OSPFv3 routes of the
specified sub-type will be redistributed. By default, all types of OSPFv3 routes are redistributed.
For the level parameter configured during redistribution of IS-IS routes and the match parameter configured
during redistribution of OSPFv3 routes, the routes are matched against the route map only when the
sub-type of the routes are correct.
During configuration of route redistribution, the match rules configured in route map configuration mode
areused based on the original information of routes. The priorities of tag, metric and metric-type in the
route redistribution configuration are lower than the priority of theset rulesconfigured in route map
configuration mode.
The set metric value of the associated routemap should fall into the range of 0 to 16,777,214. If the value
exceeds this range, routes cannot be introduced.
The configuration rules for the no form of the redistribute command are as follows:
1. If some parameters are specified in the no form of the command, default values of these parameters will
be restored.
2. If no parameter is specified in the no form of the command, the entire command will be deleted.
For example, if redistribute isis 112 level-2 is configured, the no redistribute isis 112 level-2 command
only restores the default value of level-2. As level-2 itself is the default value of the parameter, the
configuration saved is still redistribute isis 112 level-2 after the preceding no form of the command is
executed. To delete the entire command, you need to run the no redistribute isis 112 command.
3-35
Configuration Guide Configuring OSPFv3
Configuration Example
3-36
Configuration Guide Configuring OSPFv3
Scenario
Verification On Router D, run the show ipv6ospf database external brief command to verify that an LSA
corresponding to an external route is generated.
On Router C, run the show ipv6 route ospf command to verify that the external static route has been
introduced.
D
D#show ipv6 ospf database external
AS-external-LSA
LS age: 7
LS Type: AS-External-LSA
Checksum: 0x9C1F
Length: 36
Metric: 20
Prefix: 2001:10:10::/64
3-37
Configuration Guide Configuring OSPFv3
C
C#show ipv6 route ospf
IA - Inter area
Scenario
Verification On Router D, run the show ipv6ospf database external brief command to verify that an LSA
corresponding to the default route is generated.
On Router C, run the show ipv6 route ospf command to verify that the OSPF default route exists.
3-38
Configuration Guide Configuring OSPFv3
D
D#show ipv6 ospf database external
AS-external-LSA
LS age: 3
LS Type: AS-External-LSA
Checksum: 0x1839
Length: 32
Metric: 1
Prefix: ::/0
C
C#show ipv6route ospf
IA - Inter area
Common Errors
A route loop is formed because the default-information originate always command is configured on multiple routers.
Routes cannot be introduced because route redistribution is configured on a router in the stub area.
3-39
Configuration Guide Configuring OSPFv3
Configure an area located on the stub as a stub area to reduce interaction of routing information and the size of routing
table, and enhance stability of routes.
Notes
A router in the stub area cannot introduce external routes, but a router in the NSSA area can introduce external routes.
Configuration Steps
(Optional)Perform this configuration if you wish to reduce the size of the routing table on routers in the area.
(Optional)Perform this configuration if you wish to reduce the size of the routing table on routers in the area and
introduce OSPF external routes to the area.
The area must be configured as an NSSA area on all routers in this area.
Verification
On a router in the stub area, run the show ipv6 route command to verify that the router is not loaded with any external
routes.
On a router in the NSSA area, run the show ipv6 ospf database command to verify that the introduced external route
generates Type 7 LSAs.
On a router in the backbone area, run the show ipv6 route command to verify that the router is loaded with external
routes introduced from the NSSA area.
Related Commands
3-40
Configuration Guide Configuring OSPFv3
LSAs.
Command OSPF routing process configuration mode
Mode
Usage Guide An area located on the stub of a network can be configured as a stub area. You must run the area stub
command on all routers in a stub area. Devices in a stub area cannot learn the external routes (Type 5
LSAs) of the AS. In practice, external routes take up a large proportion of the link status database.
Therefore, devices in a stub area can learn only a small amount of routing information, which reduces the
amount of system resources required to run the OSPFv3 protocol.
By default, an ABR in a stub area will generate a Type 3 LSA indicating the default fault, and advertise the
LSA to the stub area. In this way, devices in the stub area can access devices outside the AS.
To configure a totally stub area, add the no-summary keyword when running the area stub command on
the ABR.
3-41
Configuration Guide Configuring OSPFv3
To further reduce the number of LSAs sent to the NSSA area, you can configure the no-summary
parameter on the ABR to prevent the ABR from sending the summary LSAs (Type 3 LSA) to the NSSA area.
area default-cost is used on an ABR or ASBR connected to the NSSA area. This command configures the
cost of the default route sent from the ABR/ASBR to the NSSA area. By default, the cost of the default route
sent to the NSSA area is 1.
If an NSSA area has two or more ABRs, the ABR with the largest router ID is elected by default as the
translator for converting Type 7 LSAs into Type 5 LSAs. If the current device is always the translator ABR for
converting Type 7 LSAs into Type 5 LSAs, use the translator always parameter.
If the translator role of the current device is replaced by another ABR, the conversion capability is retained
during the time specified by stability-interval. If the router does not become a translator again during
stability-interval, LSAs that are converted from Type 7 to Type 5 will be deleted from the AS after
stability-interval expires.
To prevent a routing loop, LSAs that are converted from Type 7 to Type 5 will be deleted from the AS
immediately after the current device loses the translator role even if stability-interval does not expire.
In the same NSSA area, it is recommended that translator always be configured on only one ABR.
Configuration Example
Scenario
D(config-router)#redistribute static
A# configure terminal
A
A(config)#ipv6 router ospf 1
A(config-router)#area 1 stubno-summary
3-42
Configuration Guide Configuring OSPFv3
C#configure terminal
C
C(config)#ipv6 router ospf 1
C(config-router)#area 1 stub
Verification On Router C, run the show ipv6 route ospf command to display the routing table. Verify that there is
only one default inter-area route, and no external static route is introduced from Router D.
C
C#show ipv6 route ospf
IA - Inter area
Scenario
3-43
Configuration Guide Configuring OSPFv3
D
D#configure terminal
D(config-router)#area 1 nssa
D(config-router)#redistribute static
B#configure terminal
B
B(config)#ipv6 router ospf 1
B(config-router)#area 1 nssa
Verification On Router D, run the show ipv6 ospf database command to display the database information and
verify that Type 7 LSAs are generated.
On Router A, run the show ipv6 route ospf command to display the routing table and verify that an
external static route is introduced by Router D.
D
D#show ipv6 ospf database nssa-external
LS age: 1196
LS Type: NSSA-external-LSA
Checksum: 0x1F25
Length: 52
Metric: 20
Prefix: 2001:10::/64
3-44
Configuration Guide Configuring OSPFv3
A
A#show ipv6 route ospf
IA - Inter area
Common Errors
Configurations of the area type are inconsistent on routers in the same area.
External routes cannot be introduced because route redistribution is configured on a router in the stub area.
Summarize routes to reduce interaction of routing information and the size of routing table, and enhance stability of
routes.
Notes
The address range of the summarize route may exceed the actual network range in the routing table. If data is sent to a
network beyond the summarization range, a routing loop may be formed and the router processing load may increase.
To prevent these problems, a discard route must be added to the routing table or shield or filter routes.
Configuration Steps
(Optional) Perform this configuration when routes of the OSPF area need to be summarized.
Unless otherwise required, perform this configuration on an ABR in the area where routes to be summarized are
located.
3-45
Configuration Guide Configuring OSPFv3
(Optional) Perform this configuration when routes external to the OSPF domain need to be summarized.
Unless otherwise required, perform this configuration on an ASBR, to which routes that need to be summarized are
introduced.
Verification
Run the show ipv6 route ospf command to verify that individual routes do not exist and only the summarized route
exists.
Related Commands
3-46
Configuration Guide Configuring OSPFv3
continuous address space, the ABR can advertise only one summarized route to significantly reduce the
size of the routing table.
area range summarizes the routes between OSPFv3 areas, whereas summary-prefix summarizes
external routes of the OSPFv3 routing domain.
When configured on the NSSA ABR translator, summary-prefix summarizes redistributed routes and
routes obtained based on the LSAs that are converted from Type 7 to Type 5. When configured on the
ASBR (not an NSSA ABR translator), summary-prefix summarizes only redistributed routes.
Configuration Example
Configuration
Steps
Verification On Router A, check the routing table and verify that the entry 2001:16::/64 is generated and other routes do
not exist.
3-47
Configuration Guide Configuring OSPFv3
A
A#show ipv6 route ospf
IA - Inter area
Common Errors
Inter-area route summarization cannot be implemented because the area range command is configured on a non-ABR
device.
Routes that do not meet filtering conditions cannot be loaded to the routing table, or advertised to neighbors. Network
users cannot access specified destination network.
Notes
Filtering routes by using the distribute-list in command affects forwarding of local routes, but does not affect route
computation based on LSAs. Therefore, if route filtering is configured on the ABR, Type 3 LSAs will still be generated
and advertised to other areas because routes can still be computed based on LSAs. As a result, black-hole routes are
generated. In this case, you can run the area filter-list or area range (containing the not-advertise parameter)
command on the ABR to prevent generation of black-hole routes.
Configuration Steps
(Optional) This configuration is recommended if users need to be restricted from accessing the network in a certain
OSPF area.
Unless otherwise required, perform this configuration on an ABR in the area where filtered routes are located.
3-48
Configuration Guide Configuring OSPFv3
(Optional) Perform this configuration if external routes introduced by the ASBR need to be filtered.
Unless otherwise required, perform this configurationon an ASBR to which filtered routes are introduced.
(Optional) Perform this configuration if users need to be restricted from accessing a specified destination network.
Unless otherwise required, perform this configurationon a router that requires route filtering.
Verification
Run the show ipv6 route command to verify that the router is not loaded with routes that have been filtered out.
Run the ping command to verify that the specified destination network cannot be accessed.
Related Commands
3-49
Configuration Guide Configuring OSPFv3
interface-type interface-number: Specifies the interface for which LSA routes are filtered.
Command OSPF routing process configuration mode
Mode
Usage Guide Filter routes that are computed based on received LSAs. Only routes meeting the filtering conditions can be
forwarded. The command does not affect the LSDB or the routing tables of neighbors. The ACL and the
prefix list filtering rules are mutually exclusive in the configuration. That is, if the ACL is used for filtering
routes on a specified interface, the prefix list cannot be configured to filter routes on the same interface.
Filtering routes by using the distribute-list in command affects forwarding of local routes, but does not
affect route computation based on LSAs. Therefore, if route filtering is configured on the ABR, Type 3 LSAs
will still be generated and advertised to other areas because routes can still be computed based on LSAs.
As a result, black-hole routes are generated. In this case, you can run the area range (containing the
not-advertise parameter) command on the ABR to prevent generation of black-hole routes.
Configuration Example
Scenario
Verification On Router A, check the routing table. Verify that only the entry 2001:16:5::/64 is loaded.
A
A#show ipv6 route ospf
3-50
Configuration Guide Configuring OSPFv3
Scenario
Verification On Router A, check the routing table. Verify that only the entry 2001:16:5::/64 is loaded.
IA - Inter area
Common Errors
3-51
Configuration Guide Configuring OSPFv3
Filtering routes by using the distribute-list in command affects forwarding of local routes, but does not affect route
computation based on LSAs. Therefore, if route filtering is configured on the ABR, Type 3 LSAs will still be generated
and advertised to other areas because routes can still be computed based on LSAs. As a result, black-hole routes are
generated.
Change the OSPF routes so that the traffic passes through specified nodes or bypasses specified nodes.
Change the sequence that a router selects routes so as to change the priorities of OSPF routes.
Notes
If you run the ipv6 ospf cost command to configure the cost of an interface, the configured cost will automatically
overwrite the cost that is computed based on the auto cost.
Configuration Steps
Optional.
A router is connected with lines with different bandwidths. This configuration is recommended if you wish to
preferentially select the line with a larger bandwidth.
Optional.
A router is connected with multiple lines. This configuration is recommended if you wish to manually specify a
preferential line.
Optional.
This configuration is mandatory if the cost of external routes of the OSPF domain should be specified when external
routes are introduced to an ASBR.
Optional.
A router may be unstable during the restart process or a period of time after the router is restarted, and users do not
want to forward data through this router. In this case, this configuration is recommended.
Configuring the AD
Optional.
3-52
Configuration Guide Configuring OSPFv3
Perform this configuration if you wish to change the priorities of OSPF routes on a router that runs multiple unicast
routing protocols.
Verification
Run the show ipv6 ospf interface command to verify that the costs of interfaces are correct.
Run the show ipv6 route command to verify that the costs of external routes introduced by the ASBR are correct.
Restart the router. Within a specified period of time, data is not forwarded through the restarted router.
Related Commands
3-53
Configuration Guide Configuring OSPFv3
Description cost: Indicates the cost of the default summarized route injected to the stub or NSSA area. The value ranges
from 0 to 16,777,215.
Command OSPF routing process configuration mode
Mode
Usage Guide This command takes effect only on an ABR in a stub area or an ABR/ASBR in an NSSA area.
Configuring the AD
Configuration Example
3-54
Configuration Guide Configuring OSPFv3
Scenario
Verification On Router A, check the routing table. The next hop of the optimum path to 2001:16:1::/64 is Router B.
A
A#show ipv6 route ospf
IA - Inter area
Common Errors
If the cost of an interface is set to 0 in the ipv6 ospf cost command, a route computation error may occur. For example,
a routing loop is obtained.
3-55
Configuration Guide Configuring OSPFv3
All routers connected to the OSPF network must be authenticated to ensure stability of OSPF and protect OSPF
against intrusions.
Notes
If authentication is configured for an area, the configuration takes effect on all interfaces that belong to this area.
If authentication is configured for both an interface and the area to which the interface belongs, the configuration for the
interface takes effect preferentially.
Configuration Steps
Configuring Authentication
Optional.
Configuring Encryption
Optional.
Optional.
Optional.
Verification
If routers are configured with different authentication keys, run the show ipv6 ospf neighbor command to verify that
there is no OSPF neighbor.
If routers are configured with the same authentication key, run the show ipv6 ospf neighbor command to verify that
there are OSPF neighbors.
Related Commands
3-56
Configuration Guide Configuring OSPFv3
Parameter area-id: Indicates the area ID.The value can be an integer or an IPv4 prefix.
Description spi: Indicates the SPI. The value ranges from 256 to 4,294,967,295.
md5: Enables MD5 authentication.
sha1: Enables SHA1 authentication.
0: Indicates that the key is displayed in plain text.
7: Indicates that the key is displayed in cipher text.
key: Indicates the authentication key.
Command OSPF routing process configuration mode
Mode
Usage Guide The RGOS supports three authentication types:
No authentication
MD5 authentication
SHA1 authentication
Configuration of area-based authentication for OSPFv3 takes effect on all interfaces (except virtual links) in
the area, but the interface-based authentication configuration takes precedence over the area-based
configuration.
Command areaarea-idencryption ipsec spispi esp[ null|[ des | 3des ][ 0 | 7 ] des-key][md5|sha1] [0|7] key
Parameter area-id: Indicates the area ID.The value can be an integer or an IPv4 prefix.
Description spi: Indicates the SPI. The value ranges from 256 to 4,294,967,295.
null: Indicates that no encryption mode is used.
des: Indicates that the Data Encryption Standard (DES) mode is used.
3des: Indicates that the Triple DES (3DES) mode is used.
des-key: Indicates the encryption key.
md5: Enables MD5 authentication.
sha1: Enables SHA1 authentication.
0: Indicates that the key is displayed in plain text.
7: Indicates that the key is displayed in cipher text.
key: Indicates the authentication key.
Command OSPF routing process configuration mode
Mode
Usage Guide The RGOS supports two encryption modes and two authentication modes.
The two encryption modes are as follows:
DES
3DES
The two authentication modes are as follows:
MD5
SHA1
Configuration of area-based encryption and authentication for OSPFv3 takes effect on all interfaces (except
virtual links) in the area, but the interface-based encryption and authentication configuration takes
3-57
Configuration Guide Configuring OSPFv3
Command ipv6 ospfencryption ipsec spispi esp[ null|[ des | 3des ][ 0 | 7 ] des-key][md5|sha1] [0|7]
key[instanceinstance-id]
Parameter spi: Indicates the SPI. The value ranges from 256 to 4,294,967,295.
Description null: Indicates that no encryption mode is used.
des: Indicates that the DES mode is used.
3des: Indicates that the3DES mode is used.
des-key: Indicates the encryption key.
md5: Enables MD5 authentication.
sha1: Enables SHA1 authentication.
0: Indicates that the key is displayed in plain text.
7: Indicates that the key is displayed in cipher text.
key: Indicates the authentication key.
instance instance-id: Indicates the ID of a specified OSPFv3 process of the interface. The value ranges
from 0 to 255.
Command OSPF routing process configuration mode
Mode
Usage Guide The RGOS supports two encryption modes and two authentication modes.
The two encryption modes are as follows:
DES
3-58
Configuration Guide Configuring OSPFv3
3DES
The two authentication modes are as follows:
MD5
SHA1
OSPFv3 encryption and authentication parameters configured on the local interface must be consistent with
those configured on the interconnected interfaces.
Configuration Example
Scenario
B
B# configure terminal
Verification On Router A and Router B, verify that the OSPF neighbor status is correct.
A
A# show ipv6 ospf neighbor
B
B# show ipv6 ospf neighbor
Common Errors
3-59
Configuration Guide Configuring OSPFv3
Control the maximum number of concurrent neighbors on the OSPF process to ease the pressure on the device.
Notes
Configuration Steps
(Optional) This configuration is recommended if you wish to set up the OSPF adjacency more quickly when a router is
connected with a lot of other routers.
Verification
Run the show ipv6 ospf neighbor command to display the number of neighbors that are concurrently interacting with
the OSPF process.
Related Commands
Command max-concurrent-ddnumber
Parameter number: Specifies the maximum number of neighbors that are concurrently interacting with the OSPF
Description process. The value ranges from 1 to 65,535.
Command OSPF routing process configuration mode
Mode
Usage Guide When the performance of a router is affected because the router exchanges data with multiple neighbors,
you can configure this command to restrict the maximum of neighbors with which each OSPF process can
concurrently initiate or accept interaction.
3-60
Configuration Guide Configuring OSPFv3
you can configure this command to restrict the maximum of neighbors with which all OSPF processes can
concurrently initiate or accept interaction.
Configuration Example
Scenario
Verification On the Router Core, check the neighbor status and verify that at most eight neighbors concurrently
interact with the OSPF process.
Common Errors
N/A
The unicast routing service can be provided even if the MTUs of interfaces on neighbor routers are different.
Notes
Configuration Steps
(Optional) MTU verification is disabled by default. You are advised to retain the default configuration.
3-61
Configuration Guide Configuring OSPFv3
Verification
Related Commands
Configuration Example
Scenario
B
B# configure terminal
3-62
Configuration Guide Configuring OSPFv3
Common Errors
N/A
Notes
Configuration Steps
(Optional) This function is enabled by default. You are advised to retain the default configuration.
Verification
Related Commands
Command two-way-maintain
Parameter N/A
Description
Command OSPF routing process configuration mode
Mode
Usage Guide On a large network, a lot of packets may be sent or received, occupying too much CPU and memory. As a
result, some packets are delayed or discarded. If the processing time of Hello packets exceeds the dead
interval, the adjacency will be destroyed due to timeout.If the two-way maintenance function is enabled, in
addition to the Hello packets, the DD, LSU, LSR, and LSAck packets can also be used to maintain the
bidirectional communication between neighbors when a large number of packets exist on the network. This
prevents termination of the adjacency caused by delayed or discarded Hello packets.
3-63
Configuration Guide Configuring OSPFv3
Configuration Example
Scenario
A(config-router)#two-way-maintain
Verification When the adjacency is being set up, Router A checks the neighbor dead interval and updates the dead
interval without waiting for Router B to send a Hello packet.
A
A# show ipv6 ospfneighbor
Common Errors
N/A
Once a link is faulty, OSPF can quickly detect the failure of the route. This configuration helps shorten the traffic
interruption time.
Notes
If BFD is configured for both a process and an interface, the interface-based configuration takes effect preferentially.
Configuration Steps
(Optional) Perform this configuration if you wish to accelerate OSPF network convergence.
3-64
Configuration Guide Configuring OSPFv3
Verification
Run the show bfd neighbor command to verify that the BFD neighbors are normal.
Related Commands
Configuration Example
3-65
Configuration Guide Configuring OSPFv3
Scenario
A(config-router)#bfd all-interfaces
B
B(config)# interface GigabitEthernet 0/1
B(config-router)#bfd all-interfaces
Verification On Router A and Router B, verify that the BFD state is Up.
Disconnect Router B from the switch. On Router A, verify that a neighbor is found disconnected during
BFD, and the corresponding OSPF route is deleted.
A
A# show ipv6 ospf neighbor
B
B# show ipv6 ospf neighbor
Common Errors
N/A
3-66
Configuration Guide Configuring OSPFv3
3.4.13 Enabling GR
Configuration Effect
When a distributed route switches services from the active board to the standby board, traffic forwarding continues and
is not interrupted.
When the OSPF process is being restarted, data forwarding continues and is not interrupted.
Notes
The grace period cannot be shorter than the neighbor dead time of the neighbor router.
Configuration Steps
(Optional) This function is enabled by default. You are advised to retain the default configuration.
Perform this configuration on routers where hot standby switchover is triggered or the OSPF process is restarted.
(Optional) This function is enabled by default. You are advised to retain the default configuration.
Perform this configuration on a router if hot standby switchover is triggered or the OSPF process is restarted on a
neighbor of this router.
Verification
When a distributed router switches services from the active board to the standby board, data forwarding continues and
the traffic is not interrupted.
When the OSPF process is being restarted, data forwarding continues and the traffic is not interrupted.
Related Commands
3-67
Configuration Guide Configuring OSPFv3
Usage Guide The GR function is configured based on the OSPF process. You can configure different parameters for
different OSPF processes based on the actual conditions. This command is used to configure the GR
restarter capability of a device. The grace period is the maximum time of the entire GR process, during
which link status is rebuilt so that the original state of the OSPF process is restored. After the grace period
expires, OSPF exits the GR state and performs common OSPF operations.
Run the graceful-restart command to set the grace period to 120s. The graceful-restart grace-period
command allows you to modify the grace period explicitly.
The precondition for successful execution of GR and uninterrupted forwarding is that the topology remains
stable. If the topology changes, OSPF quickly converges without waiting for further execution of GR, thus
avoiding long-time forwarding black-hole.
Disabling topology detection: If OSPF cannot converge in time when the topology changes during the
hot standby process, forwarding black-hole may appear in a long time.
Enabling topology detection: Forwarding may be interrupted when topology detection is enabled, but
the interruption time is far shorter than that when topology detection is disabled.
In most cases, it is recommended that topology detection be enabled. In special scenarios, topology
detection can be disabled if the topology changes after the hot standby process, but it can be ensured that
the forwarding black-hole will not appear in a long time. This can minimize the forwarding interruption time
during the hot standby process.
If the Fast Hello function is enabled, the GR function cannot be enabled.
3-68
Configuration Guide Configuring OSPFv3
recommended that you disable the LSA checking options (strict-lsa-checking and internal-lsa-checking)
because regional network changes may trigger termination of GR and consequently reduce the
convergence of the entire network.
Configuration Example
Scenario
B(config-router)# graceful-restart
Verification Trigger a hot standby switchover on Router B, and verify that the routing tables of destination Network 1
and Network 2 remain unchanged on Router A during the switchover.
Trigger a hot standby switchover on Router B, ping destination Network 1 from Router A, and verify that
traffic forwarding is not interrupted during the switchover.
Common Errors
Traffic forwarding is interrupted during the GR process because the configured grace period is shorter than the
neighbor dead time of the neighbor router.
Use the network management software to manage OSPF parameters and monitor the OSPF running status.
Notes
3-69
Configuration Guide Configuring OSPFv3
You must enable the MIB function of the SNMP server before enabling the OSPF MIB function.
You must enable the trap function of the SNMP server before enabling the OSPF trap function.
You must enable the logging function of the device before outputting the OSPF logs.
Configuration Steps
(Optional) This configuration is required if you want to use the network management software to manage parameters of
a specified OSPF process.
(Optional) This configuration is required if you want to use the network management software to monitor the OSPF
running status.
(Optional) This function is enabled by default. You are advised to retain the default configuration. If you want to reduce
the log output, disable this function.
Verification
Use the network management software to monitor the OSPF running status.
Related Commands
3-70
Configuration Guide Configuring OSPFv3
Configuration Example
Scenario
3-71
Configuration Guide Configuring OSPFv3
A(config)#
Verification Use the MIB tool to read and set the OSPF parameters and display the OSPF running status.
Common Errors
N/A
Notes
The neighbor dead time cannot be shorter than the Hello interval.
Configuration Steps
(Optional) You are advised to retain the default configuration. This configuration can be adjusted if you wish to
accelerate OSPF convergence when a link fails.
3-72
Configuration Guide Configuring OSPFv3
(Optional) You are advised to adjust this configuration if a lot of routes exist in the user environment and network
congestion is serious.
(Optional) You are advised to retain the default configuration. This configuration can be adjusted if a lot of routes exist in
the user environment.
Verification
Run the show ipv6 ospf and show ipv6 ospf neighbor commands to display the protocol running parameters and
status.
Related Commands
3-73
Configuration Guide Configuring OSPFv3
that the neighbor dead interval is longer than the Hello interval.
3-74
Configuration Guide Configuring OSPFv3
3-75
Configuration Guide Configuring OSPFv3
3-76
Configuration Guide Configuring OSPFv3
Configuration Example
Scenario
B
B# configure terminal
3-77
Configuration Guide Configuring OSPFv3
Verification Check the interface parameters on Router A and Router B. Verify that the Hello interval is 10s and the
dead interval is 50s.
On Router A and Router B, verify that the OSPF neighbor information is correct.
A
A# show ipv6 ospf interface
Interface ID 2
IPv6 Prefixes
Timer interval configured, Hello 15, Dead 50, Wait 40, Retransmit 10
3-78
Configuration Guide Configuring OSPFv3
B
B# show ipv6 ospf interface
Interface ID 2
IPv6 Prefixes
Timer interval configured, Hello 15, Dead 50, Wait 40, Retransmit 10
Common Errors
The configured neighbor dead time is shorter than the Hello interval.
Notes
Configuration Steps
3-79
Configuration Guide Configuring OSPFv3
Verification
Run the show ipv6 ospf neighbor command to display the protocol status.
Related Commands
Parameter all: Indicates that packets are allowed to be sent to all sub VLANs.
Description
vid: Specifies the sub VLAN ID. The value ranges from 1 to 4094.
In normal cases, a super VLAN contains multiple sub VLANs. Multicast packets of a super VLAN are also
Usage Guide
sent to its sub VLANs. In this case, when OSPF multicast packets are sent over a super VLAN containing
multiple sub VLANs, the OSPF multicast packets are replicated multiple times, and the device processing
capability is insufficient. As a result, a large number of packets are discarded, causing the neighbor down
error. In most scenarios, the OSPF function does not need to be enabled on a super VLAN. Therefore, the
OSPF function is disabled by default. However, in some scenarios, the OSPF function must be run on the
super VLAN, but packets only need to be sent to one sub VLAN. In this case, run this command to specify a
particular sub VLAN. You must be cautious in configuring packet transmission to all sub VLANs, as the large
number of sub VLANs may cause a device processing bottleneck, which will lead to the neighbor down
error.
Configuration Example
Scenario
3-80
Configuration Guide Configuring OSPFv3
B B# configure terminal
3.5 Monitoring
Clearing
Running the clear commands may lose vital information and thus interrupt services.
Description Command
Clears and resets an OSPF process. clear ipv6 ospf [ process-id]process
Displaying
Description Command
Displays the OSPF process show ipv6 ospf [ process-id ]
configurations.
Displays information about the OSPF show ipv6 ospf[process- id] database[lsa-type [adv-routerrouter-id] ]
LSDB.
Displays OSPF-enabled interfaces. show ipv6 ospf [ process-id ] interface [ interface-type interface-number | brief]
Displays the OSPF neighbor list. show ipv6 ospf[process- id] neighbor[interface-type interface-number[detail]|
neighbor-id |detail]
Displays the OSPF routing table. show ipv6 ospf [ process-id ] route[ count ]
Displays the summarized route of showipv6ospf[process-id]summary-prefix
OSPF redistributed routes.
Displays the OSPF network topology show ipv6 ospf[process- id] topology [areaarea-id]
information.
Displays OSPF virtual links. show ipv6 ospf [ process-id ] virtual-links
Debugging
System resources are occupied when debugging information is output. Therefore, disable debugging immediately after
use.
3-81
Configuration Guide Configuring OSPFv3
Description Command
Debugs OSPF events. debug ipv6 ospf events [abr|asbr|os|nssa|router| vlink]
Debugs OSPF interfaces. debug ipv6 ospf ifsm [events|status|timers]
Debugs OSPF neighbors. debug ipv6 ospf nfsm [events | status | timers]
Debugs the OSPF NSM. debug ipv6 ospf nsm [interface | redistribute | route]
Debugs OSPF LSAs. debug ipv6 ospf lsa [flooding | generate | install | maxage | refresh]
Debugs OSPF packets. debug ipv6 ospf packet [dd|detail|hello|ls-ack|ls-request|ls-update|recv|send]
Debugs OSPF routes. debug ipv6 ospf route [ase | ia | install | spf | time]
3-82
Configuration Guide Configuring IS-IS
4 Configuring IS-IS
4.1 Overview
Intermediate System to Intermediate System (IS-IS) is an extensible, robust, and easy-to-use Interior Gateway Protocol (IGP)
for route selection and applicable to an IP-ISO CLNS dual environment network (ISO CLNS is short for International
Organization for Standardization Connectionless Network Service).
IS-IS has the common characteristics of a link state protocol. It sends Hello packets to discover and maintain neighbor
relationships, and sends Link State Protocol Data Units (LSPs) to neighbors to advertise its link state. IS-IS supports Level-1
routing and Level-2 routing. All devices at the same Level maintain the same Link State Database (LSDB), which stores the
LSPs generated by the devices to notify each other of the Level's network topology. Each device uses the Dijkstra Shortest
Path First (SPF) algorithm to perform best-route calculation, path selection, and fast convergence.
RFC1195: Use of OSI IS-IS for routing in TCP/IP and dual environments
RFC3786: Extending the Number of Intermediate System to Intermediate System (IS-IS) Link State PDU (LSP)
Fragments Beyond the 256 Limit
RFC3373: Three-Way Handshake for Intermediate System to Intermediate System (IS-IS) Point-to-Point Adjacencies
RFC3784: Intermediate System to Intermediate System (IS-IS) Extensions for Traffic Engineering (TE)
4.2 Applications
Application Description
Planar Topology A planar topology is applicable to a small-scale network. At the initial stage of
large-scale network construction, core devices are deployed to form an area based on
a planar topology.
Hierarchical Topology A hierarchical topology is applicable to a large-scale network with frequent link
flapping.
4-1
Configuration Guide Configuring IS-IS
A planar topology is formed by devices in the same area. See Figure 4-1.
Deployment
To facilitate future extension and reduce device burden, configure the devices in a planar topology as Level-2 devices.
A hierarchical topology divides the network into the core layer, convergence layer, and access layer. See Figure 4-2.
When primary and secondary routes exist, devices at the convergence layer leak Leve4-2 routes to Level-1 areas.
4-2
Configuration Guide Configuring IS-IS
Deployment
4.3 Features
Basic Concepts
An IS is a router, which is the basic unit used to transmit routing information and generate routes in IS-IS.
ES-IS is the protocol used for communication between ESs and ISs in Open System Interconnection (OSI) to dynamically
discover Level-2 neighbor relationships.
Domain
A set of ISs in the same routing domain (RD) use the same routing protocol to exchange routing information.
Area
CSNPs are sent by a Designated Intermediate System (DIS) every 10s to synchronize link states in a broadcast network.
PSNPs are sent by a point-to-point (P2P) link to confirm LSPs, or request LSPs in a broadcast network.
CLNP is an OSI protocol used to transmit data and error messages at the network layer. It is similar to the IP protocol.
The CLNS is a type of unreliable connection and requires no circuit setup before data transmission.
4-3
Configuration Guide Configuring IS-IS
Similar to a DIS router (DR) in Open Shortest Path First (OSPF), a DIS propagates LSPs to other machines in a Local Area
Network (LAN). Neighbor relationships are established not only between DISs and other machines but also between those
machines. This characteristic is not possessed by OSPF.
Hello Packet
LSP
LSPs describe link states, similar to link-state advertisement (LSA) in OSPF, but the former do not depend on TCP/IP
information. LSPs are classified into Level-1 LSPs and Level-2 LSPs, depending on different route types.
An NSEL (sometimes referred to as SEL) specifies the target network-layer protocol service. It is similar to the TCP/UDP port
for the Upper Layer Service in the IP protocol. In IS-IS, SEL is typically set to 00 to indicate a device.
An NSAP is the CLNS complete address, including the OSI address and high-layer processes. It consists of an area ID, a
system ID, and SEL. When SEL is set to 00, the NSAP is a Network Entity Title (NET), similar to an IP address plus a
protocol number.
An SNPA provides physical connections and network-layer services. It is similar to a MAC address used in the IP protocol, a
Data Link Connection Identifier (DLCI) used by frame relay (FR), or High-Level Data Link Control (HDLC) in a wide area
network (WAN).
Level-1 Route
A Level-1 route is an intra-area route that only receives relevant information within the area. To reach other areas, you need
to store in Level-1 a default route destined for the closest Level-2.
Level-2 Route
A Level-2 route is an inter-area backbone route. Level-1 and Level-2 cannot be connected directly.
Level-1/Level-2 Route
A Level-1/Level-2 route is a border route connecting a Level-1 route and a Level-2 route. It maintains two databases for the
Level-1 and Level-2 routes respectively. It is similar to an area border router (ABR) in OSPF.
Pseudonode
A pseudonode identifies a broadcast subnet (LAN) and allows a broadcast medium to work as a virtual device, which has a
route as its interface. The route-pseudonode relationship is managed by a DIS.
4-4
Configuration Guide Configuring IS-IS
A NET is part of an OSI address and describes the area ID and system ID, but it does not define the NSEL, which is
contained in the NSAP of the specified system.
Circuit
Circuit is an interface-related term used in IS-IS. Whereas NSAP and NET indicate whole devices, a circuit indicates an
interface. The circuit ID of a P2P interface is one byte long. For example, the circuit ID of HDLC is 0x00. In a broadcast
network (for example, a LAN), the circuit ID is seven bytes long, including the system ID, for example, 1921.6800.0001.01.
For details about terms related to IS-IS, see ISO 10589 and RFC1195.
Overview
Feature Description
IS-IS Network An IS-IS network is divided into Level-1 and Level-2. The nodes on which devices exchange
Hierarchy information in the same area form one Level (Level-1).
IS-IS Address Coding An IS-IS address is called a NET, which consists of an area ID, a system ID, and an NSAP
Mode identifier.
IS-IS Packet Types There are three types of IS-IS packets: LSP, IS-IS Hello packet (IIH PDU), and serial number packet
(SNP) classified into CSNP and PSNP.
DIS Election A DIS simulates multiple access links as a pseudonode and generates LSPs for the pseudonode. The
pseudonode sets up a relationship with each device in the local network and forbids direct
communication between the devices.
IS-IS Supported TLV IS-IS supports 21 types of Type-Length-Value (TLV).
Types
LSP Fragment IS-IS floods LSPs to advertise link states. The size of an LSP is limited by the Maximum Transmission
Extension Unit (MTU) size of the link. When the content to be advertised exceeds one LSP, IS-IS will create
LSP fragments to carry new link state information.
IS-IS VRF VPN Routing and Forwarding (VRF) is mainly used for local routing and packet separation. It avoids
route conflict caused by use of the same prefix by multiple VPNs.
IS-IS MTR Multi-Topology Routing (MTR) is mainly used to calculate IPv4 and IPv6 unicast routes in IS-IS based
on different topologies.
IS-IS Neighbor Conditions for establishing IS-IS neighbor relationships under different configurations.
Working Principle
All devices in an area know the area's network topology and exchange data within the area. A Level-1/Level-2 device is a
border device that belongs to different areas and provides inter-area connections. Areas are connected by Level-2 devices.
The border devices in various areas form a Level-2 backbone network for inter-area data exchange.
4-5
Configuration Guide Configuring IS-IS
Level-1 devices are only interested in the local area's topology, including all nodes in the local area and the next-hop devices
destined for the nodes. Level-1 devices access other areas through Level-2 devices and forward packets from a target
network outside of the local area to the closest Level-2 device.
Related Configuration
If circuit-type is set to Level-1 or Level-2-only, IS-IS will only send PDUs of the corresponding Level.
By default, is-type is set to Level-1/Level-2 if no IS-IS instance runs at Level-2 (including Level-1/Level-2). is-type is set to
Level-1 if there are IS-IS instances running at Level-2 (including Level-1/Level-2).
Run the is-type command to specify the Level at which IS-IS will run.
Changing the is-type value will enable or disable the routes of a certain Level. A device can have only one instance running
at Level-2 (including Level-1/Level-2).
Working Principle
4-6
Configuration Guide Configuring IS-IS
The area ID identifies the RD length in an area and is fixed relative to the RD. It ranges from one to 13 bytes.
The NSAP is a network selector and sometimes called SEL. In IS-IS, SEL is typically set to 00 to indicate a device.
Related Configuration
The command configures an area ID and a system ID in IS-IS. Different NET addresses must have the same system ID.
LSP
IIH PDU
Working Principle
LSP
LSPs are used to transmit link state records within an area and are classified into Level-1 LSPs and Level-2 LSPs. LSPs are
only flooded to the corresponding Level.
IIH PDU
IIH PDUs are used to maintain neighbor relationships. They carry multicast MAC addresses used to determine whether other
systems run IS-IS.
4-7
Configuration Guide Configuring IS-IS
CSNPs are used for LSDB synchronization. By default, a DIS sends a CSNP every 10s in a broadcast network. In a P2P
network, a CSNP is sent only after a neighbor relationship is established.
Related Configuration
By default, the LSP interval is 33 ms. If no Level is specified, the interval takes effect for Level-1 and Level-2 LSPs.
Run the isis lsp-interval command to configure the LSP interval on an IS-IS interface, in the unit of seconds.
By default, the Hello packet interval is 10s for Level-1 and Level-2.
Run the isis hello-interval command to configure the Hello packet interval on an IS-IS interface, in the unit of seconds.
The command changes the Hello packet interval. A DIS sends Hello packets at a frequency three times that by non-DIS
devices in a broadcast network. If an IS is elected as the DIS on the interface, by default, the interface sends a Hello packet
every 3.3s.
By default, the minimum PSNP interval is not configured, and the default interval 2s takes effect for Level-1 and Level-2
PSNPs.
Run the isis psnp-interval command to configure the minimum PSNP interval, in the unit of seconds.
PSNPs are mainly used to request LSPs that are absent locally or respond to received LSPs (in a P2P network). The PSNP
interval should be minimized. If many LSPs exist and the device performance is low, you can increase the PSNP interval and
LSP retransmission interval to reduce the device burden.
By default, CSNPs are sent at 10s intervals in a broadcast network. No CSNPs are sent in a P2P network. When you
configure a new CSNP interval without Level-1 or Level-2 specified, the interval takes effect for Level-1 and Level-2 CSNPs.
Run the isis csnp-interval command to specify the CSNP broadcast interval on an IS-IS interface, in the unit of seconds.
The command changes the CSNP interval. By default, a DIS sends a CSNP every 10s in a broadcast network. In a P2P
network, a CSNP is sent only after a neighbor relationship is established. An interface set to mesh-groups can be
configured to periodically send CSNPs. No CSNPs are sent if the CSNP interval is set to 0.
4-8
Configuration Guide Configuring IS-IS
A pseudonode is generated by a DIS and sets up a relationship with each device in the local network.
Working Principle
A DIS simulates multiple access links as a pseudonode and generates LSPs for the pseudonode. The pseudonode sets up a
relationship with each device in the local network and forbids direct communication between the devices. A broadcast subnet
and a non-broadcast multiple access (NBMA) network are considered as pseudonodes externally. Non-DIS devices report
their link states to the DIS in the same network, and the DIS maintains the link states reported by all ISs in the network. Like
DR election in OSPF, a DIS is elected to reduce unnecessary neighbor relationships and route information exchanges.
DIS election in IS-IS is preemptive. The election result can be manually controlled through interface priority configuration.
The device with a higher interface priority is more likely to be elected as the DIS.
Related Configuration
Run the isis priority command to configure the priority for DIS election in a LAN.
The command changes the priority carried in Hello packets in a LAN. The device with a lower priority is less likely to be
elected as the DIS.
The command is invalid on a P2P network interface. The no isis priority command, with or without parameters, restores the
priority to its default value. To change the configured priority, run the isis priority command with the priority specified to
overwrite the existing configuration, or you can first restore the priority to its default value and then configure a new priority.
Working Principle
4-9
Configuration Guide Configuring IS-IS
Related Configuration
Run the adjacency-check command to configure the neighbor detection protocol carried in Hello packets.
Working Principle
The 256 LSP fragments are insufficient in any of the following situations:
1. New applications (such as traffic engineering [TE]) extend new TLV or Sub-TLV.
3. Routes with reduced granularity are advertised, or other routes are redistributed to IS-IS.
After LSP fragments are used up, new routing information and neighbor information will be discarded, causing network
exceptions such as routing black holes or loops. LSP fragments must be extended to carry more link state information, thus
ensuring normal network operation.
You can configure an additional system ID and enable fragment extension to allow IS-IS to advertise more link state
information in extended LSP fragments. Each virtual system can be considered as a virtual device that establishes a
4-10
Configuration Guide Configuring IS-IS
neighbor relationship (with the path value being 0) with the originating system. Extended LSPs are published by the neighbor
of the originating system, that is, the virtual system.
Normal System ID
The system ID defined by ISO is used to establish neighbor relationships and learn routes. It is further defined as the normal
system ID in order to be distinguished from the additional system ID introduced to fragment extension.
Additional System ID
The additional system ID is configured by an administrator to generate extended LSPs. The additional system ID shares the
usage rules of the normal system ID (for example, the additional system ID must be unique in the entire area), except that the
additional system ID is not carried in Hello packets for neighbor relationship establishment.
Originating System
An originating system is an IS-IS-enabled device and maps a virtual system identified by the additional system ID.
A virtual system is identified by the additional system ID and used to generate extended LSPs. The virtual system concept is
proposed by RFC for distinguishing from the originating system concept. Each virtual system can generate up to 256 LSP
fragments. The administrator can configure multiple additional system IDs (virtual systems) to generate more LSP fragments.
Original LSP
An original LSP is the LSP whose system ID contained in the LSP ID is a normal system ID. Original LSPs are generated by
an originating system.
Extended LSP
An extended LSP is the LSP whose system ID contained in the LSP ID is an additional system ID. Extended LSPs are
generated by a virtual system.
Related Configuration
By default, fragment extension is disabled. If you do not specify a Level when enabling fragment extension, it will take effect
for Level-1 and Level-2 LSPs.
There are up to 256 LSP fragments. When the fragments are used up, subsequent link state information, including neighbor
information and IP route information, will be discarded, causing a network exception. To solve this problem, enable fragment
extension at the specified Level and configure an additional system ID by using the virtual-system command.
4-11
Configuration Guide Configuring IS-IS
Working Principle
Figure4-5 Separation of Different VPNs by VRF Tables Configured on Provider Edge (PE) Devices
In Figure4-5, the following configuration requirements exist: Configure the two sites (CE1 and CE3) in VPN1 to access each
other and the two sites (CE2 and CE4) in VPN2 to access each other, and forbid access between the sites in VPN1 and
those in VPN2, because VPN1 and VPN2 belong to different customers or departments and may have identical IP
addresses.
The customer edge (CE) devices connect the customer network to the PEs to exchange VPN routing information with the
PEs, that is, advertise local routes to the PEs and learn remote routes from the PEs.
Each PE learns routes from directly connected CEs and exchanges the learned VPN routes with the other PE through the
Border Gateway Protocol (BGP). The PEs provide access to the VPN service.
The Provider (P) device in the Service Provider (SP) network is not directly connected to the CEs. The P device only needs
the MPLS forwarding capability and does not maintain VPN information.
The IS-IS protocol running between the PEs and CEs requires the VRF capability to separate routing information between
VPN1 and VPN2. That is, IS-IS only learns routes through VRF.
Related Configuration
Run the VRF command to bind an IS-IS instance with a VRF table.
4-12
Configuration Guide Configuring IS-IS
The IS-IS instances bound with the same non-default VRF table must be configured with different system IDs. The IS-IS
instances bound with different VRF tables can be configured with the same system ID.
One IS-IS instance can be bound with only one VRF table, but one VRF table can be bound to multiple IS-IS instances.
When the VRF table bound to an IS-IS instance is changed, all IS-IS interfaces associated with the instance will be
deleted. That is, the ip (or ipv6) router isis [ tag ] interface configuration and the redistribution configuration in routing
process mode will be deleted.
IS-IS MTR is derived from IS-IS MT, which is used to separate IPv4 and IPv6 unicast topologies, unicast and multicast
topologies, and topologies using different protocol stacks (such as IPv4 and Pv6). IS-IS MTR separates IPv4 and IPv6
unicast topologies based on IS-IS MT.
Working Principle
Figure 4-6 shows a typical networking application. The following implementation requirements exist: Deploy an IPv6 unicast
topology in incremental mode, and upgrade some devices to support IPv4 and IPv6 dual protocol stacks while keeping other
IPv4-enabled devices unchanged.
In Figure 4-6, each link is marked by a number indicating its metric. RB only supports the IPv4 protocol stack, whereas other
devices support IPv4 and IPv6 dual protocol stacks.
4-13
Configuration Guide Configuring IS-IS
The networking constraint on consistency between IPv4 and IPv6 unicast topologies must be canceled to retain the use of
RB; otherwise, RB cannot establish a neighbor relationship with RA or RD, which will cause new problems.
In Figure 4-7, without IS-IS MTR support, the SPF calculations performed by RA, RB, RC, and RD only take into account the
single hybrid topology. The calculated shortest path is RA -> RB -> RD, with the overhead being 20. RB will discard IPv6
packets because it does not support IPv6.
In Figure 4-8, the IS-IS MTR technique is used to separate IPv4 and IPv6 unicast topologies. RA, RB, RC, and RD establish
neighbor relationships based on the IPv4 unicast topology and IPv6 unicast topology respectively. The left part shows the
IPv4 topology formed by IPv4-enbled routers. The calculated IPv4 shortest path is RA -> RB -> RC, which realizes IPv4
packet forwarding. The right part shows the IPv6 topology formed by IPv6-enabled routers. The calculated IPv6 shortest path
is RA -> RC -> RD, which realizes IPv6 packet forwarding.
4-14
Configuration Guide Configuring IS-IS
IS-IS MTR must be deployed to avoid routing black holes when some devices support only one protocol. IS-IS MTR is not
required when all devices support IPv4 and IPv6 dual protocol stacks.
Deployment of a new network: IS-IS MTR is not required when devices only support the IPv4 protocol stack. For
devices that only support the IPv6 protocol stack or devices that support IPv4 and IPv6 dual protocol stacks, enable the
MT mode of IS-IS MTR. You are advised not to enable Multi-Topology Transition (MTT); otherwise, loops may occur.
Reconstruction of an existing network with devices supporting only one protocol stack: Enable the MTT mode of IS-IS
MTR on devices that support IPv4 and IPv6 dual protocol stacks in sequence (starting from the device closest to a
device supporting only one protocol stack in the network topology). After the MTT mode is enabled on all new devices,
switch the MTT mode to the MT mode on these devices in sequence (starting from the device farthest from a device
supporting only one protocol stack in the network topology).
Related Configuration
Run the multi-topology command to configure IS-IS to support IPv6 unicast topologies. After that, IPv4 and IPv6 unicast
routes in IS-IS will be calculated based on different topologies.
Note the following constraints or conventions when you use the multi-topology command:
2. The MTR feature will be disabled if metric-style is set to Narrow or only one Level is configured to support the Wide or
Transition mode.
The interface addresses on both routing devices are in the same network segment.
The following conditions must be met for routing devices to establish a neighbor relationship when IS-IS MTR is configured:
The interface addresses on both routing devices are in the same network segments.
The routing devices have at least one consistent MT ID when P2P links are configured.
There are no constraints on the MT IDs that the routing devices support when LAN links are configured.
4-15
Configuration Guide Configuring IS-IS
4.4 Configuration
Configuring IS-IS SNPs (Optional) It is used to configure the CSNP broadcast interval.
4-16
Configuration Guide Configuring IS-IS
(Optional) It is used to configure the system type or interface circuit type in IS-IS.
Configuring the IS-IS Level
is-type { level-1 | level-1-2 | level-2-only } Configures the system type.
Type
isis circuit-type { level-1 | level-1-2 |
Configures the interface circuit type.
level-2-only [ external] }
4-17
Configuration Guide Configuring IS-IS
4-18
Configuration Guide Configuring IS-IS
4-19
Configuration Guide Configuring IS-IS
4-20
Configuration Guide Configuring IS-IS
Configuring BFD Support for Enables BFD support for IS-IS on all
bfd all-interfaces [anti-congestion]
IS-IS interfaces.
Enables or disables BFD support for IS-IS
isis bfd [ disable | anti-congestion ]
on the current interface.
4-21
Configuration Guide Configuring IS-IS
(Optional) It is used to calculate IPv4 and IPv6 unicast routes in IS-IS based on different
topologies.
Configuring IS-IS MTR
Configures IS-IS to support IPv6 unicast
multi-topology [ transition ]
topologies.
Optional.
4-22
Configuration Guide Configuring IS-IS
Before you run IS-IS, create an IS-IS routing process in global configuration mode. You can set the tag parameter after
the router isis command to name the process. You can add different tags to configure different IS-IS routing processes.
The setting of the tag parameter is optional.
A system ID uniquely identifies an IS in a routing AS; therefore, the system ID must be unique across the AS. In IS-IS,
each area may contain one or multiple area IDs. Normally, you only need to configure one area ID. You can configure
multiple area IDs to realize area division. If an IS is configured with multiple area IDs, the system IDs must be the same.
After an interface is added to the specified IS-IS routing process, the interface will establish a neighbor relationship.
Notes
The Level-1 IS devices in an area must be configured with the same area ID.
4-23
Configuration Guide Configuring IS-IS
The core routing table does not distinguish the routing entries generated by different IS-IS routing processes.
The IP addresses of interfaces connected between neighbors must be in the same network segment.
If the two IP addresses are in different network segments, a neighbor relationship cannot be established.
If you need to add an interface to the specified IS-IS routing process, set the tag parameter after the ip router isis
command to indicate the process name.
If you run the no ip routing command in global configuration mode, IS-IS will disable IPv4 routing on all interfaces. That
is, the no ip router isis [ tag ] command is automatically executed on all interfaces. Other IS-IS settings remain
unchanged.
By default, CPU protection is enabled on devices. For packets mapped to the destination group addresses
(AllISSystems, AllL1ISSystems, and AllL2ISSystems) in IS-IS, there is a default limit (for example, 400 pps) on the
number of packets sent to the CPU. If a device has many neighbor relationships or sends Hello packets at short
intervals, the IS-IS packets that the device receives may exceed the default limit, causing frequent flapping of neighbor
relationships. To solve the problem, you can use the CPU protection command in global configuration mode to increase
the limit.
Configuration Steps
Mandatory.
Perform this configuration in global configuration mode on each device, unless otherwise specified.
Mandatory.
Perform this configuration in IS-IS routing process configuration mode on each device, unless otherwise specified.
Mandatory.
Perform this configuration in interface configuration mode on each device, unless otherwise specified.
Verification
Related Commands
4-24
Configuration Guide Configuring IS-IS
Configuration Example
4-25
Configuration Guide Configuring IS-IS
Figure 4-9
P2P Link
Topology
B
B(config)# router isis
Verification Enable sending of Hello packets from the interface 192.168.1.1 on Router A to the interface
192.168.1.2 on Router B.
Establish an IS-IS neighbor relationship between Router A and Router B, with the neighbor state being
Up.
Check the LSPs on Router A and Router B. The system IDs 0000.0000.0001 and 0000.0000.0002
should exist.
A
A# show isis neighbors
B
B# show isis neighbors
Scenario Router A, Router B, and Router C are interconnected through the Ethernet.
4-26
Configuration Guide Configuring IS-IS
Figure 4-10
IS-IS
Broadcast
Link
Topology
B
B(config)# router isis
C
C(config)# router isis
Verification Enable sending of Hello packets from the interface 10.1.1.1 on Router A to the interface 10.1.1.2 on Router
B and the interface 10.1.1.3 on Router C.
Establish IS-IS neighbor relationships between Router A and Router B and between Router A and
Router C, with the neighbor state being Up.
Check the LSPs on Router A, Router B, and Router C. The system IDs 0000.0000.0001,
4-27
Configuration Guide Configuring IS-IS
B
B# show isis neighbors
C
C# show isis neighbors
B
B(config)# router isis
Verification Enable sending of Hello packets from the interface 1000 ::1 on Router A to the interface 1000 ::2 on Router
B.
Establish an IS-IS neighbor relationship between Router A and Router B, with the neighbor state being Up.
Check the LSPs on Router A and Router B. The system IDs 0000.0000.0001 and 0000.0000.0002 should
4-28
Configuration Guide Configuring IS-IS
exist.
A
A# show isis neighbors
B
B# show isis neighbors
Common Errors
The IP addresses of the interfaces connected between neighbors are not in the same network segment.
The interface Levels on both sides are different. One side is Level-1, whereas the other side is Level-2.
One side is configured with the P2P mode, whereas the other side is configured with the broadcast mode.
One side is enabled with authentication, whereas the other side is not.
Configure the Hello packet interval on an interface. The value range is 1 to 65,535, in the unit of seconds.
Notes
You can change the Hello packet holdtime by using the isis hello-multiplier command or isis hello-interval command
or both.
By default, CPU protection is enabled on devices. For packets mapped to the destination group addresses
(AllISSystems, AllL1ISSystems, and AllL2ISSystems) in IS-IS, there is a default limit (for example, 400 pps) on the
number of packets sent to the CPU. If a device has many neighbor relationships or sends Hello packets at short interval,
the IS-IS packets that the device receives may exceed the default limit, causing frequent flapping of neighbor
relationships. To solve the problem, you can use the CPU protection command in global mode to increase the limit.
Configuration Steps
Run the isis hello-interval command in interface configuration mode on the desired device, unless otherwise specified.
4-29
Configuration Guide Configuring IS-IS
Run the isis hello-multiplier command in interface configuration mode on the desired device, unless otherwise
specified.
Verification
Enable Router A to send Hello packets to Router B and Router C, and capture packets to check the packet interval.
Make Router B or Router C down. After the holdtime has elapsed, check whether the corresponding neighbor
relationship on Router A is invalid.
Related Commands
Configuration Example
4-30
Configuration Guide Configuring IS-IS
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Configure the Hello packet interval on an IS-IS interface.
Verification Enable Router A to send Hello packets to Router B and Router C, and capture packets to check the packet
interval.
Make Router B or Router C down. After the holdtime has elapsed, check whether the corresponding
neighbor relationship on Router A is invalid.
isis retransmit-interval: After a device at one end of a P2P link sends an LSP packet, if the device receives no
response within a period of time, it determines that the LSP packet is lost or dropped due to an error. The device will
resend the LSP packet.
lsp-refresh-interval: All current LSPs are periodically retransmitted to enable each network node to maintain the latest
LSPs. The retransmission period is called the LSP refresh interval, which aims to update and synchronize LSPs in the
entire area.
max-lsp-lifetime: An LSP contains a field to indicate its lifetime. When a device generates an LSP, the field is set to the
maximum lifetime of the LSP. After the LSP is received by the peer device, its lifetime will decrease with time. The peer
device will replace the old LSP with the newly received one. If the device receives no new LSP until the existing LSP's
lifetime decreases to 0, the existing LSP is still maintained in the LSDB for another 60s. If the device still receives no
new LSP during this period, the existing LSP will be deleted from the LSDB. This mechanism updates and synchronizes
LSPs in the entire area.
ignore-lsp-errors: After receiving an LSP, the local IS-IS neighbor calculates its checksum and compares it with the
checksum contained in the LSP. By default, if the two checksums are inconsistent, the LSP will be discarded. If you run
the ignore-lsp- errors command to configure to ignore checksum errors, the LSP will be processed normally despite
checksum inconsistency.
4-31
Configuration Guide Configuring IS-IS
lsp-fragments-extend: Enables LSP fragment extension, which is used to generate an extended LSP when the 256
fragments of the original LSP are used up.
Notes
The LSP refresh interval must be smaller than the maximum LSP lifetime.
The maximum LSP lifetime must be greater than the LSP refresh interval.
Configuration Steps
Run the lsp-interval command in interface configuration mode on the desired device, unless otherwise specified.
Run the retransmit-interval command in interface configuration mode on the desired device, unless otherwise
specified.
Run the lsp-refresh-interval command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
Run the max-lsp-lifetime command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
Run the ignore-lsp-errors command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
Run the lsp-fragments-extend and virtual-system commands in IS-IS routing process configuration mode on the
desired device, unless otherwise specified.
Verification
4-32
Configuration Guide Configuring IS-IS
Update LSPs continuously and capture LSPs to check the minimum LSP interval.
Disable neighboring routes and capture LSPs to check the LSP retransmission interval.
Send an LSP with an incorrect checksum and check whether the LSP is discarded.
Reduce the lsp-length originate command value, add routing information, and capture LSPs to check whether more
than 256 LSP fragments are generated.
Related Commands
4-33
Configuration Guide Configuring IS-IS
Command ignore-lsp-errors
Parameter N/A
Description
Command IS-IS routing process configuration mode
Mode
Usage Guide After receiving an LSP, the local IS-IS neighbor calculates its checksum and compares it with the checksum
contained in the LSP. By default, if the two checksums are inconsistent, the LSP will be discarded. If you run
the ignore-lsp- errors command to configure to ignore checksum errors, the LSP will be processed
normally despite checksum inconsistency.
Configuration Example
4-34
Configuration Guide Configuring IS-IS
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Configure the minimum LSP interval.
Verification Run the clear isis * command to update LSPs continuously and capture LSPs to check the minimum LSP
interval.
Configuration
Configure IS-IS neighbors in P2P mode. (Omitted)
Steps
Configure the LSP retransmission interval.
Verification Disable neighboring routes and capture LSPs to check the LSP retransmission interval.
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Configure the LSP refresh interval.
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Configure the LSP lifetime.
4-35
Configuration Guide Configuring IS-IS
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Configure to ignore LSP checksum errors.
A(config-router)# ignore-lsp-errors
Verification Send an LSP with an incorrect checksum and check whether the LSP is discarded.
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Configure LSP fragment extension.
A(config-router)# lsp-fragments-extend
Verification Reduce the lsp-length originate command value, add routing information, and capture LSPs to check
whether more than 256 LSP fragments are generated.
CSNPs are periodically broadcast by the DIS in a broadcast network for LSDB synchronization. In a P2P network, a
CSNP is sent only after a neighbor relationship is established. An interface set to mesh-groups can be configured to
periodically send CSNPs.
When you need to set mesh-group on an IS-IS interface, run the isis csnp-interval command to configure the non-0
CSNP interval to ensure complete LSP synchronization between neighbors in the network. After that, CNSPs will be
periodically sent to synchronize LSPs.
Configuration Steps
4-36
Configuration Guide Configuring IS-IS
Run the isis csnp-interval interval [ level-1 | level-2 ] command in interface configuration mode on the desired device,
unless otherwise specified.
Verification
Related Commands
Configuration Example
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Configure the CSNP broadcast interval.
IS-IS supports a two-Level system to realize routing management and extensible route selection in a large network.
Each Level is only concerned about maintaining the topology of the corresponding area.
You can run the is-type command in IS-IS routing process configuration mode to configure an IS-IS Level, or run the
isis circuit-type command in interface configuration mode to configure the IS-IS Level of an interface. The default
4-37
Configuration Guide Configuring IS-IS
Levels specified by the is-type and isis circuit-type commands are Level-1/Level-2. If you run both commands, the
interface only sends the PDUs of the same Level specified by the two commands.
Notes
If Level-1 or Level-2-only is configured using the circuit-type command, IS-IS will only send PDUs of the corresponding
Level.
If an interface is set to external, the interface will work as an external domain interface and IS-IS will not send PDUs of
the corresponding Level.
A device can have only one instance running at Level-2 (including Level-1/Level-2).
Configuration Steps
Run the is-type command in IS-IS routing process configuration mode on the desired device, unless otherwise
specified.
Run the isis circuit-type command in interface configuration mode on the desired device, unless otherwise specified.
Verification
Check whether only the instances of the Level specified by the is-type command are processed, and neighbors of the
corresponding Level are created.
Check whether the interface only sends the PDUs of the same Level specified by the is-type and circuit-type
commands.
Related Commands
4-38
Configuration Guide Configuring IS-IS
Configuration Example
Configuration Router A is connected to Router B and Router C by P2P serial links. Router B and Router C are connected
Requirement by the Ethernet, and Router D and Router E are also connected by the Ethernet. On Router A, configure
s IS-IS area route summarization. Note that area route summarization can be configured only on border
devices.
Figure 4-12
IS-IS Level
Configuration
4-39
Configuration Guide Configuring IS-IS
B Configure IS-IS.
C Configure IS-IS.
4-40
Configuration Guide Configuring IS-IS
D Configure IS-IS.
E Configure IS-IS.
B
B# show isis neighbors
C
C# show isis neighbors
4-41
Configuration Guide Configuring IS-IS
D
D# show isis neighbors
E
E# show isis neighbors
Interface authentication is intended for establishing and maintaining neighbor relationships. A neighbor relationship
cannot be established between two IS-IS devices with different interface authentication passwords. This prevents
unauthorized or unauthenticated IS-IS devices from joining an IS-IS network that requires authentication. Interface
authentication passwords are encapsulated in Hello packets before being sent.
Area authentication and RD authentication in IS-IS are performed to verify LSPs, CSNPs, and PSNPs to prevent
unauthorized or unauthenticated routing information from being injected into the LSDB. Authentication passwords are
encapsulated in LSPs, CSNPs, and PSNPs before being sent.
Notes
An interface authentication password is encapsulated in a Hello packet before being sent by an interface. When an
interface receives a Hello packet, it checks the password in the packet against the existing one.
Area authentication passwords are encapsulated in Level-1 LSPs, CSNPs, and PSNPs. When an interface receives an
LSP, CSNP, or PSNP, it checks the password in the packet against the existing one.
RD authentication passwords are encapsulated in Level-2 LSPs, CSNPs, and PSNPs. When an interface receives an
LSP, CSNP, or PSNP, it checks the password in the packet against the existing one.
Configuration Steps
Configure isis password in interface configuration mode on the desired device, unless otherwise specified.
Run the area-password command in IS-IS routing process configuration mode on the desired device, unless otherwise
specified.
Configuring RD Authentication
4-42
Configuration Guide Configuring IS-IS
Run the domain-password command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
Verification
IS-IS plaintext authentication provides only limited security because the password transferred through a packet is
visible.
IS-IS MD5 authentication provides higher security because the password transferred through a packet is encrypted
using the MD5 algorithm.
Related Commands
4-43
Configuration Guide Configuring IS-IS
If no Level is specified, the authentication mode will take effect for Level-1 and Level-2 circuit types.
If you use the isis authentication mode command after the isis password command is executed to
configure plaintext authentication, the previous command configuration will be overwritten.
The isis password command does not take effect if the isis authentication mode command is executed.
To run the isis password command, delete the isis authentication mode command configuration first.
(Optional) Applying Interface Authentication Only to Sent Packets (Received Packets Are Not Authenticated)
4-44
Configuration Guide Configuring IS-IS
send-only command, the devices will not authenticate received Hello packets to avoid network flapping
when IS-IS interface authentication is deployed. After authentication is deployed in the entire network, run
the no isis authentication send-only command to cancel the send-only setting.
The isis authentication send-only command is applicable to plaintext authentication and MD5
authentication. You can run the isis authentication mode command to specify the authentication mode for
an IS-IS interface.
If no Level is specified, the authentication mode will take effect for Level-1 and Level-2 on the interface.
4-45
Configuration Guide Configuring IS-IS
4-46
Configuration Guide Configuring IS-IS
Configuration Example
Configuration Router A, Router B, and Router C are connected through the Ethernet and run IS-IS. Router A is a Level-1
Requirements device, Route B is a Level-1/Level-2 device, and Router C is a Level-2 device. The following configuration
requirements exist: Apply plaintext authentication to the Hello packets between Router A and Router B, as
well as Level-1 LSPs and SNPs. Apply MD5 authentication to the Hello packets between Router B and
Router C, as well as Level-2 LSPs and SNPs.
Figure 4-13
IS-IS
Authentication
Topology
4-47
Configuration Guide Configuring IS-IS
A(config-router)# area-password aa
B(config-keychain)# key 1
B(config-keychain-key)# key-string aa
B(config-keychain)# key 1
B(config-keychain-key)# key-string bb
B(config-keychain)# key 1
B(config-keychain-key)# key-string cc
Configure IS-IS.
4-48
Configuration Guide Configuring IS-IS
C(config-keychain)# key 1
C(config-keychain-key)# key-string bb
C(config-keychain)# key 1
C(config-keychain-key)# key-string cc
Configure IS-IS.
B
B# show isis neighbors
4-49
Configuration Guide Configuring IS-IS
C
C# show isis neighbors
Common Errors
IS-IS GR helps improve system reliability. On devices that separate the control plane from the forwarding plane, GR
ensures that data forwarding is not interrupted during routing protocol restart.
For GR to be successful, the following two conditions must be met: (1) The network topology is stable; (2) The device can
ensure uninterrupted forwarding when it restarts IS-IS.
Two roles exist during the GR process: Restarter and Helper. Accordingly, IS-IS GR is divided into the IS-IS GR Restart
capability and IS-IS GR Help capability. A device with the GR Restart capability can send a GR request and execute GR. A
device with the GR Help capability can receive a GR request and help its neighbor with GR implementation. The GR process
starts when the Restarter sends a GR request. After receiving the GR request, the neighboring device enters Help mode to
help the Restarter reestablish its LSDB while maintaining the neighbor relationship with the Restarter. The main GR working
mechanism is as follows:
When an IS-IS device needs to perform GR, it instructs its neighbor to maintain their neighbor relationship so that other
devices in the network cannot sense the change in the topological relationship and the neighbor will not recalculate the route
and update its forwarding table. The IS-IS device synchronizes and restores the LSDB to its pre-GR state with the help of the
neighbor to ensure that the route and forwarding table remain unchanged before and after GR implementation and data
forwarding is not interrupted.
4-50
Configuration Guide Configuring IS-IS
Switch A is a GR Restarter, and Switch B and Switch C are the GR Helpers for Switch A. Switch A sends a GR request
instructing all its neighbors not to delete the neighbor relationships with Switch A when it is restarted. After receiving the GR
request, the neighbors send GR responses to the GR Restarter, and will maintain their neighbor relationships with the GR
Restarter during the GR time (specified by GR grace-period) notified by the GR Restarter.
When the GR Restarter is restarted, its IS-IS interface goes from Down to Up. Because the GR Helpers know that the GR
Restarter is in IS-IS restart state, they maintain their neighbor relationships with the GR Restarter during the GR time and
retain the routes from the GR Restarter.
3. The GR Restarter synchronizes topology and routing information from the GR Helpers.
4-51
Configuration Guide Configuring IS-IS
After IS-IS restart, the GR Restarter synchronizes topology or routing information from the GR Helpers and recalculates its
routing table. During this process, any change in the routing table is not updated to the forwarding table.
4. GR is completed when the GR Restarter finishes LSDB synchronization. Then all devices enter IS-IS interaction state.
After the GR Restarter synchronizes all required data, all devices enter IS-IS interaction state. The GR Restarter's routing
table is updated to the forwarding table and invalid entries are cleared. Because the GR Restarter is completely restored to
the pre-restart state under stable network conditions, its routing table and forwarding table remain unchanged before and
after GR.
Notes
Configuration Steps
4-52
Configuration Guide Configuring IS-IS
Run the graceful-restart command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
Run the graceful-restart grace-period command in IS-IS routing process configuration mode on the desired device,
unless otherwise specified.
Run the graceful-restart helper command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
Verification
Check whether the routing table and forwarding table remain unchanged before and after GR.
Related Commands
Command graceful-restart
Parameter N/A
Description
Command IS-IS routing process configuration mode
Mode
Usage Guide Use this command to enable the IS-IS GR Restart capability. As long as the network conditions remain
unchanged, IS-IS can be restarted and restored to the pre-restart state without impact on data forwarding.
4-53
Configuration Guide Configuring IS-IS
Parameter N/A
Description
Command IS-IS routing process configuration mode
Mode
Usage Guide Use the graceful-restart helper disable command to disable the IS-IS GR Help capability. The command
enables IS-IS to ignore the GR request sent by the device to be restarted.
Configuration Example
Configuring IS-IS GR
Configuration Two S8600 series high-end devices have the IS-IS GR Restart capability and are equipped with
Requirements master/slave management boards for redundant backup at the control plane. IS-IS neighbor relationships
are established between S86-1 and S3750/S3760 and between S86-2 and S3750/S3760. The system
software of all devices supports the IS-IS GR Help capability.
The following configuration requirements exist: Enable the IS-IS GR Restart capability with proper GR Time
setting on S86-1 and S86-2 to realize uninterrupted forwarding and improve core device reliability.
Disable the IS-IS GR Help capability on S3750 to exclude it from the Help process. By default, other device
supports the IS-IS GR Help capability and require no additional configuration.
Figure 4-18
IS-IS GR
Topology
CS86-1(config-router)# graceful-restart
CS86-2(config-router)# graceful-restart
4-54
Configuration Guide Configuring IS-IS
Verification Check whether the routing table and forwarding table remain unchanged before and after GR.
Check whether S86-1 and S86-2 synchronize topology and routing information from S3760.
S86-1
S86-1# show isis neighbors
S86-2
S86-2# show isis neighbors
S3760
S3760# show isis neighbors
IS-IS dynamically discovers neighbors through Hello packets. After IS-IS enables the BFD function, a BFD session will
be set up with the neighbor in Up state. The BFD mechanism is used to detect the neighbor state. Once a neighbor
failure is detected through BFD, IS-IS performs network convergence immediately. The convergence time can be
reduced from 30s to less than 1s. By default, IS-IS Hello packets are sent at an interval of 10s in a P2P network, and
the time required to detect a neighbor failure is three times the packet interval, that is 30s.
Notes
You must set BFD session parameters before you enable BFD support for IS-IS.
When you run the bfd up-dampening command on an interface with BFD support for IS-IS, you need to run the bfd
all-interfaces command with the [anti-congestion] option selected.
When you run the bfd all-interfaces command with the [anti-congestion] option selected, run the bfd up-dampening
command on the interface.
IP routing may cause a neighbor's interface for BFD session setup to be inconsistent with the interface for outgoing
BFD packets. If this happens, the BFD session cannot be set up.
If a neighbor's interface for BFD session setup is inconsistent with the interface for outgoing BFD packets, the BFD
session cannot be set up.
Configuration Steps
Run the bfd ll-interfaces command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
4-55
Configuration Guide Configuring IS-IS
Run the isis bfd command in interface configuration mode on the desired device, unless otherwise specified.
Verification
Build a topology with two parallel lines. Typically, IS-IS selects one line as the master line and the other as the backup
line. Enable BFD on the master line.
Make the master line fail. Check whether IS-IS performs route convergence based on the BFD monitoring state and
starts the backup line.
Related Commands
4-56
Configuration Guide Configuring IS-IS
new techniques such as the Multi-Service Transport Platform (MSTP), link congestion tends to occur during
peak hours of data communication. BFD quickly detects the link exception and instructs IS-IS to delete the
neighbor relationship and the neighbor reachability information in LSPs. Link switch is performed to bypass
the congested link. A Hello packet for IS-IS neighbor detection is sent every 10s and its expiration time is
30s. The Hello packet can still be received normally when BFD detects an exception, and therefore an IS-IS
neighbor relationship is reestablished quickly, causing the route to be restored to the congested link. Then
BFD detects the abnormal link and link switch is performed again. This process is repeated, which makes
the route be switched between the congested link and other links, causing repetitive flapping.
The anti-congestion option is used to avoid routing flapping in case of link congestion. After the option is
configured, the IS-IS neighbor state is still kept alive when link congestion occurs, but the neighbor
reachability information in LSPs is deleted. The route is switched to a normal link. When the congested link
is restored, the neighbor reachability information in LSPs is recovered and the route is switched back, which
avoids route flapping.
When you run the bfd all-interfaces [anti-congestion] command, run the bfd up-dampening command on
the interface. The two commands must be used together. If you run only one command, the route flap
dampening feature may not take effect or other network exceptions may occur.
Configuration Example
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Set BFD session parameters. (Omitted)
Verification Enable S1 (192.168.1.10) and S2 (192.168.2.10) to send packets to G1 (229.1.1.1) and G2 (229.1.2.1). Add
User to the G1 and G2 groups.
Check the multicast packet that User receives. User should only receive the (S1, G1) packet.
Check that the PIM-SM routing table does not have the (S1, G2), (S2, G1), and (S2, G2) entries.
Common Errors
4-57
Configuration Guide Configuring IS-IS
Device overload
The local IS-IS node has overload issues, such as insufficient memory or full CPU load; as a result, its routing table has
incomplete routes or does not have resource forwarding data. You can set the overload bit in an LSP to instruct the neighbor
not to use the local node as a forwarding device.
To set the overload bit, run the set-overload-bit command without the on-startup keyword. The overload bit can be
configured or canceled manually. When the local IS-IS node is restored, manually cancel the command configuration;
otherwise, the node is always in overload state.
In the scenario described by RFC3277, the IS-IS convergence speed is faster than the BGP speed; as a result, after an IS-IS
node is restarted, a route may be instantaneously unreachable, which is called an instantaneous black hole. You can set the
overload bit in an LSP to instruct the neighbor not to use the local node as a forwarding device until the specified time has
elapsed.
To set the overload bit, run the set-overload-bit command with the on-startup keyword. The overload bit can be configured
or canceled automatically by the IS-IS node based on the configuration. If the on-startup keyword is selected, the IS-IS node
automatically enters instantaneous black hole state after restart. When a neighbor relationship is established, the IS-IS node
sends an LSP with the overload bit to notify the neighbor that the local node enters instantaneous black hole (or overload)
state and instruct the neighbor not to use the local node as a forwarding device. After the specified time has elapsed, the
IS-IS node immediately sends an LSP with the overload bit canceled to notify the neighbor that the local node has exited
instantaneous black hole (or overload) state and can work as a forwarding device.
If you only need to connect the local IS-IS node to a production network for testing or to meet other functional requirements,
but does not require the node to forward real data in the network, you can set the overload bit in an LSP to instruct the
neighbor not to use the local node as a forwarding device.
To set the overload bit, run the set-overload-bit command without the on-startup keyword. The overload bit can be
configured or canceled manually. You can set the suppress keyword based on requirements to limit the routing information
carried in an LSP in case of overload. For example, internal and external routes can be suppressed, and only the local direct
route is advertised.
Notes
At the same Level, the configuration with the on-startup keyword is mutually exclusive with the configuration without
the on-startup keyword.
Configuration Steps
Run the set-overload-bit command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
4-58
Configuration Guide Configuring IS-IS
Verification
Capture packets and check that the neighbor does not forward LSPs from the local node.
Related Commands
Configuration Example
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Verify that the IS-IS node enters instantaneous black hole state immediately after restart and remains
in this state until the specified time (300s) has elapsed, and the IS-IS node only advertises local direct
links to its neighbors during the specified time.
Verify that the IS-IS node automatically enters instantaneous black hole state after restart. Once a
neighbor relationship is established, the IS-IS node sends an LSP with the overload bit.
After the specified time has elapsed, the IS-IS node immediately sends an LSP with the overload bit
canceled to notify its neighbors that the local node has exited instantaneous black hole (or overload)
state.
4-59
Configuration Guide Configuring IS-IS
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Verify that the IS-IS node enters instantaneous black hole state immediately after restart and remains
in this state until the specified time (300s) has elapsed, and the IS-IS node only advertises local direct
links to its neighbors during the specified time.
Verify that the IS-IS node automatically enters instantaneous black hole state after restart. Once a
neighbor relationship is established, the IS-IS node sends an LSP with the overload bit.
After the specified time has elapsed, the IS-IS node immediately sends an LSP with the overload bit
canceled to notify its neighbors that the local node has exited instantaneous black hole (or overload)
state.
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Connect the local IS-IS node as a test device to a production network. The node is not required to
forward real data in the network to avoid impact on production.
Verification Capture packets to check LSPs. Verify that the LSPs carry the overload bit and only advertise local direct
routes.
The virtual device contains the following elements: an independent routing table, as well as an independent address
space; a set of interfaces that belong to the VRF table; a set of routing protocols applicable only to the VRF table.
Each device can maintain one or more VRF tables and a public-network routing table (also called a global routing table).
Multiple VRF instances are separated from each other.
4-60
Configuration Guide Configuring IS-IS
Notes
Note the following constraints or conventions when you bind IS-IS instances and VRF tables:
The IS-IS instances bound with the same VRF table must be configured with different system IDs. The IS-IS instances
bound with different VRF tables can be configured with the same system ID.
One IS-IS instance can be bound with only one VRF table, but one VRF table can be bound to multiple IS-IS instances.
When the VRF table bound to an IS-IS instance is changed, all IS-IS interfaces associated with the instance will be
deleted. That is, the ip router isis [tag] interface configuration and the redistribution configuration in routing process
configuration mode will be deleted.
Configuration Steps
Run the vrf command in IS-IS routing process configuration mode on the desired device, unless otherwise specified.
Verification
Check whether the local device establishes neighbor relationships with other devices specified in the VRF table.
Related Commands
The IS-IS instances bound with the same non-default VRF table must be configured with different
system IDs. The IS-IS instances bound with different VRF tables can be configured with the same
system ID.
One IS-IS instance can be bound with only one VRF table, but one VRF table can be bound to multiple
IS-IS instances.
When the VRF table bound to an IS-IS instance is changed, all IS-IS interfaces associated with the
instance will be deleted. That is, the ip (or ipv6) router isis [ tag ] interface configuration and the
redistribution configuration in routing process configuration mode will be deleted.
Configuration Example
4-61
Configuration Guide Configuring IS-IS
Configuration
Bind an IS-IS instance to a VRF table.
Steps
Add interfaces to the VRF table and IS-IS instance. (Omitted)
A(config-vrf)#address-family ipv4
A(config-vrf-af)#exit-address-family
Verification Check whether the local device establishes neighbor relationships with other devices specified in the VRF
table.
Common Errors
The IP addresses of the interfaces connected between neighbors are not in the same network segment.
The interface Levels on both sides are different. One side is Level-1, whereas the other side is Level-2.
One side is configured with the P2P mode, whereas the other side is configured with the broadcast mode.
One side is enabled with authentication, whereas the other side is not.
If the multi-topology command is not executed, IPv4 and IPv6 share one IS-IS physical topology, also called the
default topology. If the multi-topology command is executed without the transition parameter, routing devices run in
MT mode. IS-ISv4 runs in the default topology, and IS-ISv6 runs in the IPv6 unicast topology. If the multi-topology
command is executed with the transition parameter, routing devices run in MTT mode. IS-ISv6 runs in the default
topology and IPv6 unicast topology. The three configurations are mutually exclusive. The routing devices in MTT mode
can transfer the MT TLV or the default topology TLV. The MTT mode is applicable to incremental deployment to ensure
4-62
Configuration Guide Configuring IS-IS
smooth network migration. The MTT mode can cause route leaking between the default topology and IPv6 unicast
topology. If the MTT mode is configured improperly, network failures such as routing black holes and loops may occur.
Notes
Note the following constraints or conventions when you configure the IS-IS MTR feature:
Set metric-style to Wide or Transition before you run the multi-topology command.
The MTR feature will be disabled if metric-style is set to Narrow or only one Level is configured to support the Wide or
Transition mode.
Configuration Steps
Configure the MTR feature in IS-IS address-family ipv6 configuration mode on the desired device, unless otherwise
specified.
Verification
Check whether the local device establishes neighbor relationships with other devices.
Related Commands
Configuration Example
4-63
Configuration Guide Configuring IS-IS
Configuration
The typical application scenario of MTR is to retain devices that only support IPv4 services in a network
Requirements
where IPv6 service extension will be performed.
In Figure 1-20, Router 2 only supports the IPv4 protocol stack but does not support the MTR feature;
therefore, it can only run IPv4 services. The network capacity needs to be scaled to support IPv6 services
in order to meet service extension requirements. (Router 1, Router 3, and Router 4 that support the MTR
feature will be added.) The device (Router 2) that supports only one protocol stack must be replaced to
maintain the stability of the network running IPv4 and IPv6 dual protocol stacks; otherwise, IPv6 routing
black holes may occur.
If you need to retain Router 2, you can configure the MTR feature on Router 1, Router 3, and Router 4. The
MTR feature enables Router 2 to continue to run IPv4 services without interference on the IPv4 and IPv6
services on Router 1, Router 3, and Router 4. The MTR feature improves networking flexibility, indirectly
prolongs the service life of old devices, and meets service extension requirements while maximizing the
values of old devices.
Configure IS-IS:
4-64
Configuration Guide Configuring IS-IS
Ruijie(config-router-af)# multi-topology
Configure IS-IS:
Ruijie(config-router)#address-family ipv6
Ruijie(config-router-af)#no adjacency-check
4-65
Configuration Guide Configuring IS-IS
Configure IS-IS:
Ruijie(config-router-af)# multi-topology
Configure IS-IS:
Ruijie(config-router-af)# multi-topology
4-66
Configuration Guide Configuring IS-IS
Verification Run the show command on Router 1 to check whether the next hop of the IPv4 route destined for
Router 4 is Router 2.
Run the show command on Router 1 to check whether the next hop of the IPv6 route destined for
Router 4 is Router 3.
Checking the
Ruijie#show ip route
IPv4 route
Codes: C - connected, S - static, R - RIP, B - BGP
Checking the
Ruijie#show ipv6 route
IPv6 route
4-67
Configuration Guide Configuring IS-IS
O - OSPF intra area, OI - OSPF inter area, OE1 - OSPF external type 1, OE2 - OSPF external type
2
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
Common Errors
The protocol types used by two neighbors do not match; therefore, a neighbor relationship cannot be established.
The IP addresses of the interfaces connected between neighbors are not in the same network segment.
The interface Levels on both sides are different. One side is Level-1, whereas the other side is Level-2.
4-68
Configuration Guide Configuring IS-IS
One side is configured with the P2P mode, whereas the other side is configured with the broadcast mode.
One side is enabled with authentication, whereas the other side is not.
By default, the SNMP software can perform the MIB operation on the first IS-IS instance. To perform the MIB operation
on other instances, you need to manually specify these instances.
Notes
By default, the SNMP software can perform the MIB operation on the first displayed IS-IS instance.
Configuration Steps
Binding the Instances on Which the IS-IS MIB Operation Will Be Performed
Run the enable mib-binding command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
Run the snmp-server enable traps isis command in global configuration mode on the desired device, unless
otherwise specified.
Run the snmp-server host command in global configuration mode on the desired device, unless otherwise specified.
Allowing the Sending of all IS-IS Trap Messages to the SNMP Host
Run the enable traps all command in IS-IS routing process configuration mode on the desired device, unless otherwise
specified.
Verification
Related Commands
Binding the Instances on Which the IS-IS MIB Operation Will Be Performed
4-69
Configuration Guide Configuring IS-IS
Parameter N/A
Description
Command IS-IS routing process configuration mode
Mode
Usage Guide The latest standards stipulate that the MIB operation can be performed on a single instance. By default, the
MIB operation is performed on the first displayed IS-IS instance. Because multiple IS-IS instances can be
configured, the administrator can use this command to specify the instances on which the MIB operation will
be performed.
Command
snmp-server enable traps [ isis ]
Command snmp-server host { host-addr | ipv6 ipv6-addr } [ vrf vrfname ] [ traps ] [ version { 1 | 2c | 3 { auth | noauth
| priv } ] community-string [ udp-port port-num ] [ notification-type ]
Parameter
host-addr: Indicates the address of the SNMP host.
Description
ipv6-addr: Indicates the IPv6 address of the SNMP host.
vrfname: Indicates the name of a VRF table.
version: Indicates the SNMP version, which can be set to V1, V2C, or V3
auth | noauth | priv: Indicates the security level of V3 users.
community-string: Indicates the community string or user name (V3 version).
port-num: Indicates the port number of the SNMP host.
notification-type: Indicates the type of trap messages that are actively sent, for example, snmp.
Command Global configuration mode
Mode
Usage Guide This command is used with the snmp-server enable traps command to actively send trap messages to a
Network Management System (NMS). You can configure different SNMP hosts to receive trap messages. A
host supports different trap types, ports, and VRF tables. For the same host (with the same port
configuration and VRF configuration), the last configuration is combined with the previous configurations.
That is, to send different trap messages to the same host, configure a type of trap messages each time.
These configurations are finally combined.
4-70
Configuration Guide Configuring IS-IS
Configuration Example
Configuration
Bind the instances on which the IS-IS MIB operation will be performed.
Steps
Complete trap message-related settings.
A# configure terminal
A(config)#router isis
Verification
Run the MIB tool to read and write IS-IS settings.
A# show running-config
Notes
Configuration Steps
4-71
Configuration Guide Configuring IS-IS
Verification
Run the show isis neighbor command to display the protocol status.
Related Commands
Parameter all: Indicates that packets are allowed to be sent to all sub VLANs.
Description
vid: Specifies the sub VLAN ID. The value ranges from 1 to 4094.
Usage Guide In normal cases, a super VLAN contains multiple sub VLANs. Multicast packets of a super VLAN are also
sent to its sub VLANs. In this case, when ISIS multicast packets are sent over a super VLAN containing
multiple sub VLANs, the ISIS multicast packets are replicated multiple times, and the device processing
capability is insufficient. As a result, a large number of packets are discarded, causing the neighbor down
error. In most scenarios, the ISIS function does not need to be enabled on a super VLAN. Therefore, the
ISIS function is disabled by default. However, in some scenarios, the ISIS function must be run on the super
VLAN, but packets only need to be sent to one sub VLAN. In this case, run this command to specify a
particular sub VLAN. You must be cautious in configuring packet transmission to all sub VLANs, as the large
number of sub VLANs may cause a device processing bottleneck, which will lead to the neighbor down
error.
Configuration Example
Scenario
4-72
Configuration Guide Configuring IS-IS
A A# configure terminal
B B# configure terminal
maximum-paths: Configures the maximum number of IS-IS equal-cost paths to be installed to a routing table.
lsp-length receive: Configures the maximum length allowed for received LSPs.
lsp-length originate: Configures the maximum length allowed for sent LSPs.
passive-interface: Prevents passive interfaces from receiving and sending IS-IS packets. That is, IS-IS neighbor
relationships will not be established on passive interfaces. The IP addresses of passive interfaces are flooded through
other interfaces.
isis metric: Stores the metric, which is used in SPF calculation, in the IP reachability information TLV. The greater the
metric, the greater the routing consumption of the interface and the longer the path obtained by SPF calculation.
isis priority: In a broadcast network, IS-IS needs to elect a DIS among all devices. The DIS will generate a
pseudonode and related LSPs. The device with the highest priority is elected as the DIS. You can configure different
priorities for different Levels.
default-information originate: Generates a Level-2 default route, which will be advertised through LSPs.
summary-address and summary-prefix: Creates a summary route to represent a group of routes in a routing table. A
summary route can include multiple routes of the specified Level. The interface metric of the summary route follows the
smallest interface metric among all routes.
log-adjacency-changes: Enables neighbor relationship event output to log IS-IS neighbor relationship changes.
redistribute: Redistributes other routes to IS-IS; redistributes Level-1 routes to Level-2; redistributes Level-2 routes to
Level-1.
Configuration Steps
4-73
Configuration Guide Configuring IS-IS
Run the maximum-paths command in IS-IS routing process configuration mode or IS-IS address-family ipv6
configuration mode on the desired device, unless otherwise specified.
Run the lsp-length receive command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
Run the lsp-length originate command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
Run the passive-interface command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
Run the isis metric command in interface configuration mode on the desired device, unless otherwise specified.
Run the isis priority command in interface configuration mode on the desired device, unless otherwise specified.
Run the default-information originate command in IS-IS routing process configuration mode or IS-IS address-family
ipv6 configuration mode on the desired device, unless otherwise specified.
Run the summary-address and summary-prefix commands in IS-IS routing process configuration mode or IS-IS
address-family ipv6 configuration mode on the desired device, unless otherwise specified.
4-74
Configuration Guide Configuring IS-IS
Run the log-adjacency-changes command in IS-IS routing process configuration mode on the desired device, unless
otherwise specified.
Run the redistribute command in IS-IS routing process configuration mode on the desired device, unless otherwise
specified.
Verification
maximum-paths: Check whether the maximum number of equal-cost paths displayed by routing entries is the same as
the configuration.
passive-interface: Capture packets to check whether the interface receives and sends IS-IS packets.
isis priority: Check whether the device with the changed priority setting is elected as the DIS.
summary-address and summary-prefix: Capture packets to check whether the summary route instead of detailed
routes is advertised through LSPs.
log-adjacency-changes: Change the neighbor state and verify that the change is recorded when debugging is
disabled.
Related Commands
4-75
Configuration Guide Configuring IS-IS
Parameter size: Indicates the maximum length allowed for received LSPs. According to RFC, the value range is 1,492
Description to 16,000, in the unit of bytes.
Command IS-IS routing process configuration mode
Mode
Usage Guide Use this command to control the maximum length allowed for LSPs received by the local device.
Intermediate nodes with sufficient memory are required to receive LSPs whose maximum length is equal to
the interface MTU in order to avoid a route convergence failure. From this perspective, the command is
meaningless. The maximum length allowed for received LSPs cannot be smaller than that allowed for sent
LSPs; otherwise, the former will be automatically adjusted to be equal to the latter.
4-76
Configuration Guide Configuring IS-IS
metric, the greater the routing consumption of the interface and the longer the path obtained by SPF
calculation.
The metric belongs to the narrow type and is valid only when metric-style is set to Narrow.
4-77
Configuration Guide Configuring IS-IS
Command log-adjacency-changes
Parameter N/A
Description
Command IS-IS routing process configuration mode
Mode
Usage Guide You can also use the debug command to record IS neighbor state changes, but the command consumes
many system resources.
4-78
Configuration Guide Configuring IS-IS
If match external is not followed by the number 1 or 2, OSPF routes specified by external 1 and external 2
will be redistributed. If match nssa-external is not followed by the number 1 or 2, OSPF routes specified by
nssa-external 1 and nssa-external 2 will be redistributed.
metric metric-value: Indicates the metric of redistributed routes. The value range is 0 to 4,261,412,864. The
metric of external routes is used when the metric option is not specified.
metric-type { internal | external }: Indicates the metric type of redistributed routes. internal: Indicates that
the metric belongs to the internal type. external: Indicates that the metric belongs to the external type. If
metric-type is not specified, the metric belongs to the internal type.
route-map map-tag: Indicates the route map used for external route redistribution. It is used to filter
redistributed routes or configure the attributes of redistributed routes. The value of map-tag cannot exceed
32 characters. By default, route-map is not configured.
level-1 | level-1-2 | level-2: Indicates the Level of redistributed routes received by IS-IS. If no Level is
specified, routes are redistributed to Level-2. level-1: Redistributes routes to Leve-1. level-1-2:
Redistributes routes to Level-1 and Level-2. level-2: Redistributes routes to Leve-2.
Command IS-IS routing process configuration mode and IS-IS address-family ipv6 configuration mode
Mode
Usage Guide The no redistritbue { bgp | ospf processs-id | rip | connected | static } command is used to cancel the
redistribution of routes mapped to the specified protocol. If no redistribute is followed by other parameters,
the command will restore the default parameter settings, rather than cancel route redistribution. For
example, no redistribute bgp cancels BGP route redistribution, whereas no redistribute bgp route-map
aa cancels the route map named aa used for BGP route redistribution.
When external routes are redistributed in IPv4 mode, the routing information is stored in LSPs' IP External
Reachability Information TLV.
When external routes are redistributed in IPv6 mode, the routing information is stored in LSPs' IPv6
Reachable TLV.
In the old versions of some vendors, if metric-type is set to external, the metric of redistributed routes is
added by 64 during route calculation and used to determine routing. This practice does not comply with the
related protocol. In the actual application, external routes may be preferred over internal routes. If this
happens during interworking with old versions of some vendors, you can modify the related setting (such as
metric or metric-type) of each device to ensure that internal routes are preferred over external routes.
Redistributing the Level-1 Reachable Routing Information of the Specified IS-IS Instance to Level-2 of the
Current Instance
Command redistribute isis [ tag ] level-1 into level-2 [ route-map route-map-name | distribute-list
access-list-name ]
Parameter tag: Indicates the name of the IS-IS instance whose routing information will be redistributed.
Description route-map route-map-name: Indicates the route map used for rout redistribution. It is used to filter
redistributed routes or configure the attributes of redistributed routes. The value of route-map-name cannot
exceed 32 characters. By default, route-map is not configured.
distribute-list access-list-name: Filters redistributed routes by using distribute-list. access-list-name
indicates the associated prefix list, which can be a standard prefix list, an extended prefix list, or a name
4-79
Configuration Guide Configuring IS-IS
prefix list. It is in the format of {<1-99> | <100-199> | <1300-1999> | <2000-2699> | acl-name }. When the
IS-IS address-family ipv6 configuration mode is applied, only the name prefix list can be used, in the format
of acl-name.
Command IS-IS routing process configuration mode and IS-IS address-family ipv6 configuration mode
Mode
Usage Guide You can use the route-map or distribute-list parameter to filter the specified instance's Level-1 routes to be
redistributed. Only the routes that meet specific criteria can be redistributed to Level-2 of the current
instance. The route-map and distribute-list parameters cannot be used at the same time.
The no redistritbue isis [tag] level-2 into level-1 command is used to cancel the redistribution of the
specified instance's routes. If no redistribute is followed by other parameters, the command will restore the
default parameter settings, rather than cancel route redistribution.
For example, no redistritbue isis tag1 level-1 into level-2 cancels the redistribution of the routes of the
IS-IS instance name tag1. no redistritbue isis tag1 level-1 into level-2 route-map aa cancels the use of
the route map named aa to filter redistributed routes.
Redistributing the Level-2 Reachable Routing Information of the Specified IS-IS Instance to Level-1 of the
Current Instance
Command redistribute isis [ tag ] level-2 into level-1 [ route-map route-map-name | distribute-list access-list-name
|( prefix ip-address net-mask | ipv6-prefix ipv6-address/length) ]
Parameter tag: Indicates the name of the IS-IS instance whose routing information will be redistributed.
Description route-map route-map-name: Indicates the route map used for route redistribution. It is used to filter
redistributed routes or configure the attributes of redistributed routes. The value of route-map-name cannot
exceed 32 characters. By default, route-map is not configured.
Distribute-list access-list-name: Filters redistributed routes by using distribute-list. access-list-name
indicates the associated prefix list, which can be a standard prefix list, an extended prefix list, or a name
prefix list. It is in the format of {<1-99> | <100-199> | <1300-1999> | <2000-2699> | acl-name }.
When the IS-IS address-family ipv6 configuration mode is applied, only the name prefix list can be used, in
the format of acl-name.
prefix ip-address net-mask: Determines the routes to be redistributed by address and prefix length.
ipv6-prefix ipv6-address/length: Determines the IPv6 routes to be redistributed by address and prefix
length.
Command IS-IS routing process configuration mode and IS-IS address-family ipv6 configuration mode
Mode
Usage Guide You can use the route-map, distribute-list, or prefix parameter to filter the specified instance's Level-2
routes to be redistributed. Only the routes that meet specific criteria can be redistributed to Level-1 of the
current instance.
The no redistritbue isis [ tag ] level-2 into level-1 command is used to cancel the redistribution of the
specified instance's routes. If no redistribute is followed by other parameters, the command will restore the
default parameter settings, rather than cancel route redistribution.
For example:
no redistritbue isis tag1 level-2 into level-1 cancels the redistribution of the routes of the IS-IS instance
4-80
Configuration Guide Configuring IS-IS
name tag1. no redistritbue isis tag1 level-2 into level-1 route-map aa cancels the use of the route map
named aa to filter redistributed routes.
Configuration Example
A(config-router)# maximum-paths 5
Verification Check whether the maximum number of equal-cost paths displayed by routing entries is the same as
the configuration.
Configuration
Configure IS-IS neighbors. (Omitted)
Verification
Capture packets to check the length of received LSPs.
Configurations
Configure IS-IS neighbors. (Omitted)
A# configure terminal
Verification
Capture packets to check the length of sent LSPs.
4-81
Configuration Guide Configuring IS-IS
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Configure a passive interface.
A# configure terminal
Verification
Capture packets to check whether the interface receives and sends IS-IS packets.
A(config-if)#isis metric 1
Verification
Check the database details of IS-IS.
Verification
Check whether the device with the changed priority setting is elected as the DIS.
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Generate a default route.
4-82
Configuration Guide Configuring IS-IS
Verification
Capture packets to check whether the sent LSP contains a default route.
Configuration Router A and Router B are connected through the Ethernet and run IS-IS. Configure Router A to advertise
Requirements only the 172.16.0.0/22 route instead of the 172.16.1.0/24 and 172.16.2.0/24 routes.
Figure 4-19
IS-IS Route
Summary
Topology
B Configure IS-IS.
4-83
Configuration Guide Configuring IS-IS
Verification Run the show ip route command on Router B to check whether only one summary route exists.
B
B(config)# show ip route
Router A and Router B are connected through the Ethernet and run IS-ISv6. Configure Router A to advertise
only the 2000::/96 route instead of the 2000::1111:0/112 and 2000::2222::0/112 routes.
Figure 4-20
IS-ISv6 Route
Summary
Topology
A (config-router-af)# exit-address-family
4-84
Configuration Guide Configuring IS-IS
B Configure IS-IS.
Verification Run the show ipv6 route command on Router B to check whether only one summary route exists.
B
B(config)# show ipv6 route
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Enable neighbor relationship event output.
A(config-router)# log-adjacency-changes
Verification
Change the neighbor state and verify that the change is recorded when debugging is disabled.
4-85
Configuration Guide Configuring IS-IS
Configuration
Configure IS-IS neighbors. (Omitted)
Steps
Configure OSPF routes. (Omitted)
Verification
Check whether routing entries with redistributed routes exist.
4.5 Monitoring
Clearing
Running the clear commands may lose vital information and thus interrupt services.
Description Command
Clears all IS-IS neighbor relationship clear clns neighbors
tables.
Clears all IS-IS data structures. clear isis *
Clears all IS-IS counters. clear isis [ tag ] counter
Displaying
Description Command
Displays all IS neighbors and show clns [ tag ] is-neighbors [ interface-type interface-number ] [ detail ]
inter-device neighbor relationships.
Displays all IS neighbors and show clns [ tag ] neighbors [ interface-type interface-number ] [ detail ]
provides device information and
information about the neighbor
relationship with ESs.
Displays all IS-IS counters. show isis [ tag ] counter
Displays the LSDB information. show isis [ tag ] database [ FLAGS ] [ LEVEL ] [ LSPID ]
Displays the state information related show isis [ tag ] graceful-restart
to IS-IS GR.
Displays the relationship between the show isis [ tag ] hostname
device name and system ID.
Displays the details of an IS-IS show isis [ tag ] interface [ interface-type interface-number ] [ counter ]
interface.
4-86
Configuration Guide Configuring IS-IS
Debugging
System resources are occupied when debugging information is output. Therefore, disable debugging immediately after
use.
Description Command
Enables IS-IS debugging. debug isis { all | auth | events | gr | ifsm | lsp | mtr | nfsm | nsm | pdu | spf | warn }
4-87
Configuration Guide Configuring BGP
5 Configuring BGP
5.1 Overview
The Border Gateway Protocol (BGP) is an Exterior Gateway Protocol (EGP) used for communication between routers in
different autonomous systems (ASs). BGP is used to exchange network accessibility information between different ASs and
eliminate routing loops by using its own mechanism.
BGP uses TCP as the transmission protocol. The reliable transmission mechanism of TCP is used to ensure the
transmission reliability of BGP.
Routers running BGP are called BGP speakers. BGP speakers between which a BGP session is established are called BPG
peers.
Two modes can be used to establish peers between BGP speakers: Internal BGP (IBGP) and External BGP (EBGP).
IBGP refers to a BGP connection established within an AS and completes transition of routing information within the
AS.
EBGP refers to a BGP connection established between different ASs and completes exchange of routing information
between different ASs.
Invalid entries include entries of inaccessible next hops and flapping entries.
Routes generated by a BGP speaker include routes generated by the network, redistribute and aggregate
commands.
5-1
Configuration Guide Configuring BGP
The preceding shows the route selection process under the default configurations. By using CLI commands, you can
change the route selection process. For example, you can run the bgp bestpath as-path ignore command to make
step 4 of the route selection process lose effect or run the bgp bestpath compare-routerid command to make step 9
lose effect.
5-2
Configuration Guide Configuring BGP
5.2 Applications
Application Description
Inter-AS Route Advertisement Implement inter-AS route advertisement by using BGP.
Intra-AS Route Reflection Set up a route reflection topology within an AS to reduce BGP connections.
As shown in Figure 5-1, BGP transfers the route of AS 65536 to AS 65538 through AS 65537.
Figure 5-1
Deployment
Establish the EBGP neighborship between R1 and R2 to implement inter-AS route advertisement.
Establish the IBGP neighborship between R2 and R3 to implement intra-AS route advertisement.
The Internet runs OSPF to ensure network accessibility between R2 and R3.
Establish the EBGP neighborship between R3 and R4 to implement inter-AS route advertisement.
5-3
Configuration Guide Configuring BGP
According to the BGP route advertisement principles, routes learned by an IBGP neighbor will not be advertised to the next
IBGP neighbor by default. Therefore within an AS, a device running BGP must implement full-mesh. When there are many
BGP devices within the AS, implementing full-mesh may cause large difficulties for network deployment. In this case, route
reflection can be used to solve this problem.
As shown in Figure 5-2, route reflection is deployed to implement BGP full-mesh among R1 to R4 and RR.
Figure 5-2
Deployment
5.3 Features
Basic Concept
After a router is enabled with BGP, a local AS number must be specified for the router. An AS number is a globally unique
number allocated by IANA, ranging from 1 to 4294967295.
Before a route is advertised between BGP speakers, a neighborship must be established in advance. You need to manually
configure BGP neighbors on both BGP speakers. That is, configure the peer as a neighbor on the two BGP speakers
respectively. Therefore, BGP neighbors are also called BGP peers.
5-4
Configuration Guide Configuring BGP
IBGP neighborship: The neighborship between BGP speakers within an AS is called IBGP neighborship. Routes
learned from IBGP neighbors are called IBGP routes.
EBGP neighborship: The neighborship between BGP speakers in different ASs is called EBGP neighborship. Routes
learned from EBGP neighbors are called EBGP routes.
When a BGP speaker advertises routes to its neighbors, the BGP speaker also advertises the attributes carried by the routes.
Common BGP attributes are as follows:
ORIGIN: Specifies the origin of a BGP route and can be set to IGP, EGP, or INCOMPLETE.
AS-PATH: Lists the ASs passed by a route in a reverse order. The last AS is placed at the beginning of the list.
NEXT-HOP: Specifies the IP address of the next hop to be reached by a BGP route.
MULTI-EXIT-DISC: Distinguishes multiple output/input interfaces for reaching the same neighbor AS. A smaller value
means a higher priority.
LOCAL-PREF: Distinguishes the priorities of IBGP routes in an AS. A larger value means a higher priority.
Overview
Feature Description
Creating a BGP Neighbor Create a BGP neighbor.
Configuring a BGP Route Set up a BGP route reflection topology to simplify network deployment for BGP neighbor
Reflector full-mesh.
Configuring a BGP Alliance Configure a BGP alliance to simplify network deployment for BGP neighbor full-mesh.
Re-distributing Local AS Re-distribute routing information to BGP and advertise local routes through BGP.
Network Information to BGP
Controlling Route Exchange Configure the route exchange policy for a BGP peer and control routes to be received by
Between BGP Peers and to be advertised to this peer.
Obtaining Accessible Re-distribute routing information in BGP into a core routing table or IGP.
Networks of Other ASs from
BGP
Configuring Synchronization Configure BGP to check whether BGP routes are synchronized with IGP routes.
Between BGP and IGP
Configuring BGP Soft Reset After a routing policy changes, use soft reset to apply a new policy.
Configuring the Route Configure the route selection algorithms and routing policy control of BGP.
Attributes of BGP
Configuring BGP Route Reduce routes by means of route aggregation.
Aggregation
5-5
Configuration Guide Configuring BGP
Feature Description
Configuring BGP Route Reduce the impacts of route flapping on a network topology.
Dampening
Configuring the Management Change the priorities of BGP routes.
Distance of BGP
Configuring Multi-path Load Configure multi-path load balancing for BGP to enhance the network reliability and increase
Balancing of BGP the network bandwidth.
Configuring BGP FRR Configure fast rerouting for BGP to enhance the network reliability.
Configuring BGP Timers Modify the internal timer time of BGP.
Configuring BGP Route Disable/Enable regular scanning for BGP routes and configure the route scanning interval.
Update Mechanisms
Configuring the Next-Hop Configure the next hop triggering update function of BGP.
Triggering Update Function of
BGP
Configuring BGP LOCAL AS Configure the LOCAL AS for a BGP neighbor.
Configuring BGP Capacity Avoid non-predictable running status caused by consumption of device capacity.
Protection
Configuring BGP GR Configure the BGP GR function to enhance the network reliability.
Configuring 4-Byte AS Configure the display mode of a 4-byte AS number.
Numbers of BGP
Configuring a Regular Use a regular expression to filter routing information.
Expression
Configuring BGP Session Configure BGP to ensure that after an address family with incorrect routing attributes is
Retention detected for a neighbor, other address family routes advertised by the neighbor will not be
affected.
Configuring BGP Delayed Configure BGP to delay route advertisement to a neighbor within a period after the system is
Advertisement upon System restarted.
Restart
Other Related Configurations Configure extended BGP functions.
Generally, BGP speakers between which an EBGP connection is established are directly connected whereas BGP
speakers between which an IBGP connection is established can be at any location within an AS.
Working Principle
5-6
Configuration Guide Configuring BGP
A BGP speaker can initiate a TCP connection request to a BGP peer specified by a user. After the TCP connection is
successfully created, the peers will exchange BGP packets to negotiate about connection parameters. The BGP
neighborship is successfully established after the negotiation succeeds.
A BGP speaker initiates a TCP connection request to a neighbor. The destination IP address is the peer IP address specified
by the user and the port number is fixed to 179.
The BGP speaker also listens on the port number 179 of the local TCP connection to receive connection requests from its
peer.
After the TCP connection is successfully created, the BGP speakers exchange OPEN packets to negotiate about BGP
connection parameters. The parameters for negotiation include:
Version: Indicates the BGP version number. At present, only version 4 is supported.
Neighbor AS number: Determines whether the AS number of the neighbor is consistent with the local AS number. If not,
the connection request will be denied.
Hold Time: Negotiates about the timeout duration for the BGP connection. The default value is 180 seconds.
Neighbor capability: Negotiates about various extended capabilities supported by the neighbor, including the address
family, dynamic route update, and GR functions.
Maintaining Neighborship
The Keepalive message is periodically sent between BGP speakers. If a new Keepalive packet is not received from the BGP
neighbor after the Hold Time expires, the BGP speaker considers that the neighbor is not accessible, disconnects the TCP
connection from the neighbor, and attempts to reconnect to it. The interval for a BGP speaker to send the Keepalive
message is one third of the Hold Time determined through negotiation and is 60 seconds by default.
Related Configuration
By default, a BGP speaker does not specify any neighbor. You can manually configure a BGP neighbor.
You can run the neighbor { peer-address | peer-group-name } remote-as as-number command to manually create a BGP
neighbor and specify the AS number of the neighbor.
By default, The TTL field in a TCP packet sent by an IBGP neighbor is set to the maximum value (255). It is set to 1 by an
EBGP neighbor.
You can run the neighbor { peer-address | peer-group-name } ebgp-multihop [ ttl ] command to set the TTL field of a TCP
packet sent by a BGP neighbor.
5-7
Configuration Guide Configuring BGP
A larger value of TTL means a longer distance between BGP neighbors. When TTL is 1, the BGP neighbor devices must be
directly connected.
By default, BGP automatically selects the source IP address of a TCP connection based on the IP address of the neighbor.
Generally, the IP address of a local packet output interface is used.
You can run the neighbor { peer-address | peer-group-name } update-source {interface-type interface-number | address }
command to adjust the source IP address of the neighbor's TCP connection.
You can run the neighbor { peer-address | peer-group-name } password [ 0 | 7 ] string command to set encryption for a
BGP neighbor's TCP connection.
By default, a neighbor created in the BGP configuration mode activates only the IPv4 Unicast address family capability.
You can run the address-family command to enter a corresponding address family mode, and then run the neighbor
{ peer-address | peer-group-name } activate command to activate the address family capability for the BGP neighbor.
Using a route reflector is a method for reducing IBGP peer connections within an AS.
The methods for reducing the IBGP peer connections within an AS include using a route reflector and using an AS
alliance.
Working Principle
Configure a BGP speaker as a route reflector which classifies IBGP peers in an AS into two types: clients and non-clients.
Configure a route reflector and specify clients for the route reflector. The route reflector and its clients form a cluster.
The route reflector will connect to its clients.
The clients of a route reflector in a cluster cannot connect to other BGP speakers out of the cluster.
Within an AS, full mesh is established among IBGP peers of non-clients. The IBGP peers of non-clients include the
following situations: Multiple route reflectors in a cluster; a route reflector in a cluster and BGP speakers (generally not
supporting the route reflector function) not involved in the route reflector function out of the cluster; a route reflector in a
cluster and route reflectors in other clusters.
5-8
Configuration Guide Configuring BGP
The rules for processing a route received by a route reflector are as follows:
A route update message received by an EBGP speaker will be sent to all clients and non-clients.
A route update message received by a client will be sent to other clients and all non-clients.
A route update message received by an IBGP speaker will be sent to all the other clients.
Generally, only one route reflector is configured in a cluster. In this case, the Router ID of the route reflector can be
used to identify this cluster. To increase the redundancy, you can set multiple route reflectors in a cluster. In this case,
you must configure the cluster ID so that a route reflector can identify the route update messages from other route
reflectors in the cluster.
If multiple route reflectors are configured for a cluster, you must configure a cluster ID for the cluster.
Generally, it is unnecessary to create connections between the clients of a route reflector in a cluster because the route
reflector will reflect the routes between the clients. However, if full mesh has been established among all clients, you
can cancel the client route reflection function of the route reflector.
Related Configuration
You can run the neighbor peer-address route-reflector-client command to configure a device as a route reflector and its
neighbor devices as reflected clients.
By default, BGP client-client route reflection is enabled, which means that routes received from a reflected client can be
advertised to other clients.
You can run the bgp client-to-client reflection command to enable or disable (using the no form of this command)
client-client reflection.
By default, a BGP reflection cluster ID is the Router-ID of BGP. If multiple reflection clusters are deployed within an AS,
different reflection cluster IDs must be configured for these reflection clusters.
You can run the bgp cluster-id cluster-id command to manually configure the cluster ID of a route reflector.
Working Principle
Divide an AS into multiple sub ASs and configure a unified alliance ID (namely, the alliance AS NUMBER) for these sub ASs
to form an alliance. Outside the alliance, the entire alliance is still considered as an AS and only the AS number of the
alliance is visible. Inside the alliance, full mesh of IBGP peers can be established for BGP speakers within a sub AS, and
5-9
Configuration Guide Configuring BGP
EBGP connections can be established for BGP speakers in different sub ASs. Though EBGP connections are established
between BGP speakers within a sub AS, when information is exchanged, NEXT_HOP, MED, LOCAL_PREF and other path
attributes keep unchanged.
Related Configuration
You can run the bgp confederation identifier as-number command to configure a BGP alliance ID. After the configuration is
successful, the local AS (specified by the router bgp as-number command) of BGP becomes the private AS inside the
alliance and is invisible to other ASs.
You can run the bgp confederation peers as-number [… as-number ] command to configure a BGP alliance neighbor. After
the configuration succeeds, the AS specified by this command and the local AS belong to the same alliance.
Working Principle
Manual static configuration: re-distribute the accessible network information within a specified range to BGP.
In addition, you can also re-distribute local AS network information to BGP routes by configuring route aggregation.
Related Configuration
You can run the network network-number [ mask mask ] [ route-map map-tag ] [ backdoor ] command to configure a BGP
network to re-distribute specified accessible network information to BGP. The prerequisite for successfully re-distributing
routing information to BGP is that a route is available in the core routing table and this route can be an IGP,
directly-connected or static route.
5-10
Configuration Guide Configuring BGP
You can run the redistribute protocol-type command to re-distribute the routing information of other protocols to BGP,
including OSPF, RIP, ISIS, static and directly-connected routes.
Working Principle
Configure the route exchange policy for a BGP peer and control routes to be received by and to be advertised to this peer.
Related Configuration
You can run the neighbor { address | peer-group-name } default-originate [ route-map map-tag ] command to advertise the
default route to a peer (or a peer group).
By default, BGP does not change the next hop of a route when it advertises the route to an IBGP neighbor and sets the next
hop to the local BGP speaker when it advertises the route to an EBGP neighbor.
You can run the neighbor { address | peer-group-name } next-hop-self command to configure the next hop of a route to the
local BGP speaker when distributing the route to a specified BGP peer (group).
By default, BGP does not delete the private AS in the AS-PATH attribute when it advertises routing information to a peer.
You can run the neighbor { address | peer-group-name } remove-private-as command to require that the private AS
number recorded in the AS path attribute should be deleted when routing information is distributed to an EBGP peer (group).
This command does not apply to an IBGP neighbor.
By default, BGP does not send the community attribute when it advertises routing information to a peer.
You can run the neighbor { address | peer-group-name } send-community command to specify that the community attribute
can be sent to a specified BGP peer (group).
By default, BGP does not restrict the records of routing information that can be received by a peer.
You can run the neighbor { address | peer-group-name } maximum-prefix maximum [ warning-only ] command to specify
the records of routing information received from a specified peer (group).
5-11
Configuration Guide Configuring BGP
By default, a BGP neighbor is not enabled with any filtering policy and receives all legal routing information advertised by a
neighbor.
BGP supports multiple methods of configuring the route filtering policies for a neighbor, including:
Use an ACL to filter routes in the input and output directions of the neighbor.
Use an AS-PATH list to filter routes in the input and output directions of the neighbor.
Use a prefix-list to filter routes in the input and output directions of the neighbor.
Use a route map to filter routes in the input and output directions of the neighbor.
Allow for advertising certain routing information previously suppressed by the aggregate-address command when
distributing routing information to a specified peer.
Send routing information of other ASs exchanged by BGP to the routing table of a device so that the device can forward
packets to other ASs.
Working Principle
BGP controls routing information sent to the core routing table by using table-map. table-map can modify the attributes of
routing information sent to the core routing table. If the route is matched, BGP modifies the attribute of the routing information
and sends the route. If the route is not matched or route matching is denied, BGP does not modify the attribute of the routing
information but sends the route.
Changes of table-map are not reflected in the core routing table immediately, but reflected a moment later. To update the
application of table-map immediately, you can run the clear ip bgp [ vrf vrf-name ] table-map command to update the
routing information in the core routing table immediately. This command does not clear the existing routes in the core routing
table, but directly applies table-map to send the updated routing information, thereby not causing forwarding flapping.
Re-distribute BGP routes on a BGP speaker to IGP to ensure that routers within an AS can obtain routes to other ASs.
Related Configuration
5-12
Configuration Guide Configuring BGP
Configuring table-map
By default, BGP is not configured with a table-map and allows for sending all routes without modifying the attributes of the
routes.
You can run the table-map route-map-name command to set a table-map and control the routing information to be sent to
the core routing table. route-map-name specifies a route-map to be associated.
Run the table-map command in the BGP configuration mode or in the IPv4 address family mode.
The Match and Set statements supported in the table-map are as follows:
Match statements: as-path, community, ip address, ip next-hop, metric, origin and route-type
Set statements: metric, tag and next-hop
You can run the no table-map command to delete the table-map configurations.
You can run the redistribute bgp [ route-map map-tag ] [ metric metric-value ] command to re-distribute BGP routes to IGP
(RIP\OSPF\ISIS).
The bgp redistribute-internal command controls only whether to re-distribute routes learned from IBGP to IGP. By default,
routes learned from IBGP can be re-distributed to IGP.
You can run the bgp redistribute-internal command in the BGP configuration mode, IPv4/IPv6 address family mode
or the IPv4 VRF address family mode.
You can run the no bgp redistribute-internal command to delete the configuration.
Working Principle
To keep synchronization between BGP and IGP, you must ensure that all routers within an AS can learn routing information
to be sent to another AS before the routing information is advertised to this AS.
Synchronization between BGP and IGP is not required only in the following cases:
Routing information passing through an AS is not available. For example, the AS is an end AS.
All routers within an AS run BPG. Full mesh is established among all BGP speakers (neighborship is established
between each two BGP speakers).
Related Configuration
5-13
Configuration Guide Configuring BGP
You can run the synchronization command to enable synchronization between BGP and IGP.
You can run the no synchronization command to disable synchronization between BGP and IGP.
Working Principle
Routing policies that affect inbound routing information are called inbound routing policies (such as In-route-map and
In-dist-list) and routing policies that affect outbound routing information are called outbound routing policies (such as
Out-route-map and Out-dist-list).
When outbound routing policies change, BGP soft reset will re-advertise all routing information of a BGP speaker to its
neighbors.
If inbound routing policies change, the operation is more complex than that when outbound routing policies change. This is
because outbound routing policies are executed in the routing table of the local BGP speaker whereas inbound routing
policies are executed for routing information received from the BGP peer. To reduce cost, the local BGP speaker does not
store the original routing information received from the BGP peer.
If inbound routing policies change and a neighbor device supports route update, you can configure soft reset to send a route
update request to the neighbor device. After receiving the request, the neighbor device re-advertises all routing information.
You can also perform configuration to ensure that each BGP peer stores original routing information on the local BGP
speaker and provides original routing information basis for modifying inbound routing policies subsequently.
The "route update capability" allows for modifying and executing routing policies without storing original routing
information. This product supports the route update capability. You can run the show ip bgp neighbors command to
check whether a BGP peer supports route update. If yes, you do not need to run the neighbor soft-reconfiguration
inbound command when inbound routing policies change.
Related Configuration
Run the clear ip bgp { * | peer-address | peer-group peer-group-name | external } soft out command to soft reset a BGP
connection. You can activate execution of a routing policy without restarting the BGP session.
5-14
Configuration Guide Configuring BGP
Run the neighbor { address | peer-group-name } soft-reconfiguration inbound command to save unmodified routing
information sent by a BGP peer (group).
Working Principle
AS_PATH Attribute
IP address. You can run the neighbor distribute-list and neighbor prefix-list commands for implementation.
You can use an AS path-based access control list (ACL) to control the distribution of routing information. Where, the AS
path-based ACL uses a regular expression to parse the AS path.
Based on the standard (RFC1771), BGP does not consider the AS path length when selecting the optimum path. Generally,
a shorter AS path length means a higher path priority; therefore, Ruijie considers the AS path length when selecting the
optimum path. You can determine whether to consider the AS path length when selecting the optimum path based on the
actual conditions.
Within an AS, whether to consider the AS path should be consistent for all BGP speakers when the optimum path is
selected; otherwise, the optimum paths selected by the BGP speakers may be different.
MULTI_EXIT_DISC Attribute
BGP uses the MED value as the basis for comparing priorities of paths learned from EBGP peers. A smaller MED value
means a higher path priority.
By default, the MED value is compared only for paths of peers from the same AS when the optimum path is selected.
By default, the MED value is not compared for paths of peers from other sub ASs within an AS alliance.
By default, if a path not configured with the MED attribute is received, it is considered that the MED value of this path is
0. Since a smaller MED value means a higher path priority, this path has the highest priority.
By default, the MED value is not compared with paths from different ASs; instead, the sequence of receiving the paths
is compared.
LOCAL_PREF Attribute
When sending routes received from EBGP peers to IBGP peers, a BGP speaker adds the LOCAL_PREF attribute. BGP
uses the LOCAL_PREF attribute as the basis for comparing priorities of paths learned from IBGP peers. A larger value of
LOCAL_PREF means a higher path priority.
You can also run the set local-preference command of a route map to modify the LOCAL_PREF attribute of the specified
path.
5-15
Configuration Guide Configuring BGP
COMMUNITY Attribute
The COMMUNITY attribute is another mode for controlling distribution of routing information.
A community is a set of destination addresses. The COMMUNITY attribute is intended to facilitate execution of a routing
policy based on a community and thereby simplify the configuration of routing information distribution control on BGP
speakers. Each destination address may belong to multiple communities. An AS administrator can define the communities,
to which a destination address belongs.
By default, all destination addresses belong to the Internet community and are carried in the community attribute of the path.
Internet: Indicates the Internet community. All paths belong to this community.
no-advertise: Indicates that the path is not advertised to any BGP peer.
local-as: Indicates that a path is not advertised to other ASs. When an AS alliance is configured, the path is not
advertised to other ASs or sub ASs.
By using the community attribute, you can control the receiving, prioritization and distribution of routing information. BGP
speakers can set, add or modify the community attribute when learning, advertising or re-distributing routes. An aggregation
path will contain the community attribute values of all aggregated paths.
BGP supports up to 32 COMMUNITY attributes for each route and allows for up to 32 COMMUNITY attributes when
match and set COMMUNITY of a route map are configured.
Others
During selection of the optimum path, if two paths with the same path attributes are received from different EBGP peers, the
optimum path is selected based on the receiving sequence by default. You can disable comparison of the receiving
sequence but use the path with a smaller router ID as the optimum path.
Related Configuration
The configuration is the same as that for routing information receiving and sending for a specified BGP peer (group).
Routing policies are executed based on the AS path list to advertise or receive only routes that match the policies.
5-16
Configuration Guide Configuring BGP
The configuration is the same as when receiving and sending routing information for a specified BGP peer (group).
Routing policies are executed based on a route map or the set rules in the route map are used to modify routing
attributes.
In the route-map configuration mode, you can run the match as-path command to modify AS path attributes by using
an AS path list or directly run the set as-path command to modify AS attribute values.
Allows BGP not to consider the AS path length when selecting the optimum path. The AS path length is compared by
default.
bgp always-compare-med
Allows for comparing the MED values of paths from different ASs, which is disabled by default.
Allows for comparing the MED values of paths of peers from other sub ASs in the same AS alliance, which is disabled
by default.
Sets a path not configured with the MED attribute to the lowest priority, which is disabled by default.
bgp deterministic-med
Allows for comparing the paths of peers within the same AS, which is disabled by default.
Changes the default local preference value, ranging from 0 to 4,294,967,295. A larger value means a higher priority.
The default value is 100.
Creates a community list. community-list-name indicates the name of the community list.
community-number: Indicates a value (1 to 4,294,967,295) specified by a user or a known community attribute (internet,
local-AS, no-advertise or no-export).
Allows for sending the community attribute to a specified BGP peer (group), which is not configured by default.
The configuration is the same as that for routing information receiving and sending for a specified BGP peer (group).
Routing policies are executed based on a route map. No filtering policy is configured for peers by default.
5-17
Configuration Guide Configuring BGP
In the route-map configuration mode, you can run the match community-list [exact] and set community-list delete
commands to modify the community attribute by using a community list or directly run the set community command to
modify the community value.
Others
Allows BGP to compare the router ID when selecting the optimum path, which is disabled by default.
Working Principle
Aggregate one or more detailed BGP routes into a BGP route with a shorter network mask.
By default, BGP advertises all path information before and after aggregation. If you hope that only aggregated path
information is advertised, you can run the aggregate-address summary-only command.
When the aggregate-address command is used to configure an aggregated route, the aggregated route takes effect
immediately as long as there are routes in the configured address range.
Related Configuration
Configures BGP route aggregation. By default, BGP does not create any aggregated routing entry.
Configures an aggregation address and stores the AS path information within the aggregation address range. By
default, BGP does not store AS path information.
Configures an aggregation address and advertises only an aggregated path. By default, BGP advertises all path
information within the aggregation range.
Configures an aggregation address, stores the AS path information within the aggregation address range and
advertises only aggregated paths.
5-18
Configuration Guide Configuring BGP
Route flapping often causes transmission of unstable routes in a network, and thereby causes network instability. BGP route
dampening is a method for reducing route flapping. It reduces possible route flapping by monitoring routing information from
EBGP peers.
Working Principle
Penalty: Once route flapping occurs, a BGP speaker enabled with route dampening adds a value to the penalty for this
route. The penalty is accumulated until the Suppress Limit is reached.
Suppress Limit: When the penalty of a route is greater than this value, the route will be suppressed.
Reuse Limit: When the penalty value of a route is smaller than this value, route suppression will be canceled.
A brief description of route dampening processing: BGP speaker punishes a route once (adds to the penalty) route flapping
occurs. When the penalty reaches the Suppress Limit, the route will be suppressed. When the Half-life-time reaches, the
penalty is halved. When the penalty is reduced to the Reuse Limit, the route is activated again. The Max-suppress-time
indicates the longest time that the route can be suppressed.
Related Configuration
bgp dampening
half-life-time (1~45minutes): The default value is 15 minutes. A larger value means a longer flapping suppression and
dampening period.
reuse (1~10,000): The default value is 750. A smaller value means longer time for continuous stabilization before a
flapping route is enabled again.
suppress (1~20,000): The default value is 2,000. A smaller value means more flapping times allowed before
suppression.
max-supress-time (1~255minutes): The default value is 4*half-life-time. A larger value means longer maximum
suppression time.
5-19
Configuration Guide Configuring BGP
Clears the flapping statistics about all routes that are not suppressed.
Clears the flapping statistics about specified routes (excluding suppressed routes).
Clears the flapping statistics about all routes, including routes whose suppression is cancelled.
Working Principle
The management distance indicates the reliability of a route source, ranging from 1 to 255. A larger value means lower
reliability. BGP sets different management distances for routing information learned from different sources, including
External-distance, Internal-distance and Local-distance.
External-distance: Indicates the management distance of routes learned from EBGP peers.
Internal-distance: Indicates the management distance of routes learned from IBGP peers.
Local-distance: Indicates the management distance for routes learned from peers but it is considered that better routes
can be learned from IGP. Generally, these routes can be indicated by the Network Backdoor command.
You are not advised to change the management distance of BGP. If you really need to change the management
distance of BGP, please remember:
The external-distance should be shorter than the management distances of other IGP routing protocols (OSPF and
RIP).
The internal-distance and local-distance should be longer than the management distances of other IGP routing
protocols.
Backdoor Route
If you prefer an IGP route but do not use an EBGP route, you can set the EBGP route as the backdoor route. By default, the
management distance for routes learned from a BGP speaker for which an EBGP connection is established is 20. You can
5-20
Configuration Guide Configuring BGP
run the network backdoor command to set the management distance of the network information to 200 so that the same
network information learned from IGP has the highest priority. The networks learned from IGP are considered backdoor
networks and are not advertised.
Related Configuration
You can run the distance bgp external-distance internal-distance local-distance command to configure the management
distance of BGP. The value ranges from 1 to 255.
The default value of external-distance is 20; the default value of internal-distance is 200; the default value of local-distance is
200.
A longer management distance means a lower route priority.
Run the network network-number mask network-mask backdoor command to configure a backdoor route. By default, no
backdoor route is configured.
According to the types of equivalent routes, multi-path load balancing of BGP is classified into the following types:
EBGP load balancing: implement load balancing for routes learned from EBGP neighbors.
IBGP load balancing: implement load balancing for routes learned from IBGP neighbors.
Both the IPv4 and IPv6 protocol stacks support multi-path load balancing.
Load balancing cannot be implemented between IBGP and EBGP routes (including EBGP routes in an alliance).
Working Principle
If a BGP routing table has multiple paths to the same network, BGP calculates the route with the highest priority by default. If
there are optimum multiple routes with the same priorities, BGP still selects a unique route by using comparison rules,
notifies the route to the forwarding plane and controls the forwarding of data streams. After multi-path load balancing is
enabled, BGP calculates a unique optimum route and also lists paths with the same priorities as equivalent routes. Then,
BGP notifies the optimum route and the equivalent routes to the forwarding plane to implement load balancing.
Equivalent routes have the same basic attributes and priorities. That is, according to the optimum path selection rules of BGP,
the paths have the same priorities before router-IDs are compared.
By default, equivalent routes must have the same AS-PATH attributes. Under such strict conditions, load balancing cannot
be implemented in certain environments. In this case, you are advertised to enable the AS-PATH loose comparison mode. In
the AS-PATH loose comparison mode, when other conditions for equivalent routes are met, as long as the AS-PATH lengths
5-21
Configuration Guide Configuring BGP
of routes and the AS-PATH lengths of routes from an alliance are the same respectively, it is considered that the conditions
for equivalent routes are met.
When the next hops of multiple BGP equivalent paths recur to the same IGP output interface, load balancing cannot be
implemented.
Related Configuration
number indicates the number of equivalent next hops, ranging from 1 to 32. The default value is 1. A larger value means
more equivalent next hops allowed.
number indicates the number of equivalent next hops, ranging from 1 to 32. The default value is 1. A larger value means
more equivalent next hops allowed.
Working Principle
If a BGP routing table has multiple paths to the same network, BGP calculates the route with the highest priority by default.
After the BGP FRR function is used, BGP selects a backup route for each optimum route. After BFD FRR detects that the
master link is faulty, it switches the data to the originally calculated backup link for forwarding. After route convergence is
completed, data is switched to the optimum route re-calculated for forwarding. In this way, BGP FRR can avoid route
disconnection due to a link fault before BGP route convergence is completed.
BGP FRR is supported only in the IPv4 Unicast and IPv4 VRF address families of BGP.
5-22
Configuration Guide Configuring BGP
Only one backup route can be generated and the next hop of the backup route cannot be the same as that of the
preferred route.
A backup next hop cannot be generated for an Equal-Cost Multi-Path Routing (ECMP) route.
In the BGP IPv4 VRF configuration mode, BGP FRR has a lower priority than VPN FRR. That is, if VPN FRR is enabled
in the VRF mode, BGP FRR takes effect only when VPN FRR fails to calculate a backup route.
Related Configuration
Run the bgp fast-reroute command to enable the BGP FRR function, which is disabled by default.
Run the neighbor peer-address fall-over bfd command to configure a BFD session to a BGP neighbor, which is not
configured by default.
If the BFD session to a BGP neighbor cannot be used to fast detect the failure of the master link, you can run the bfd bind
bgp peer-ip ip-address interface interface-type interface-index source-ip ip-address command to configure a BGP BFD
session, which is not configured by default.
Working Principle
BGP uses the Keepalive timer to maintain a valid connection with a peer and uses the Holdtime timer to identify whether a
peer is valid. By default, the value of the Keepalive timer is 60 seconds and the value of the Holdtime timer is 180 seconds.
When a BGP connection is established between two BGP speakers, the two BGP speakers negotiate about the Holdtime
timer value and select a smaller value. 1/3 of the negotiated Holdtime timer value and the configured Keepalive timer value
are compared and the smaller value is used as the Keepalive timer value.
To reduce the impacts of frequent BGP reconnection to a neighbor on the network bandwidth, after a BGP speaker detects
failure of a neighbor connection, the BGP speaker attempts to reconnect the neighbor after the connect-retry timer expires.
By default, the value of the connect-retry timer is 15s.
5-23
Configuration Guide Configuring BGP
To reduce the impacts of route update packets on the network bandwidth, after a BGP speaker detects a network topology
change, the BGP speaker does not advertise the route update to its neighbors immediately. Instead, the BGP speaker uses a
regular update mechanism to advertise all changed routing information to its neighbors.
Related Configuration
Adjusts the BGP keepalive and holdtime values for all peers.
The keepalive value ranges from 0 to 65,535. The default value is 60 seconds.
The holdtime value ranges from 0 to 65,535. The default value is 180 seconds.
Configures the keepalive and holdtime values used for connecting to a specified BGP peer (group).
The keepalive value ranges from 0 to 65,535. The default value is 60 seconds.
The holdtime value ranges from 0 to 65,535. The default value is 180 seconds.
Configures the connect-retry value used for reconnecting to a specified BGP peer (group).
The value of connect-retry ranges from 1 to 65,535. The default value is 15 seconds.
Configures the minimum interval for sending route updates to a specified BGP peer (group). The value of
advertisemet-interval ranges from 0 to 600 seconds. The default value for IBGP peers is 0 seconds and the default
value for EBGP peers is 30 seconds.
Configures the minimum interval for sending local initial route updates to a specified BGP peer (group). The value of
As-origination-interval ranges from 1 to 65,535. The default value is 1 second.
BGP provides two route update mechanisms: regular-scanning update and event-triggering update. Regular-scanning
update indicates that BGP uses an internal timer to start scanning regularly and update the routing table. Event-triggering
update indicates that BGP starts scanning and updates the routing table when the BGP configuration commands are
changed due to user configuration or the next hop of a BGP route changes.
5-24
Configuration Guide Configuring BGP
This function is configured based on address families and can be configured in the IPv4, IPv6, VPNv4, VPNv6, IPv4 vrf
and IPv6 VRF address family modes.
If you set the BGP route update mechanism to event-triggering update (by running the bgp scan-rib disable
command), you must disable synchronization (by running the no synchronization command) and enable the BGP
next-hop triggering update function (by running the bgp nexthop trigger enable command). On the other hand, if you
enable synchronization or disable the BGP next-hop triggering update function, the BGP routing table must be updated
in the regular scanning mode.
Related Configuration
Sets the BGP route update mechanism to event-triggering update. Regular-scanning update is used by default.
Configures the regular update interval of BGP. The value of scan-time ranges from 5 to 60 seconds. The default value
is 60 seconds.
Working Principle
When BGP connects to a neighbor, BGP automatically monitors the next hop of the BGP route learned from the neighbor.
When the next hop changes in the core routing table, BGP receives an advertisement about the next hop change and
updates the BGP routing table. This optimization measure improves the BGP route convergence performance by reducing
the time for detecting next-hop changes.
If this function is disabled, BGP next hop update will be discovered through regular scanning specified by scan-timer.
This function is configured based on address families and can be configured in the IPv4, IPv6, VPNv4, and IPv4 vrf
address family modes.
bgp nexthop trigger delay and bgp scan-time control the same timer. When bgp scan is enabled (it is enabled by
default and can be disabled by the bgp scan-rib disable command), if the value of bgp nexthop trigger delay is
larger than 60s, bgp scan does not take effect because the scan timer is always triggered before the delay.
If the network environment is unstable (with frequent next-hop changes), especially with many routes, this function
performs unnecessary route calculations, which consumes more CPU resources. Therefore, you are advised to disable
this function in this environment.
Related Configuration
5-25
Configuration Guide Configuring BGP
Configures the delay of BGP next-hop triggering update. The value of delay-time ranges from 0 to 100 seconds. The
default value is 5 seconds.
Working Principle
In BGP, when a local device connects to a peer, the local device advertises the local AS number to the peer by using an
Open message. The peer checks whether the BGP AS number advertised is the same as the local AS number. If the AS
numbers are different, the peer will deny the BGP connection. By default, the local AS in the BGP connection is a route BGP
AS. However, if a local AS is configured for the peer, the configured local AS will replace the route BGP AS when a BGP
connection is established between the local device and the peer.
The neighbor peer-address local-as as-num command for configuring the BGP Local AS function can be followed by
more options. For details, see the Command Reference.
The BGP Local AS function is applied only to EBGP peers, but is not applied to IBGP peers and alliance EBGP peers.
In addition, the BGP Local AS function has the following restrictions:
1) The configured local AS cannot be the same as the remote AS of a peer.
2) The local AS cannot be configured independently for a member of a peer group.
3) The configured local AS cannot be the same as the route BGP AS.
4) If a device is a member of an AS alliance, the local AS cannot be the same as the AS alliance number.
Related Configuration
Configures a local AS for a peer. By default, no local AS is configured for any peer. The local AS of a peer is the route
BGP AS.
5-26
Configuration Guide Configuring BGP
Working Principle
Restrict the number of BGP routes by setting the maximum number of routes in a BGP address family and the maximum
number of routes that can be learned by a BGP neighbor.
If the memory is insufficient, BGP can enter the OVERFLOW state. In the OVERFLOW state, BGP generates a default route
pointing to a NULL interface. If a newly learned route is not a refined route other than the default route in the current routing
table, the route is discarded. In other words, general newly learned routes are discarded to ensure that the system memory is
stable. The purpose of not discarding all routes is to avoid route loops in the entire network. Therefore, it is safe for BGP to
enter the OVERFLOW state. BGP is allowed to enter the OVERFLOW state by default.
By default, BGP enters the OVERFLOW state in case of insufficient memory. If you do not want to BGP to enter the
OVERFLOW state, you can run the no overflow memory-lack command to disable this function.
In the OVERFLOW state, BGP supports only the clear bgp { addressfamily | all } * command at present. You can also
exit from the OVERFLOW state by disabling and enabling BGP again. When the memory becomes sufficient again,
BGP can also automatically exit from the OVERFLOW state.
Related Configuration
Restricts the maximum number of routes that can be learned from a BGP neighbor, which is not restricted by default.
maximum-prefix maximum
Restricts the maximum number of routes in a BGP address family. The default maximum number of routes for the BGP
IPv4 VRF, IPv6 VRF and IPv4 MDT address families are 10,000 and is not configured for other address families.
overflow memory-lack
Enable BGP to enter the OVERFLOW state in case of insufficient memory, which is enabled by default.
Working Principle
Comply with RFC4724: Graceful Restart Mechanism for BGP. [BGP GR] is used in the following description to indicate
the RFC.
5-27
Configuration Guide Configuring BGP
BGP GR is not an independent process, but is jointly completed by the Restarter and Helper.
The Restarter performs restart and maintains the working capability of the route forwarding plane when the route control
plane is faulty.
The Helper is the BGP neighbor of the Restarter and helps the Restarter to complete GR.
A capability indicating GR is added to the OPEN message of BGP, which is called "Graceful Restart Capability". This
capability is used by BGP to tell its neighbor it supports the graceful restart capability. During initialization of a BGP
connection, two neighbors negotiate about the GR capability.
The route update end flag (End-of-RIB, shorted as EOR) is added to the Update packet of BGP, which indicates that the
routing information update to the neighbor is completed.
5. ① When BGP establishes neighborship at the beginning, BGP uses the GR capability field in the OPEN message to
negotiate about the GR capabilities of the two neighbors.
5-28
Configuration Guide Configuring BGP
6. ②At a moment, the Restarter starts restart, and the BGP session is disconnected. The Helper detects the
disconnection, keeps the route of the Restarter valid but adds the "Stale (aged but not updated)" flag to the route.
7. ③ and ④ The Restarter completes restart and connects to the Helper again.
8. ⑤ The Restarter waits for the route update message and EOR flag from the Helper.
9. ⑥ After receiving the EOR flag from all neighbors, the Restarter performs route calculation, update routing entries and
then sends updated routes to the Helper.
10. ⑦ After receiving the updated routes, the Helper cancels the "Stale" flag of the routes. After receiving the EOR flag from
the Restarter, the Helper deletes routes with the "Stale" flag (these routes are not updated), performs route calculation,
and updates the routing entries. The entire GR process is completed.
Restart-Timer: The GR Restarter advertises the time value to the GR Helper, which indicates the maximum waiting
time that the GR Restarter hopes the Helper to wait before a new connection is established between them. You can run
the bgp graceful-restart restart-time command to modify the time value.
Wait-For-EOR Timer: Indicates the maximum time that the GR Restarter waits for the EOR flag from all GR Helpers.
After receiving the EOR flag from all GR Helpers or after the Wait-For-EOR timer expires, the GR Restarter calculates
the preferred route and updates the routing entries. You can run the bgp update-delay command to modify the time
value.
StalePath Timer: Indicates the maximum time that the GR-Helper waits for the EOR flag from the GR Restarter after a
new connection is established between them. Within this period, the Helper keeps the original route of the Restarter
valid. After receiving the EOR flag or after the StalePath timer expires, the Helper clears the routing entries still with the
"Stale" tag. You can run the bgp graceful-restart stalepath-time command to modify the time value.
Related Configuration
Configuring BGP GR
bgp graceful-restart
Disables the address family GR capability. The address family GR capability is enabled by default. After the global BGP
GR is enabled, the GR capability is automatically enabled for all address families.
5-29
Configuration Guide Configuring BGP
When BGP GR is implemented, all BGP peers must enable the BGP GR capability. If certain peers do not support or
enable GR, BGP GR may fail to be implemented. GR failure may cause a short route black-hole or route loop, which
may affect the network. Therefore, you are advised to verify that all neighbors are enabled with the BGP GR capability.
You can run the show ip bgp neighbors command to display the capabilities successfully negotiated between BGP
peers and verify that the GR capability negotiation is successful. In the BGP route configuration mode, run the bgp
graceful-restart command to enable the BGP GR capability.
The bgp graceful-restart command will not be applied to a successfully established BGP connection immediately.
That is, when the BGP connection is in the Established state, the BGP peers will not re-negotiate about the GR
capability immediately. To enable the BGP peers of the BGP connection to negotiate about the GR capability
immediately, you need to forcibly restart the BGP peers to re-negotiate about the GR capability by running the clear ip
bgp 192.168.195.64 command (for example).To make GR enabling or disabling take effect immediately, you must
restart the neighborship for capability negotiation, which may cause network flapping and affect normal use of users.
Therefore, you can explicitly control whether to restart the neighborship.
Supporting BGP GR does not mean that a device can be used as the Restarter to implement BGP GR. Whether to
implement BGP GR also depends on the hardware capabilities of the device. Ruijie devices must support the
dual-engine hot backup when being used as the GR Restarter.
The restart period configured by the bgp graceful-restar restart-time command should not be longer than the Hold
Time of the BGP peers; otherwise, the Hold Time will be used as the restart time to be advertised to the BGP peers
during GR capability negotiation.
The bgp graceful-restart disable command is used to disable the GR capability in an address family in the address
family configuration mode, which is not configured by default.
Working Principle
4-byte AS numbers support two expression modes: the decimal mode and dot mode. The decimal mode is the same as the
original expression mode, that is, expressing the 4 bytes of an AS number as decimal digits. The dot mode is expressed as
([higher 2 bytes.]lower 2 bytes). If the higher 2 bytes are 0, they will not be displayed.
For example, an AS number is 65534 in the decimal mode and is 65,534 in the dot mode (the 0 at the beginning is not
displayed).
For example, an AS number is 65,536 in the decimal mode, and is 1.0 in the dot mode.
For example, an AS number is 65,538 in the decimal mode, and is 1.2 in the dot mode.
5-30
Configuration Guide Configuring BGP
A 4-byte AS number is displayed in the decimal mode by default. You can manually set the display mode to the dot mode.
After the setting, a regular expression will use the dot mode for matching 4-byte AS numbers.
With introduction of 4-byte AS numbers, BGP connections may be established between old BPG speakers supporting only
2-byte AS numbers and new BGP speakers supporting 4-byte AS numbers. If the AS where a new BGP speaker resides has
a 4-byte AS number, when an old BGP speaker creates neighborship with the new BGP speaker, the old BGP speaker uses
the reserved AS number 23,456 to replace the 4-byte AS number of the new BGP speaker. In the OPEN packets sent by the
new BGP speaker to the old BGP speaker, the 4-byte AS number in the My Autonomous System field will be replaced by
23,456. In addition, in UPDATE packets sent to the old BGP speaker, the 4-byte AS number in the AS-PATH and
AGGREGATOR attributes will also be replaced by 23,456. In addition, new optional transfer attributes AS4-PATH and AS4-
AGGREGATOR will be used to record the real 4-byte AS number so that the real AS-PATH and AGGREGATOR attributes
can be restored when the route reaches a next new BGP speaker.
In other cases, the real AS number of the remote end is used to create neighborship.
Related Configuration
Displays a 4-byte AS number in the dot mode. The decimal mode is used by default.
The formula is used to assess text data and return True or False to indicate whether the expression can correctly describe
the data.
Working Principle
Regular expressions are used in BGP path attributes. The following table describes the usages of special characters in a
regular expression.
5-31
Configuration Guide Configuring BGP
Related Configuration
Displays the BGP routing information in a specified regular expression matched by the AS-PATH attribute.
Displays the BGP routing information in a regular expression within the specified double quotation marks matched by
the AS-PATH attribute.
Working Principle
After the BGP session retention function is enabled, if an error occurs in the routing attribute of an address family, only the
routing information in this address family related to the neighbor is deleted. In addition, the BGP session and other address
families are not affected, which enhances the stability of BGP.
recovery-time is used to configure the time for waiting for automatic route recovery, which requires that a neighbor should
support the route-refresh capability. After the recovery-time, BGP sends the route-refresh message of the address family to
the neighbor and re-advertises all routing information in the address family to this neighbor.
In the session retention state, you can manually reset the neighbor to exit from the session retention state.
Related Configuration
recovery-time time configures the time for waiting for automatic route recovery, ranging from 10 to 4,294,967,296
seconds. The default value is 120.
Working Principle
5-32
Configuration Guide Configuring BGP
The BGP delayed advertisement upon system restart ensures that routes are not advertised to neighbors immediately after
the neighborship is established upon system restart and that the routes are advertised after a period. This function has no
effect on other behaviors such as route receiving performed by the neighbors. If part of the routes is not affected by the delay,
configure prefix-list policy to match this part of routes so that route advertisement can be more flexible.
delay-time is used to configure the waiting time before routes are advertised to the neighbors. startup-time is used to
configure the startup time. Within the startup-time, BGP sends routing information to the neighbors at the interval specified by
delay-time.
After the startup-time ends, the default route advertisement behavior recovers.
Related Configuration
Enables BGP delayed advertisement upon system restart, which is disabled by default.
delay-time configures the delay time for advertising routes after the BGP neighborship is established upon system
restart, ranging from 1 to 600 seconds. The default value is 1s.
startup-time configures the time range for system restart, ranging from 5 to 58,400 seconds. The delayed route
advertisement mechanism is used within this range. The default value is 600s.
Configure the wait-for-controller command to ensure that routes are advertised only after the controller delivers
configuration messages and receives EOR messages from the neighbors. If no EOR message is received within the
time specified by startup-time, routes will be advertised forcibly.
By default, the BGP delayed advertisement upon system restart is disabled. If enable it, the route will be immediately
sent after the prefix-list policy is matched.
For configuration and application of BGP MCE, see section "VRF Configuration Guide".
For configuration and application of BGP L2VPN, see section "L2VPN Configuration Guide".
For configuration and application of BGP/MPLS VPN, see section "BGP/MPLS VPN Configuration Guide".
For configuration and application of the BGP MDT address family, see section "Multicast VPN (MD Configuration
Guide)".
5.4 Configuration
5-33
Configuration Guide Configuring BGP
Configuring an AS Alliance bgp confederation identifier as-number Configures the BGP alliance ID.
bgp confederation peers as-number […
Configures a BGP alliance neighbor.
as-number ]
Configuring Multi-path Load maximum-paths ibgp number Configures IBGP load balancing.
Balancing of BGP maximum-paths ebgp number Configures EBGP load balancing.
Enables the BGP AS-PATH loose
bgp bestpath as-path multipath-relax
comparison mode.
(Optional) It is used to increase the convergence speed when a network fault occurs.
5-34
Configuration Guide Configuring BGP
(Optional) It is used for interconnecting with an old device that supports only 2-byte AS
Configuring Interconnection
numbers.
with Devices Supporting
Only 2-Byte AS Numbers neighbor { peer-address | peer-group-name }
Creates a BGP neighbor.
remote-as as-number
Notes
If an IBGP neighbor is not directly connected, you need to configure IGP or a static routing protocol to implement
interconnection.
If an EBGP neighbor is not directly connected, you need to configure the ebgp-multihop parameter for the neighbor.
Configuration Steps
Enabling BGP
(Optional) Perform this configuration in the BGP configuration mode. By default, BGP automatically selects a local
interface that reaches the destination IP address of a peer as the source interface.
For an IBGP neighbor, you are advised to use a Loopback interface as the source interface.
Verification
5-35
Configuration Guide Configuring BGP
Related Commands
Enabling BGP
Configuration Example
5-36
Configuration Guide Configuring BGP
Scenario
Figure 5-4
Configuration Enable BGP on all devices and set the AS numbers as shown in Figure 5-4.
Steps Configure a loopback interface on A, B, and C and create an IBGP neighbor based on the loopback
interface.
Create an EBGP neighborship by using the directly connected interfaces on C and D.
Create an IBGP peer group on C.
A
A# configure terminal
B
B# configure terminal
5-37
Configuration Guide Configuring BGP
C
C# configure terminal
D
D# configure terminal
Verification Run the show command to display the BGP neighbor status.
A
A# show ip bgp neighbor
5-38
Configuration Guide Configuring BGP
Neighbor capabilities:
0 accepted prefixes
0 announced prefixes
Nexthop: 10.1.1.1
Nexthop global: ::
Nexthop local: ::
5-39
Configuration Guide Configuring BGP
B
B# show ip bgp neighbor
Neighbor capabilities:
0 accepted prefixes
0 announced prefixes
Nexthop: 10.1.1.2
Nexthop global: ::
5-40
Configuration Guide Configuring BGP
Nexthop local: ::
C
C# show ip bgp neighbor
Neighbor capabilities:
0 accepted prefixes
0 announced prefixes
5-41
Configuration Guide Configuring BGP
Nexthop: 10.1.1.3
Nexthop global: ::
Nexthop local: ::
Neighbor capabilities:
0 accepted prefixes
5-42
Configuration Guide Configuring BGP
0 announced prefixes
Nexthop: 10.1.1.3
Nexthop global: ::
Nexthop local: ::
Neighbor capabilities:
5-43
Configuration Guide Configuring BGP
0 accepted prefixes
0 announced prefixes
Nexthop: 192.168.3.3
Nexthop global: ::
Nexthop local: ::
D
D# show ip bgp neighbor
Neighbor capabilities:
5-44
Configuration Guide Configuring BGP
0 accepted prefixes
0 announced prefixes
Nexthop: 192.168.3.4
Nexthop global: ::
Nexthop local: ::
Common Errors
IGP is not enabled and the interconnection between the local loopback address and the loopback address on the IBGP
neighbor fails, which causes that the neighbor fails to be created.
ebgp-multihop is not configured when an EBGP is not directly connected, which causes that a TCP connection fails to
be created.
Configure MD5 for encrypted authentication between EBGP and IBGP neighbors.
Notes
If an IBGP neighbor is not directly connected, you need to configure IGP or a static routing protocol to implement
interconnection.
If an EBGP neighbor is not directly connected, you need to configure the ebgp-multihop parameter for the neighbor.
Configuration Steps
Enabling BGP
5-45
Configuration Guide Configuring BGP
Verification
Related Commands
Enabling BGP
Configuration Example
5-46
Configuration Guide Configuring BGP
Scenario
Figure 5-5
Configuration Enable BGP on all devices and set the AS numbers as shown in Figure 5-5.
Steps Configure a loopback interface on B and C and create an IBGP neighbor based on the loopback
interface.
Create an EBGP neighborship by using the directly connected interfaces on A and B.
Configure the passwords on A, B and C for their neighbors.
A
A# configure terminal
B
B# configure terminal
5-47
Configuration Guide Configuring BGP
C
C# configure terminal
Verification Run the show command to display the BGP neighbor status.
A
A#show ip bgp neighbors
Neighbor capabilities:
5-48
Configuration Guide Configuring BGP
0 accepted prefixes
0 announced prefixes
Nexthop: 192.168.1.1
Nexthop global: ::
Nexthop local: ::
B
B# show ip bgp neighbors
Neighbor capabilities:
5-49
Configuration Guide Configuring BGP
0 accepted prefixes
0 announced prefixes
Nexthop: 10.1.1.1
Nexthop global: ::
Nexthop local: ::
Neighbor capabilities:
5-50
Configuration Guide Configuring BGP
0 accepted prefixes
0 announced prefixes
Nexthop: 192.168.1.2
Nexthop global: ::
Nexthop local: ::
C
C# show ip bgp neighbors
Neighbor capabilities:
5-51
Configuration Guide Configuring BGP
0 accepted prefixes
0 announced prefixes
Nexthop: 10.1.1.2
Nexthop global: ::
Nexthop local: ::
Common Errors
The passwords for MD5 encrypted authentication at the two ends of a BGP neighborship are different.
Configure a route reflector in the IBGP environment to reduce the number of BGP neighbor connections.
Notes
5-52
Configuration Guide Configuring BGP
If an IBGP neighbor is not directly connected, you need to configure IGP or a static routing protocol to implement
interconnection.
Configuration Steps
Enabling BGP
Verification
Related Commands
Enabling BGP
5-53
Configuration Guide Configuring BGP
Configuration Example
Scenario
Figure 5-6
Configuration Enable BGP on all devices and set the AS numbers as shown in Figure 5-6.
Steps Configure a loopback interface on all devices and create an IBGP neighborship by using the loopback
interface according to the connection lines as shown in Figure 5-6.
Configure route reflection on the device RR and specify A, B, C and D as reflector clients.
A
A# configure terminal
B
B# configure terminal
5-54
Configuration Guide Configuring BGP
C
C# configure terminal
D
C# configure terminal
RR
RR# configure terminal
5-55
Configuration Guide Configuring BGP
Verification Run the show command to display the BGP neighbor status.
RR
RR# show ip bgp summary
5-56
Configuration Guide Configuring BGP
D
D# show ip bgp summary
D# show ip bgp
5-57
Configuration Guide Configuring BGP
Notes
It is advised to use private AS numbers for sub ASs (also called member ASs) within an alliance. Private AS numbers
range from 64,512 to 65,535.
Within a sub AS of an alliance, full mesh must be established for all BGP speakers (route reflectors can be further
configured within the sub AS).
All BGP speakers within an alliance must belong to a sub AS within the alliance.
Configuration Steps
Enabling BGP
5-58
Configuration Guide Configuring BGP
Perform this configuration in the BGP configuration mode. It is mandatory when an EBGP neighbor is not directly
connected.
(Optional) Perform this configuration in the BGP configuration mode. Perform this configuration when a local route
needs to be advertised. You can also configure an alternative network by means of re-distribution.
Verification
Run the show command to display the BGP routing table information.
Related Commands
Enabling BGP
5-59
Configuration Guide Configuring BGP
Configuration Example
Scenario
Figure 5-7
Configuration Configure BGP on A and B, set the AS number to 65,536 and configure an IBGP neighborship.
5-60
Configuration Guide Configuring BGP
Steps Configure BGP on C and D, set the AS number to 65,537 and configure an IBGP neighborship.
Configure BGP on ASBR1 and E, set the AS number to 65,538 and configure an IBGP neighborship.
Configure an alliance ID 100 on A, B, C, D, E and ASBR1.
Configure the alliance member 65,537 on A, configure C as an EBGP neighbor, and set the peer AS
number to 65,537.
Configure the alliance members 65,536 and 65,538 on C, configure A as an EBGP neighbor and set
the peer AS number to 65,536, configure ASBR1 as an EBGP neighbor and set the peer AS number to
65,538.
Configure the alliance members 65,537 on ASBR1, configure C as an EBGP neighbor and set the peer
AS number to 65,537, configure ASBR2 as an EBGP neighbor and set the peer AS number to 200.
Configure BGP on ASBR2 and set the AS number to 200; configure ASBR1 as an EBGP neighbor and
set the peer AS number to 100.
A
A# configure terminal
B
B# configure terminal
5-61
Configuration Guide Configuring BGP
C
C# configure terminal
5-62
Configuration Guide Configuring BGP
D
D# configure terminal
E
E# configure terminal
ASBR1
ASBR1# configure terminal
5-63
Configuration Guide Configuring BGP
ASBR2
ASBR2# configure terminal
5-64
Configuration Guide Configuring BGP
A# show ip bgp
ASBR1
A# show ip bgp summary
A# show ip bgp
5-65
Configuration Guide Configuring BGP
ASBR2
A# show ip bgp summary
A# show ip bgp
Common Errors
5-66
Configuration Guide Configuring BGP
Notes
Routes learned from an IBGP neighbor must have the same priority (the router-ID does not need to be compared).
Configuration Steps
Enabling BGP
(Optional) Perform this configuration in the BGP configuration mode. Perform this configuration when load balancing
needs to be implemented for routes learned from different ASs.
Verification
Run the show command to display the core routing table information.
Related Commands
Enabling BGP
5-67
Configuration Guide Configuring BGP
Description peer-group-name: Specifies the name of a peer group, consisting of no more than 32 characters.
as-number: Indicates the AS number of a BGP peer (group).
Command BGP configuration mode
Mode
Usage Guide The AS specified for a peer (group) must be the same as the BGP AS number of a BGP speaker at the peer
end.
Configuration Example
5-68
Configuration Guide Configuring BGP
Scenario
Figure 5-8
Configuration Enable BGP on all devices and set the AS numbers as shown in Figure 5-8.
Steps Establish IBGP neighborships between A and B and between A and C by using directly connected
interfaces.
Establish EBGP neighborships between B and D and between C and E by using directly connected
interfaces.
Re-distribute the same routes to D and E.
Configure IBGP load balancing on A and enable the AS-PATH loose comparison mode.
A
A# conf terminal
5-69
Configuration Guide Configuring BGP
B
B# conf terminal
C
C# conf terminal
D
D# conf terminal
5-70
Configuration Guide Configuring BGP
E
E# conf terminal
A# show ip bgp
S Stale
5-71
Configuration Guide Configuring BGP
65532
65531
A# show ip route
5-72
Configuration Guide Configuring BGP
Common Errors
The priorities of multi-hop BGP routes are different, which causes load balancing failure.
Notes
(Optional) Configure a neighbor BFD session to implement fast link fault detection.
Configuration Steps
Enabling BGP
Verification
Related Commands
Enabling BGP
5-73
Configuration Guide Configuring BGP
Description mode.
Command Global configuration mode
Mode
Usage Guide -
Configuration Example
5-74
Configuration Guide Configuring BGP
Scenario
Figure 5-9
B
B# configure terminal
5-75
Configuration Guide Configuring BGP
C
C# configure terminal
5-76
Configuration Guide Configuring BGP
C# show ip bgp
* 192.168.1.1 0 0 100 ?
*b 192.168.1.1 0 0 100 ?
192.168.1.1
200
100
5-77
Configuration Guide Configuring BGP
C# show ip route
Common Errors
Notes
N/A
Configuration Steps
Enabling BGP
5-78
Configuration Guide Configuring BGP
Verification
Related Commands
Enabling BGP
5-79
Configuration Guide Configuring BGP
Mode
Usage Guide -
Configuration Example
Scenario
Figure 5-10
Configuration Create an EBGP neighborship with B on A and specify the Local-AS for the EBGP neighborship.
Steps Create an EBGP neighborship for connecting to A on B.
A
A# configure terminal
B
B# configure terminal
Verification Run the show command to display the BGP neighbor status.
A
A# show ip bgp neighbors 57.50.1.1
5-80
Configuration Guide Configuring BGP
BGP neighbor is 57.50.1.1, remote AS 5750, local AS 23(using Peer's Local AS, no-prepend, replace-as,
dual-as), external link
Notes
To successfully deploy the BGP GR function, you need to use a neighbor device as the GR Helper.
After BGP GR is enabled, you need to reset a BGP neighbor connection to make it take effect.
Configuration Steps
Enabling BGP
Configuring BGP GR
Perform this configuration in the BGP configuration mode, which is configured by default.
Verification
Related Commands
5-81
Configuration Guide Configuring BGP
Enabling BGP
Configuring BGP GR
5-82
Configuration Guide Configuring BGP
end.
Configuration Example
Configuring BGP GR
Scenario
Figure 5-11
Configuration Enable BGP on all devices and set the AS numbers as shown in Figure 5-11.
Steps Configure a loopback interface on R2, R3, and R4 and create an IBGP neighborship based on the
loopback interface.
Create an EBGP neighborship by using the directly connected interfaces on R1 and R2.
Enable BGP GR on R1, R2, R3, and R4.
R1
R1# configure terminal
R1(config-router)# exit
R2
R2# configure terminal
R2(config-router)# graceful-restart
R2(config-router)# exit
R3
R3# configure terminal
5-83
Configuration Guide Configuring BGP
R3(config-router)# graceful-restart
R3(config-router)# exit
R4
R4# configure terminal
R4(config-router)# graceful-restart
R4(config-router)# exit
Verification Run the show command to display the BGP neighbor status.
R2
R2# show ip ospf
SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
5-84
Configuration Guide Configuring BGP
Graceful-restart enabled
Area 0 (BACKBONE)
······
Neighbor capabilities:
None
······
Common Errors
Configure BGP IPv6 routes to implement IPv6 network access in different ASs.
Notes
Generally, BGP uses IPv6 addresses to create neighborships and implement exchange of IPv6 routes.
5-85
Configuration Guide Configuring BGP
In special scenarios (such as the 6PE function, see the MPLS-L3VPN-SCG.doc), BGP supports exchange of IPv6
routes on the neighbors with IPv4 addresses.
Configurations related to BGP IPv6 services must be configured in the BGP IPv6 address family mode.
Configuration Steps
Enabling BGP
Verification
Related Commands
Enabling BGP
5-86
Configuration Guide Configuring BGP
5-87
Configuration Guide Configuring BGP
Mode
Usage Guide -
Configuration Example
Scenario
Figure 5-1
Configuration Enable BGP on all devices and set the AS numbers as shown in Figure 5-1.
Steps Configure a BGP neighbor, disable the IPv4 address family capability for the neighbor and activate the
IPv6 address family capability.
Configure IPv6 route advertisement in BGP.
A
A# configure terminal
A(config-if-Loopback)# exit
A(config-router-af)# exit-address-family
5-88
Configuration Guide Configuring BGP
B
B# configure terminal
B(config-router-af)# exit-address-family
Verification Run the show command to display the BGP neighbor status.
A
A# show bgp ipv6 unicast summary
5-89
Configuration Guide Configuring BGP
Common Errors
The IPv6 address family capability is not activated for BGP neighbors.
In non-6PE scenarios, IPv4 addresses are used to establish IPv6 routes for exchange between neighbors.
Successfully interconnect devices supporting 4-byte AS numbers with devices supporting only 2-byte AS numbers.
Configuration Steps
Enabling BGP
(Optional) Perform this configuration in the BGP configuration mode. By default, a 4-byte AS number is displayed as
decimal digits.
Verification
Related Commands
Enabling BGP
5-90
Configuration Guide Configuring BGP
Configuration Example
Configuring Compatibility Between BGP Devices Supporting 4-Byte AS Numbers and 2-Byte AS Numbers
Scenario
Figure 5-2
Configuration Enable BGP on all devices and set the AS numbers as shown in Figure 5-2.
Steps Configure BGP neighborships.
A
A# configure terminal
B
B# configure terminal
5-91
Configuration Guide Configuring BGP
B(config-router)# end
C
C# configure terminal
Verification Run the show command to display the BGP neighbor status.
A
A# show ip bgp summary
B
B# show ip bgp summary
Common Errors
N/A
5-92
Configuration Guide Configuring BGP
Notes
Generally, global IPv4 addresses need to be used for establishing BGP neighborships.
Local IPv6 link addresses can be used for establishing only single-hop BGP neighborships.
When local IPv6 link addresses are used for establishing neighborships, using local IPv6 link addresses as information
sources must be specified on the peer end.
When local IPv6 link addresses are used for establishing neighborships, local IPv6 link addresses must be configured
on both ends.
Configuration Steps
Enabling BGP
Perform this configuration in the BGP configuration mode. If local IPv6 link addresses are configured for a neighbor, this
configuration is mandatory; otherwise, this configuration is optional.
Verification
5-93
Configuration Guide Configuring BGP
Related Commands
Enabling BGP
Parameter as-number: Indicates an AS number, ranging from 1 to 4,294,967,295, which is 1 to 65535.65535 in the dot
Description mode.
Usage Guide -
Parameter peer-address: Indicates the address of a peer, which is usually an IPv6 address.
Description
as-number: Indicates the AS number of a BGP peer (group).
Usage Guide The AS specified for a peer must be the same as the BGP AS number of a BGP speaker at the peer end.
Parameter peer-address: Indicates the address of a peer, which is usually an IPv6 address.
Description
interface-type interface-number: Indicates an interface name.
Usage Guide If the local IPv6 link address of a local interface is used when a BGP neighborship is established with a
neighbor device, this interface must be specified as the message source of the neighborship when the BGP
neighborship is configured on the local device.
Parameter -
5-94
Configuration Guide Configuring BGP
Description
Usage Guide -
Parameter peer-address: Indicates the address of a peer, which is usually an IPv6 address.
Description
Usage Guide Neighbors with IPv6 addresses are used to exchange IPv6 routes. However, when a neighbor is configured
in the BGP mode, BGP automatically activates the IPv4 unicast address family capability for the neighbor.
Therefore, you are advised to manually disable the IPv4 unicast address family capability.
Parameter -
Description
Usage Guide -
Parameter peer-address: Indicates the address of a peer, which is usually an IPv6 address.
Description
Usage Guide -
5-95
Configuration Guide Configuring BGP
map-tag: Indicates the name of a route map, consisting of no more than 32 characters.
Usage Guide -
Configuration Example
Using a Local IPv6 Link Address for Configuring a BGP Neighborship to Implement IPv6 Route Exchange in
Different ASs
Scenario
Figure 5-3
Configuration Enable BGP on all devices and set the AS numbers as shown in Figure 5-3.
Steps
Configure a BGP neighbor, specify the update-source, disable the IPv4 address family capability for
the neighbor and activate the IPv6 address family capability.
A A# configure terminal
A(config-if-Loopback)# exit
A(config-if-Loopback)# exit
5-96
Configuration Guide Configuring BGP
A(config-router-af)# exit-address-family
B B# configure terminal
A(config-if-Loopback)# exit
B(config-router-af)# exit-address-family
Verification Run the show command to display the BGP neighbor status.
5-97
Configuration Guide Configuring BGP
Common Errors
When a neighborship is configured, a local IPv6 link address is used to specify the neighborship; however, no update
source is specified as the interface for this local IPv6 link address during local configuration.
Only one end uses a local IPv6 link address for establishing a neighborship.
5.5 Monitoring
Clearing
Running the clear commands may lose vital information and thus interrupt services.
Description Command
Clears BGP IPv4 unicast routes. clear ip bgp [ vrf vrf-name ] { * | as-number | peer-address } [ soft ] [ in | out ]
clear bgp ipv4 unicast [ vrf vrf-name ] { * | as-number | peer-address } [ soft ] [ in |
out ]
Clears BGP IPv6 unicast routes. clear bgp ipv6 unicast [ vrf vrf-name ] { * | as-number | peer-address } [ soft ] [ in |
out ]
Displaying
Description Command
Displays BGP IPv4 unicast routes. show ip bgp
show bgp ipv4 unicast
Displays BGP IPv6 unicast routes. show bgp ipv6 unicast
5-98
Configuration Guide Configuring BGP
Debugging
System resources are occupied when debugging information is output. Therefore, disable debugging immediately after
use.
Description Command
Enables all BGP debugging. debug ip bgp all
Debugs BGP route flapping. debug ip bgp dampening
Debugs BGP event processing. debug ip bgp event
Debugs BGP route filtering. debug ip bgp filter
Debugs BGP status machine. debug ip bgp fsm
Debugs BGP neighbor keepalive. debug ip bgp keepalives
Debugs BGP MPLS processing. debug ip bgp mpls
Debugs BGP core route processing. debug ip bgp nsm
Debugs BGP UPDATE packets. debug ip bgp update
5-99
Configuration Guide Configuring PBR
6 Configuring PBR
6.1 Overview
Policy-based routing (PBR) is implemented by applying a route map including policies to interfaces and devices.
Similar to static routing, PBR is also manually configured and cannot automatically update with network changes. In addition,
PBR is effective only for packets sent from local interfaces and devices. As compared with static and dynamic routing, PBR is
more flexible. Static and dynamic routing can forward packets only based on destination addresses. PBR can forward
packets based on source and destination addresses, packet length and input interface.
6.2 Applications
Application Description
Selecting an ISP by Using PBR Specify preferential output interfaces for packets from different subnets.
Implementing Traffic Classification by Specify QoS values for packets from different subnets.
Using PBR
Scenario
6-1
Configuration Guide Configuring PBR
Figure 6-1
A LAN has two output interfaces for connecting the Internet. PBR is configured on the layer-3 device DEV1 to enable the two
output interfaces to implement load sharing and mutual backup.
If the GE 0/1 link is disconnected, the data streams on GE 0/1 are switched to GE 0/2. Vice versa.
Deployment
Configure two policies in the route map on the layer-3 device DEV1:
Policy 1: sets the next hops for packets matching ACL1 to GE0/1 and GE0/2 (Based on the configuration sequence,
GE0/1 takes effect first and GE0/2 works in the backup mode).
Policy 2: sets the next hops for packets matching ACL2 to GE0/2 and GE0/1 (Based on the configuration sequence,
GE0/2 takes effect first and GE0/1 works in the backup mode).
Configure PBR on GE0/3 (by using a route map). Then, packets received on this interface are forwarded based on the
policies.
Networks of medium- and small-sized enterprises have simple structures. Different branch nodes are interconnected to the
central nodes through carrier dedicated lines or the Internet VPN mode. Enterprise networks often need to implement
6-2
Configuration Guide Configuring PBR
three-in-on integration (of audio, video and data) to maximize the utilization of existing IP networks and save costs. Since all
traffic is output from a single output interface, it is necessary to adjust the QoS policies for the output interface, in order to
provide preferential communication quality for bandwidth- and delay-sensitive applications.
Figure 6-2
A LAN has an output interface for connecting the Internet. PBR is configured on the layer-3 device DEV1 to change the QoS
values for packets from different networks.
For data streams from subnet 1, representing audio streams, set the DSCP value to 56.
For data streams from subnet 2, representing video streams, set the DSCP value to 40.
For data streams from subnet 3, representing data streams, set the DSCP value to 24.
Deployment
Configure three policies in the route map on the layer-3 device DEV1:
Policy 1: sets the DSCP value for packets matching ACL1 to 56.
Policy 2: sets the DSCP value for packets matching ACL2 to 40.
Policy 3: sets the DSCP value for packets matching ACL3 to 24.
Configure PBR on GE0/3 (by using a route map). Then, the DSCP values for packets received on this interface are
changed based on the policies.
6-3
Configuration Guide Configuring PBR
6.3 Features
Feature Description
Configuring a Policy Before configuring PBR, configure policies in a route map.
Configuring PBR Apply a route map including policies to interfaces and devices to implement PBR.
For detailed introduction to the policies, see the section "Route Map".
Executing Policies
In the global configuration mode, you can run the route-map route-map-name [ permit | deny ] [ sequence-number ]
command to create a policy in a route map.
A route map may contain multiple policies. Each policy has a corresponding sequence number. A smaller sequence number
means a higher priority. Policies are executed based on their sequence numbers. Once the matching condition of a policy is
met, the processing action for this policy needs to be executed and the route map exits. If no matching condition of any policy
is met, no processing action will be performed.
permit: When the matching condition of a policy is met, perform the processing action for this policy and exit the route
map.
deny: When the matching condition of a policy is met, do not perform the processing action for this policy and exit the
route map.
Matching conditions of
policies
If one or more match rules are contained, all match rules must be matched at the same time to meet the matching
conditions of the policy.
In the route map mode, run the match command to configure match rules. One match command is mapped to one match
rule.
Command Description
6-4
Configuration Guide Configuring PBR
IPv4 match ip address The source IPv4 address (and the destination IPv4 address) is used as the
PBR matching condition.
IPv6 match ipv6 address The source IPv6 address (and the destination IPv6 address) is used as the
PBR matching condition.
IPv4 PBR defines the source IP address (and destination IP address) ranges of packets by using the IP standard or
extended ACLs. IPv6 PBR defines the source IPv6 address (and destination IPv6 address) ranges of packets by using
the IPv6 extended ACLs.
On a switch, packet forwarding based on policies of IPv4 PBR interfaces supports expert-level and MAC name ACLs.
Packet forwarding based on local policies does not support expert-level and MAC name ACLs.
When PBR uses an ACL that is unavailable, the route sub-map will not be matched and the next route sub-map will be
matched instead. If no route sub-map is matched, a common route will be selected for forwarding. If only ACLs are
configured but no ACE is configured, the PBR forwarding behavior is the same as that in a scenario where an ACL is
unavailable.
On a non-switch device, packet forwarding based on policies of IPv4 PBR interfaces and local policies do not support
expert-level and MAC name ACLs.
On a switch, if a route sub-map uses multiple ACLs in PBR, only the first ACL is matched.
If 0 set rule is contained, no processing action will be performed and the route map will directly exit.
If one or more set rules are contained, all processing actions will be performed and the route map will exit.
If set rules have different priorities, the set rule with the highest priority will take effect.
In the route map mode, run the set command to configure set rules. One set command is mapped to one set rule.
Command Description
IPv4 set ip tos Modifies the tos field of an IPv4 packet.
PBR
This command cannot work with the set ip dscp command.
6-5
Configuration Guide Configuring PBR
Command Description
set ip dscp Modifies the dscp field of an IPv4 packet.
This command cannot work with the set ip tos and set ip precedence
commands.
set ip next-hop Configures the next hop of IPv4 packet forwarding. The next hop must be
directly connected; otherwise, this command is invalid.
A packet matching the match rules will be forwarded to the next hop
specified by set ip next-hop first, no matter whether the route selected for
the packet in the routing table is consistent with the next hop specified by
PBR.
set ip default next-hop Configures the default next hop of IPv4 packet forwarding.
A packet matching the match rules will be forwarded to the default next hop
specified by this command if a route fails to be selected or the default route is
selected for this packet in the routing table.
IPv6 set ipv6 precedence Modifies the precedence field of an IPv6 packet.
PBR
IPv6 PBR does not support set ipv6 tos or set ipv6 dscp.
set ipv6 next-hop Configures the next hop of IPv6 packet forwarding.
An IPv6 packet matching the match rules will be forwarded to the next hop
specified by set ipv6 next-hop first, no matter whether the route selected for
the IPv6 packet in the routing table is consistent with the next hop specified
by PBR.
The next hop must be directly connected; otherwise, this command is invalid.
set ipv6 default next-hop Configures the default next hop of IPv6 packet forwarding.
An IPv6 packet matching the match rules will be forwarded to the default
next hop specified by this command if a route fails to be selected or the
default route is selected for this packet in the routing table.
The next hop must be directly connected; otherwise, this command is invalid.
The priority sequence is as follows: set ip next-hop > common route > set ip default next-hop > default route. The
preceding set commands can be configured at the same time but only the command with the highest priority takes
effect.
The priority sequence is as follows: set ipv6 next-hop > common route > set ipv6 default next-hop > default route.
The preceding set commands can be configured at the same time but only the command with the highest priority takes
effect.
For switches, the set ipv6 default next-hop command does not take effect for IPv6 addresses whose mask length
exceeds 64.
6-6
Configuration Guide Configuring PBR
Apply a route map to an interface so that packets received by the interface are routed based on the policy.
The PBR is often used to control user packets received by a device. This command is effective only for forwarded
packets, but not for locally initiated packets.
Apply a route map to a device so that packets locally initiated are routed based on the policy.
The PBR is often used to control protocol packets exchanged between devices (such as ping packets sent locally). This
command is effective only for locally initiated packets, but not for forwarded packets.
By default, PBR is not unavailable on a device and packets are forwarded based on a routing table.
On a switch, the interfaces which support PBR are L3 Ethernet interface, SVI interface and L3 AP interface.
Redundant backup or
load balancing
You can set multiple next hops in a policy. Either redundant backup or load balancing can be implemented among multiple
next hops. Redundant backup is implemented by default.
Redundant backup or load balancing is only effective for next hops configured in the set ip next-hop, set ip default
next-hop, set ipv6 next-hop and set ipv6 default next-hop commands, and only effective among multiple next hops
in the same set rule.
Redundant backup
Based on the configuration sequence, the first accessible next hop takes effect. When the currently effective next hop
(R1) is faulty, the traffic automatically switches to the next accessible next hop (R2). When R1 becomes accessible
again, the traffic automatically switches back to R1.
A newly added next hop is arranged at the last of the sequence. Assume that the original sequence of multiple next
hops is R1 > R2 > R3. After R1 is deleted and added again, the sequence changes to R2 > R3 > R1.
If no next hop is accessible, packets will be discarded.
Load balancing
When multiple accessible next hops take effect at the same time, the Weighted Cost Multiple Path (WCMP) and Equal
Cost Multiple Path (ECMP) are supported. After an accessible next hop loses effect, traffic will be balanced among the
other accessible next hops.
Correlation between PBR and BFD is effective only for next hops configured by the set ip next-hop or set ipv6 next-hop
command.
The set ip next-hop and set ipv6 next-hop commands carry the verify-availability and bfd [ vrf vrf-name ] interface-type
interface-number gateway parameters, which can establish correlation between PBR and a BFD session and monitor the
accessibility of next hops.
6-7
Configuration Guide Configuring PBR
Correlation between PBR and BFD helps enhance the PBR's perception about network environment changes. When BFD
detects that the current next hop is not accessible, the BFD will immediately notify the PBR to switch the traffic to another
accessible next hop (to implement redundant backup) or all the other accessible next hops (to implement load balancing).
For the configuration and related commands for correlation between PBR and BFD, see the "BFD" section.
Correlation between PBR and Track is effective only for next hops configured by the set ip next-hop command.
The set ip next-hop command carries the verify-availability and track track-obj-number parameters, which can establish
correlation between PBR and a Track session and monitor the accessibility of next hops.
Correlation between PBR and Track helps enhance the PBR's perception about network environment changes. When Track
detects that the current next hop is not accessible, the Track will immediately notify the PBR to switch the traffic to another
accessible next hop (to implement redundant backup) or all the other accessible next hops (to implement load balancing).
For the configuration and related commands for correlation between PBR and Track, see the "RNS" section.
6.4 Configuration
6-8
Configuration Guide Configuring PBR
Perform personalized routing management for user data streams by preparing flexible policies.
Perform personalized management for protocol interaction and network topologies by preparing flexible policies.
Notes
A route map must be used when PBR is configured; therefore, you must configure a route map on a device.
If an ACL is used when the route map is configured, you must configure the ACL on the device.
Configuration Steps
To perform personalized routing management for IPv4 user data streams passing a device, you should perform this
configuration.
Perform this configuration on the input interface for user data streams.
Run the ip policy route-map command to apply a route map to an interface. Then, PBR is executed for IPv4 packets
received on this interface.
To perform personalized routing management for IPv6 user data streams passing a device, you should perform this
configuration.
Perform this configuration on the input interface for user data streams.
Run the ipv6 policy route-map command to apply a route map to an interface. Then, PBR is executed for IPv6 packets
received on this interface.
6-9
Configuration Guide Configuring PBR
To perform personalized management for IPv4 protocol interaction and IPv4 network topologies, you should perform
this configuration.
Run the ip local policy route-map command to apply a route map to a device. Then, PBR is executed for IPv4 packets
locally initiated.
To perform personalized management for IPv6 protocol interaction and IPv6 network topologies, you should perform
this configuration.
Run the ipv6 local policy route-map command to apply a route map to a device. Then, PBR is executed for IPv6
packets locally initiated.
Verification
6-10
Configuration Guide Configuring PBR
If an ACL is used when the route map is configured, you should check the configurations of the ACL.
local RM_for_PBR_1
Local indicates applying policy-based routing for IPv4 packets locally initiated.
local RM_for_PBR_1
VLAN 1 RM_for_PBR_2
Local indicates applying policy-based routing for IPv6 packets locally initiated.
6-11
Configuration Guide Configuring PBR
Match clauses:
ip address acl1
Set clauses:
ip next-hop 200.24.18.1
Match clauses:
ip address acl2
Set clauses:
ip next-hop 200.24.19.1
ip access-list standard 1
ip access-list standard 2
6-12
Configuration Guide Configuring PBR
Usage Guide Specify a local interface or device and check the routing information of IPv4 PBR.
Sequence : 10
VRF ID : 0
Route Flags :
Direct : Permit
Priority : High
Tos_Dscp : None
Precedence : None
Tos_Dscp : 0
Precedence : 0
Mode : redundance
Nexthop Count : 1
Nexthop[0] : 192.168.8.100
Weight[0] : 1
Ifindex[0] : 2
Sequence : 10
6-13
Configuration Guide Configuring PBR
ACL[0] : 2900
ACL_CLS[0] : 5
VRF ID : 0
Route Flags :
Direct : Permit
Priority : High
Tos_Dscp : None
Precedence : None
Tos_Dscp : 0
Precedence : 0
Mode : redundance
Nexthop Count : 1
Nexthop[0] : 10::2
Weight[0] : 1
Ifindex[0] : 2
Forwarding: On
Route-map rm
6-14
Configuration Guide Configuring PBR
Match rule:
Set rule:
Forwarding: On
Route-map rm6
Match rule:
Set rule:
6-15
Configuration Guide Configuring PBR
gigabitEthernet 0/1
statistics : 10
gigabitEthernet 0/1
statistics : 20
Scenario
Figure 6-3
The layer-3 device DEV 1 is connected to subnet 1 and subnet 2 through GE0/3. The network segment
where subnet 1 resides is 200.24.16.0/24 whereas the network segment where subnet 2 resides is
200.24.17.0/24.
DEV 1 is connected to the Internet through GE0/1 and GE0/2 and their next hops are 200.24.18.1 and
200.24.19.1.
DEV1 can fast detect a faulty output link and switch to a backup link.
Configuration When configuring IPv4 PBR and selecting an output link based on source addresses of the packets, add or
Steps modify the following configurations (red fields):
Set two Track objects and track the accessibility of the next hops of the two output interfaces.
6-16
Configuration Guide Configuring PBR
When configuring a policy, set the correlation between the next hops and the Track objects.
DEV1
DEV1(config)# ip access-list extended 101
DEV1(config-ip-acl)# exit
DEV1(config-ip-acl)# exit
DEV1(config)#ip rns 1
DEV1(config-ip-rns)#icmp-echo 200.24.18.1
DEV1(config)#track 1 rns 1
DEV1(config)#ip rns 2
DEV1(config-ip-rns)#icmp-echo 200.24.19.1
DEV1(config)#track 2 rns 2
DEV1(config-route-map)# exit
DEV1(config-route-map)# exit
6-17
Configuration Guide Configuring PBR
Track 1
The state is Up
Track 2
The state is Up
Common Errors
A route map is used when PBR is configured but the route map does not exist.
An ACL is used when a route map is configured but the ACL does not exist.
Using multiple next hops in the mutual backup mode can enhance the network reliability.
Implementing load balancing among multiple next hops can expand the network bandwidth.
Notes
Redundant backup and load balancing are effective only for the next hops set by the following set commands.
Command Description
set ip next-hop Configures the next hop of IPv4 packets. This command carries the weight parameter, which
is used to set the weight of the WCMP. The default value is 1.
set ip default next-hop Configures the default next hop of IPv4 packets. This command carries the weight parameter,
which is used to set the weight of the WCMP. The default value is 1.
set ipv6 next-hop Configures the next hop of IPv6 packets. This command carries the weight parameter, which
is used to set the weight of the WCMP. The default value is 1.
set ipv6 default next-hop Configures the default next hop of IPv6 packets. This command carries the weight parameter,
which is used to set the weight of the WCMP. The default value is 1.
Up to eight next hops can be set for WCMP whereas up to 32 next hops can be set for ECMP.
Configuration Steps
6-18
Configuration Guide Configuring PBR
Setting whether IPv4 PBR implements redundant backup or load balancing among multiple next hops
If load balancing needs to be implemented among multiple next hops, this configuration needs to be performed.
If load balancing is configured at present, you also need to perform this configuration to reset redundant backup.
Setting whether Ipv6 PBR implements redundant backup or load balancing among multiple next hops
If load balancing needs to be implemented among multiple next hops, this configuration needs to be performed.
If load balancing is configured at present, you also need to perform this configuration to reset redundant backup.
Verification
Check whether redundant backup or load balancing is implemented among multiple next hops.
Checking whether IPv4 PBR implements redundant backup or load balancing among multiple next hops
6-19
Configuration Guide Configuring PBR
local test
Checking whether IPv6 PBR implements redundant backup or load balancing among multiple next hops
VLAN 1 RM_for_Vlan_1
VLAN 2 RM_for_Vlan_2
Configuration Example
Configuring IPv4 PBR to implement redundant backup among multiple next hops
See the preceding example: Configuring IPv4 PBR and selecting an output link based on source addresses of packets
Configuring IPv6 PBR to implement redundant backup among multiple next hops
See the preceding example: Configuring IPv6 PBR and selecting an output link based on source addresses of packets
Configuring IPv4 PBR to implement load balancing among multiple next hops
Scenario
Figure 6-4
6-20
Configuration Guide Configuring PBR
The layer-3 device DEV 1 is connected to subnet 1 and subnet 2 through GE0/3. The network segment
where subnet 1 resides is 200.24.16.0/24 whereas the network segment where subnet 2 resides is
200.24.17.0/24.
DEV 1 is connected to the Internet through GE0/1 and GE0/2 and their next hops are 200.24.18.1 and
200.24.19.1.
This LAN has two output interfaces for connecting the Internet. The requirements are as follows: The traffic
is equally shared by GE0/1 and GE0/2.
DEV1(config-route-map)# exit
Match clauses:
Set clauses:
ip next-hop 200.24.18.1 8
ip next-hop 200.24.19.1 8
Configuring IPv6 PBR to implement load balancing among multiple next hops
6-21
Configuration Guide Configuring PBR
Scenario
Figure 6-5
DEV 1 is connected to subnet 1 and subnet 2 through GE0/3. The network segment where subnet 1 resides
is 2003::/64 whereas the network segment where subnet 2 resides is 2004::/64.
DEV1 is connected to the Internet through GE0/1 and GE0/2 and their next hops are 2001::1/64 and
2002::1/64.
This LAN has two output interfaces for connecting the Internet. The requirements are as follows: The traffic
is equally shared by GE0/1 and GE0/2.
DEV1(config-route-map)# exit
6-22
Configuration Guide Configuring PBR
Match clauses:
Set clauses:
6.5 Monitoring
Clearing
Running the clear commands may lose vital information and thus interrupt services.
Description Command
Clears the statistics about packets forwarded clear ip pbr statistics [ interface if-name | local ]
by IPv4 PBR.
Clears the statistics about packets forwarded clear ipv6 pbr statistics [ interface if-name | local ]
by IPv6 PBR.
Displaying
Description Command
Displays the configurations of IPv4 PBR. show ip policy
Displays the configurations of IPv6 PBR. show ipv6 policy
Displays the configurations of a route map. show route-map [ name ]
Displays the configurations of an ACL. show access-list
Displays the correlation between IPv4 PBR
show ip pbr bfd
and BFD.
Displays the correlation between IPv6 PBR
show ipv6 pbr bfd
and BFD.
Displays the routing information of IPv4 PBR. show ip pbr route [ interface if-name | local ]
Displays the routing information of IPv6 PBR. show ipv6 pbr route [ interface if-name | local ]
Displays a route map used by IPv4 PBR. show ip pbr route-map rmap-name
Displays a route map used by IPv6 PBR. show ipv6 pbr route-map rmap-name
Displays the routing information of IPv6
show ipv6 pbr source-route [ interface if-name ]
source-address-based PBR.
Displays the statistics about IPv4 PBR. show ip pbr statistics [ interface if-name | local ]
Displays the statistics about IPv6 PBR. show ipv6 pbr statistics [ interface if-name | local ]
Debugging
6-23
Configuration Guide Configuring PBR
System resources are occupied when debugging information is output. Therefore, disable debugging immediately after
use.
Description Command
Debugs PBR errors. debug pbr error
Debugs PBR events. debug pbr events
Debugs multiple service cards supported by
debug pbr ms
PBR.
Debugs PBR message communication. debug pbr msg
Debugs interaction between PBR and NSM. debug pbr nsm
Debugs packet forwarding of PBR. debug pbr packet
Debugs PBR GR. debug pbr restart
6-24
Configuration Guide Configuring VRF
7 Configuring VRF
7.1 Overview
A Virtual Private Network (VPN) Routing and Forwarding (VRF) table is used for the forwarding of VPN packets. Each VPN
corresponds to a VRF table.
A device that provides the VPN service has multiple routing tales, including a public network routing table and one or multiple
VRF tables. The public-network routing table is used for the forwarding of public network packets, and the VRF tables are
used for the forwarding of VPN packets. These routing tables are created to separate routes in the public network from those
in VPNs and separate routes in different VPNs.
A VPN is a private dedicated network built in the public network. "Virtual" means that the VPN is logically exclusive,
instead of physically exclusive.
7.2 Applications
Application Description
Local Inter-VPN Access Provide the VPN service on a routing device and enable VPNs to access each other.
VRF only on Provider Edges (PEs) Provide the VPN service in an IP/Multiprotocol Label Switching (MPLS) network and
connect one Customer Edge (CE) to one VPN.
VRF on CEs and PEs Provide the VPN service in an IP/ MPLS network and connect one CE to multiple
VPNs.
Provide the VPN service on a routing device and enable VPNs to access each other.
In Figure 7-1, Sub a runs the Routing Information Protocol (RIP), Sub b runs the Open Shortest Path First (OSPF) protocol,
and Servers is a network segment directly connected to C. Provide the VPN service on C to Sub a, Sub b, and Servers, and
enable Sub a and Sub b to access Servers.
7-1
Configuration Guide Configuring VRF
Figure 7-1
Related Configuration
On C, create a VRF table for Sub a, bind the interface directly connected to A, and associate the VRF table with A by
using RIP.
On C, create a VRF table for Sub b, bind the interface directly connected to B, and associate the VRF table with B by
using OSPF.
On C, create a VRF table for Servers and bind the interface directly connected to Servers.
On C, configure the route targets (RTs) of the VRF tables for Suba, Subb, and Servers. Import the routes in the VRF
tables for Sub a and Sub b to the VRF table for Servers, and import the routes in the VRF table for Servers to the VRF
tables for Sub a and Sub b.
Configure the Border Gateway Protocol (BGP) on C. Introduce the RIP routes to the VRF table for Sub a, introduce the
OSPF routes to the VRF table for Sub b, and introduce the direct routes to the VRF table for Servers.
An Internet Service Provider (ISP) provides the VPN service in an IP/MPLS backbone network.
One CE is connected to one VPN, and all routes on the CE are exclusively used by the connected VPN. Therefore, no
VRF table needs to be created to separate the routes.
On each PE, VRF tables must be created to separate the routes in VPN1, those in VPN2, and those in the public
network from each other.
Figure7-2
7-2
Configuration Guide Configuring VRF
Deployment
On PE1, create a VRF table for VPN1 and bind the interface directly connected to CE1. On PE2, create a VRF table for
VPN1 and bind the interface directly connected to CE3.
On PE1, create a VRF table for VPN2 and bind the interface directly connected to CE2. On PE2, create a VRF table for
VPN2 and bind the interface directly connected to CE4.
On PE1, associate the VRF table for VPN1 with CE1 by using RIP. On PE2, associate the VRF table for VPN1 with CE3
by using RIP.
On PE1, associate the VRF table for VPN2 with CE2 by using OSPF. On PE2, associate the VRF table for VPN2 with
CE4 by using OSPF.
Create a BGP neighbor (VPNv4 address family) between PE1 and PE2.
In the VRF instance for VPN1 on PE1, redistribute RIP routes to BGP, and redistribute BGP routes to RIP. The
configuration on PE2 is similar.
In the VRF instance for VPN2 on PE1, redistribute OSPF routes to BGP, and redistribute BGP routes to OSPF. The
configuration on PE2 is similar.
For details about the application scenario, see "Configuration Guide > MPLS > L3 VPN".
In Figure 7-3, VPN a runs RIP, VPN b runs OSPF, and PE1 and PE2 are connected to BGP/MPLS VPNs.
One Multi-VPN-Instance CE (MCE) is connected to multiple VPNs. VRF tables must be created to separate the routes
in VPN a from those in VPN b.
On each PE, VRF tables must be created to separate the routes in VPN a, those in VPN b, and those in the public
network from each other.
Figure 7-3
Deployment
One MCE1, create VRF tables for VPN a and VPN b respectively, bind the interfaces directly connected to VPN a and
VPN b, and bind the VLAN interface connected to PE1. The configuration on MCE2 is similar.
7-3
Configuration Guide Configuring VRF
On PE1, create VRF tables for VPN a and VPN b respectively, and bind the VLAN interface connected to MCE1. The
configuration on PE2 is similar.
On MCE1, associate the VRF table for VPN a with VPN a by using RIP. The configuration on MCE2 is similar.
On MCE1, associate the VRF table for VPN b with VPN b by using OSPF. The configuration on MCE2 is similar.
Create a BGP neighbor (VPNv4 address family) between PE1 and PE2.
In the VRF instance for VPN a on MCE1, redistribute RIP routes to BGP, and redistribute BGP routes to RIP. The
configuration on MCE2 is similar.
In the VRF instance for VPN b on MCE1, redistribute OSPF routes to BGP, and redistribute BGP routes to OSPF. The
configuration on MCE2 is similar.
For details about the application scenario, see "Configuration Guide > MPLS > L3 VPN".
7.3 Features
Overview
Feature Description
VPN Instance A VPN instance is used to provide the VPN service. It is typically represented by a VRF table.
VPN Route A VPN route is used to forward VPN packets.
VPN Route Attribute Route distinguisher (RD): Identifies the VPN to which a route belongs.
RT: Indicates the route trade-off mode of VRF.
Working Principle
A PE exchanges routes with a CE by using the related routing protocol in the corresponding VPN instance. A VRF table is
bound to a specific interface to generate its interface set. Packets received on these interfaces will be associated with the
VRF table and forwarded along corresponding routes.
Related Configuration
Single-protocol VRF tables and multiprotocol VRF tables cannot be created at the same time. Single-protocol VRF
tables only support IPv4, whereas multiprotocol VRF tables support IPv4 and IPv6.
7-4
Configuration Guide Configuring VRF
Run the address-family ipv4 command to enable the IPv4 address family.
Run the address-family ipv6 command to enable the IPv6 address family.
Direct route and host route on the configured import interface (not bound)
Static and dynamic routes (RIP, RIPng, OSPFv2, OSPFv3, ISIS, and BGP) in the configured VPN instance
For details about the static routes in a VPN instance, see "Configuration Guide > IP Route".
For details about RIP in a VPN instance, see "Configuration Guide > IP Route > RIP".
For details about RIPng in a VPN instance, see "Configuration Guide > IP Route > RIPng".
For details about OSPFv2 in a VPN instance, see "Configuration Guide > IP Route > OSPFv2".
For details about OSPFv3 in a VPN instance, see "Configuration Guide > IP Route > OSPFv3".
For details about ISIS in a VPN instance, see "Configuration Guide > IP Route > ISIS".
For details about BGP in a VPN instance, see "Configuration Guide > IP Route > BGP".
Working Principle
RD
Two routes with the same address but different RDs in two VRF tables can be advertised separately between PEs, because
the routes are sent together with their RDs through multiprotocol BGP (MP-BGP).
RT
RT in essence indicates each VRF table's route trade-off and preferences. It is mainly used to control the advertising and
installation policies for VPN routes. RT is divided into the import attribute and export attribute. The import attribute indicates
7-5
Configuration Guide Configuring VRF
the route of interest, and the export attribute indicates the advertised route. A PE advertises a route to other PEs based on
the RT export rule in the corresponding VRF table. The peer PE checks all received routes against the RT import rule in each
VRF table. If a route matches an RT export rule (the export rule contains the import rule), it will be added to the
corresponding VRF table.
Related Configuration
RD
RT
7.4 Configuration
Single-protocol VRF tables and multiprotocol VRF tables cannot be created at the same
time. If IPv6 is supported, configure a multiprotocol VRF table; otherwise, you can
configure a single-protocol VRF table or a multiprotocol VRF table. This configuration
item creates a VRF table in an IPv4 network. IPv6 is not supported.
Single-protocol VRF tables and multiprotocol VRF tables cannot be created at the same
time. If IPv6 is supported, configure a multiprotocol VRF table. otherwise, you can
configure a single-protocol VRF table or a multiprotocol VRF table. This configuration
Configuring a Multiprotocol item creates a VRF table in an IPv4 or IPv6 network.
VRF Table
vrf definition vrf-name Creates a VRF table.
description string Configures a VRF descriptor.
rd rd_value Configures an RD.
route-target { import | export | both } rt_value Configures an RT.
7-6
Configuration Guide Configuring VRF
With BGP assistance, flexibly control the separation and access between VPNs.
With BGP assistance, provide the VPN service in an IP/MPLS backbone network.
Notes
No VRF table needs to be created if the device only forwards packets from one VPN or from the public network.
If the device needs to forward public network packets and VPN packets or forward packets from multiple VPNs, VRF
tables must be created to separate routes.
In many cases, static or dynamic routes (RIP, OSPF, ISIS, and BGP) need to be added to VRF tables.
Configuration Steps
Mandatory.
Configuring an RD
Optional.
When routing information needs to be advertised through BGP in the backbone network, BGP may select the best route
for advertising if overlapping network addresses exist in different VPNs, which will make some VPNs fail to obtain
corresponding routing information. To solve this problem, you can configure RDs for routes to enable BGP to make
routing decisions based on these RDs, thus ensuring that each VPN can obtain corresponding routing information.
Configuring an RT
7-7
Configuration Guide Configuring VRF
Optional.
You can run the route-target export command to specify the attributes of the route to be advertised, and run the
route-target import command to specify the attributes of the route to be received. You can also run the route-target
both command to specify the export and import attributes.
Binding an Interface and Adding the Direct Route and Host Route on the Interface to a VRF Table
Mandatory.
If the physical link for transmitting VPN packets is exclusively occupied by a VPN, bind the physical interface to the
corresponding VRF table.
If the physical link for transmitting VPN packets is shared by multiple VPNs, you need to create an independent logical
link for each VPN, and bind the logical interface to the corresponding VRF table. A logical interface can be a
subinterface or a VLAN interface.
You must bind an interface to the corresponding single-protocol VRF table before you configure the IPv4 address of the
interface. If you bind the interface after its IPv4 address is configured, the IPv4 address will be invalid (the IPv6 address
of the interface is retained).
If you bind an interface to the corresponding single-protocol VRF table and enable IPv6 on the interface, the device
cannot forward the IPv6 packets received on the interface.
Adding the Direct Route and Host Route on an Interface to a VRF Table Without Binding the Interface
Optional.
If policy-based routing (PBR) is required for VRF table selection, run the ip vrf receive command on the interface to
which PBR is applied, and import the direct route and host route on the interface to each VRF table available for choice.
Verification
Related Commands
Configuring an RD
Command rd rd_value
7-8
Configuration Guide Configuring VRF
Configuring an RT
Binding an Interface
7-9
Configuration Guide Configuring VRF
Adding the Direct Route and Host Route on an Interface to a VRF Table Without Binding the Interface
Configuration Example
Scenario
Figure 7-4
Sub a, Sub b, and Servers are three VPNs that have separate address spaces.
7-10
Configuration Guide Configuring VRF
Sub a runs RIP, Sub b runs OSPF, and Servers is a network segment directly connected to C.
Configuration Routes in Sub a are separated from those in Sub b, but both Sub a and Sub b can access Servers.
Requirements
Configuration On C, create a VRF table for Sub a, bind the interface directly connected to A, and associate the VRF
Steps table with A by using RIP.
On C, create a VRF table for Sub b, bind the interface directly connected to B, and associate the VRF
table with B by using OSPF.
On C, create a VRF table for Servers and bind the interface directly connected to Servers.
On C, configure the RTs of the VRF tables for Sub a, Sub b, and Servers. Import the routes in the VRF
tables for Sub a and Sub b to the VRF table for Servers, and import the routes in the VRF table for
Servers to the VRF tables for Sub a and Sub b.
Configure the Border Gateway Protocol (BGP) on C. Introduce the RIP routes to the VRF table for Sub
a, introduce the OSPF routes to the VRF table for Sub b (enabled with an address family), and
introduce the direct routes to the VRF table for Servers (enabled with an address family).
A(config-if-GigabitEthernet 0/1)#exit
A(config)#router rip
A(config-router)#version 2
A(config-router)#no auto-summary
B
B(config)#interface GigabitEthernet 0/2
B(config-if-GigabitEthernet 0/2)#exit
7-11
Configuration Guide Configuring VRF
B(config)#router ospf 1
C
C(config)# ip vrf Suba
C(config-vrf)# rd 100:1
C(config-vrf)# exit
C(config)#router rip
C(config-router-af)# version 2
C(config-router-af)# no auto-summary
C(config-router-af)#exit
C(config-vrf)# rd 100:2
C(config-vrf)# exit
C(config-router)# exit
C(config-vrf)# rd 100:3
7-12
Configuration Guide Configuring VRF
C(config-vrf)# exit
C(config-router-af)# exit
C(config-router-af)# exit
C(config-router-af)# exit
Verification Run the show ip vrf interface command on C to check the interface binding information.
Run the show ip route vrf command on C to check whether two VRF tables are created to separate
the routes in Sub a from those in Sub b and whether both VRF tables contain the routes in Servers.
C
C# show ip vrf interfaces
7-13
Configuration Guide Configuring VRF
Common Errors
An interface is bound to a VRF table after the IP interface of the interface is configured.
When a physical link is used to forward packets from multiple VPNs, the corresponding physical interface is bound to a
VRF table.
With BGP assistance, flexibly control the separation and access between VPNs.
With BGP assistance, provide the VPN service in an IP/MPLS backbone network.
Notes
No VRF table needs to be created if the device only forwards packets from one VPN or from the public network.
If the device needs to forward public network packets and VPN packets or forward packets from multiple VPNs, VRF
tables must be created to separate routes.
In many cases, static or dynamic routes (RIP, OSPF, ISIS, and BGP) need to be added to VRF tables.
Configuration Steps
Mandatory.
7-14
Configuration Guide Configuring VRF
Mandatory.
Enable the corresponding address family for each created VRF table.
Configuring an RD
Optional.
When routing information needs to be advertised through BGP in the backbone network, BGP may select the best route
for advertising if overlapping network addresses exist in different VPNs, which will make some VPNs fail to obtain
corresponding routing information. To solve this problem, you can configure RDs for routes to enable BGP to make
routing decisions based on these RDs, thus ensuring that each VPN can obtain corresponding routing information.
Configuring an RT
Optional.
You can run the route-target export command to specify the attributes of the route to be advertised, and run the
route-target import command to specify the attributes of the route to be received. You can also run the route-target
both command to specify the export and import attributes.
Run the route-target command in multiprotocol VRF mode or multiprotocol VRF address family mode.
Binding an Interface and Adding the Direct Route and Host Route on the Interface to a VRF Table
Mandatory.
If the physical link for transmitting VPN packets is exclusively occupied by a VPN, bind the physical interface to the
corresponding VRF table.
If the physical link for transmitting VPN packets is shared by multiple VPNs, you need to create an independent logical
link for each VPN, and bind the logical interface to the corresponding VRF table. A logical interface can be a
subinterface or a VLAN interface.
Before you bind an interface to a multiprotocol VRF table, enable an address family for the table. If you do not enable
the IPv4 address family in advance, you cannot configure the IPv4 address and VRRP IPv4 address of the bound
interface. If you do not enable the IPv6 address family in advance, you cannot configure the IPv6 address and VRRP
IPv6 address of the bound interface.
You must bind an interface to the corresponding multiprotocol VRF table before you configure the IPv4 or IPv6 address
of the interface. If you bind the interface after its IPv4 or IPv6 address is configured, the address will be invalid.
Adding the Direct Route and Host Route on an Interface to a VRF Table Without Binding the Interface
Optional.
If PBR is required for VRF table selection, run the ip vrf receive command on the interface to which PBR is applied,
and import the direct route and host route on the interface to each VRF table available for choice.
7-15
Configuration Guide Configuring VRF
Verification
Check whether multiprotocol VRF tables are created correctly on the router and corresponding address families are
enabled.
Related Commands
Configuring an RD
Command rd rd_value
Parameter rd_value has the following three different parameter forms:
Description (1) rd_value = as_num: nn
as_num indicates the 2-byte number that identifies a public AS. nn is configurable in the range
0..4294967295.
(2) rd_value = ip_addr: nn
ip_addr must be a global IP address. nn is configurable in the range 0..65535.
(3) rd_value = as4_num: nn
as4_num indicates the 4-byte number that identifies a public AS. nn is configurable in the range 1..65535.
7-16
Configuration Guide Configuring VRF
Configuring an RT
Binding an Interface
7-17
Configuration Guide Configuring VRF
Adding the Direct Route and Host Route on an Interface to a VRF Table Without Binding the Interface
Configuration Example
The following example only describes VRF-related configuration on A1, B1, MCE1, and PE1. The configuration on A2,
B2, MCE2, and PE2 is similar.
7-18
Configuration Guide Configuring VRF
Scenario
Figure 7-5
Configuration The routes in VPN a are separated from those in VPN b. A1 and A2 can access each other, and B1 and B2
Requirements can access each other.
Configuration Connect MCE1 and A1 through RIP. Extend RIP routes on A1. On MCE1, create a VRF table for VPN
Steps a, bind the directly connected interface, and configure RIP routes.
Connect MCE1 and B1 through OSPF. Extend OSPF routes on B1. On MCE1, create a VRF table for
VPN b, bind the directly connected interface, and configure OSPF routes.
Connect MCE1 and PE1 through BGP. On MCE1 and PE1, create a VRF table for each VPN, bind the
VLAN interface, and configure BGP routes.
Configure the physical link between MCE1 and PE1 in Trunk mode.
In the VRF instance for VPN a on MCE1, redistribute the RIP routes to BGP, and redistribute the BGP
routes to RIP.
In the VRF instance for VPN b on MCE1, redistribute the OSPF routes to BGP, and redistribute the
BGP routes to OSPF.
7-19
Configuration Guide Configuring VRF
A1(config-if-GigabitEthernet 0/1)#exit
A1(config)#router rip
A1(config-router)#version 2
A1(config-router)#no auto-summary
B1
B1(config)#interface GigabitEthernet 0/2
B1(config-if-GigabitEthernet 0/1)#exit
B1(config)#router ospf 1
MCE1 #Create a VRF table for VPN a and a VRF table VPN b, and enable the IPv4 address family.
MCE1(config-vrf)#address-family ipv4
MCE1(config-vrf-af)#exit
MCE1(config-vrf)#exit
MCE1(config-vrf)#address-family ipv4
MCE1(config-vrf-af)#exit
MCE1(config-vrf)#exit
7-20
Configuration Guide Configuring VRF
MCE1(config-if-GigabitEthernet 0/1)#exit
MCE1(config-if-GigabitEthernet 0/2)#exit
MCE1(config)#interface vlan 10
MCE1(config-if-VLAN 10)#exit
MCE1(config)#interface vlan 20
MCE1(config-if-VLAN 20)#exit
MCE1(config-if-GigabitEthernet 0/3)#exit
#Configure RIP and BGP routes in the VRF table for VPN a, and introduce routes in the two VRF tables to
each other.
MCE1(config)#router rip
MCE1(config-router-af)# version 2
MCE1(config-router-af)# no auto-summary
MCE1(config-router-af)#exit
MCE1(config-router-af)#redistribute rip
MCE1(config-router-af)#exit
7-21
Configuration Guide Configuring VRF
#Configure OSPF and BGP routes in the VRF table for VPN b, and introduce routes in the two VRF tables
to each other.
MCE1(config-router)#exit
MCE1(config-router-af)#redistribute ospf 1
MCE1(config-router-af)#exit
PE1 #Create a VRF table for VPN a and a VRF table VPN b, and enable the IPv4 address family.
PE1(config-vrf)#address-family ipv4
PE1(config-vrf-af)#exit
PE1(config-vrf)#exit
PE1(config-vrf)#address-family ipv4
PE1(config-vrf-af)#exit
PE1(config-vrf)#exit
PE1(config)#vlan 10
PE1(config-vlan)#exit
PE1(config)#vlan 20
PE1(config-vlan)#exit
PE1(config)#interface vlan 10
PE1(config-if-VLAN 10)#exit
PE1(config)#interface vlan 20
7-22
Configuration Guide Configuring VRF
PE1(config-if-VLAN 20)#exit
PE1(config-if-GigabitEthernet 0/3)#exit
PE1(config-router-af)#exit
PE1(config-router-af)#exit
Verification On A1, run the show ip route command to display the routes in VPN a.
On B2, run the show ip route command to display the routes in VPN b.
On MCE1, run the show ip route vrf vpna command to display the routes in VPN a, and run the
show ip route vrf vpnb command to display the routes in VPN b.
On PE1, run the show ip route vrf vpna command to display the routes in VPN a, and run the show
ip route vrf vpnb command to display the routes in VPN b.
Common Errors
An interface is bound to a VRF table after the IP interface of the interface is configured.
When a physical link is used to forward packets from multiple VPNs, the corresponding physical interface is bound to a
VRF table.
7.5 Monitoring
Clearing
Running the clear commands may lose vital information and thus interrupt services.
7-23
Configuration Guide Configuring VRF
Description Command
Clears the routes in a specified VRF clear ip route vrf vrf-name
table.
Displaying
Description Command
Displays the information of a show ip vrf [ brief | detail | interfaces ] [ vrf-name ]
single-protocol VRF table.
Displays the information of a show vrf [ ipv4 | ipv6 | brief | detail ] [ vrf-name ]
multiprotocol VRF table.
Debugging
System resources are occupied when debugging information is output. Therefore, disable debugging immediately after
use.
Description Command
Displays the debugging information debug vrf
during the processes where a VRF
table is created, an address family is
enabled, and an interface is bound to
the VRF table.
Prints the information of debug vrf interface
interface-related VRF operation
debugging.
7-24
Configuration Guide Configuring RIPng
8 Configuring RIPng
8.1 Overview
RIP next generation (RIPng) is a unicast routing protocol that applies to IPv6 networks. RIPng-enabled routers exchange
routing information to obtain routes to remote networks.
As an Interior Gateway Protocol (IGP), RIPng can run only within the autonomous system (AS) and is applicable to
small-sized networks with routes no more than 16 hops.
8.2 Application
RIPng is generally used on some small-sized networks, such as office networks of small companies.
As shown in the following figure, the company builds an IPv6 network, on which all routers support IPv6. The network is small
in size, but the workload is still heavy if the network is maintained manually. In this case, RIPng can be configured to adapt to
topological changes of the small-sized network, which reduces the workload.
8.3 Features
Basic Concepts
8-1
Configuration Guide Configuring RIPng
Exterior Gateway Protocol (EGP) runs between ASs. For example, BGP is a type of EGP.
Feature
Feature Description
RIPng and RIP RIPng is an extension of RIPv2 on the basis of IPv6. Both are similar in functions and configurations.
Exchanging Routing By exchanging routing information, RIPng-enabled devices can automatically obtain routes to a
Information remote network and update routes in real time.
Routing Algorithm RIPng is a protocol based on the distance-vector algorithm. It uses the vector addition method to
compute the routing information.
Avoiding Route RIPng uses functions, such as split horizon and poison reverse, to avoid route loops.
Loops
Working Principle
RIPv2
RIPv2 packets are multicast. The multicast address is 224.0.0.9, and the UDP port ID is 520. RIPv2 can identify the subnet
mask.
RIPng
RIPng packets are multicast. The multicast address is FF02::9, the source address is FE80::/10, and the UDP port ID is 521.
RIPng can identify the subnet mask.
This chapter describes functions and configurations of RIPng. For details about RIPv2, see "Configuring RIP".
Related Configuration
8-2
Configuration Guide Configuring RIPng
Working Principle
Initialization
After RIPng is enabled on a router, the router sends a request packet to its neighbor router, requesting for all routing
information, that is, the routing table. After receiving the request message, the neighbor router returns a response packet
containing the local routing table. After receiving the response packet, the router updates the local routing table, and sends
an update packet to the neighbor router, informing the neighbor router of the route update information. After receiving the
update packet, the neighbor router updates the local routing table, and sends the update packet to other adjacent routers.
After a series of updates, all routers can obtain and retain the latest routing information.
Periodical Update
By default, periodical update is enabled for RIPng. Adjacent routers exchange complete routing information with each other
every 30s (update timer), that is, the entire routing table is sent to neighbor routers.
For every non-local route, if the route is not updated within 180s (invalid timer), the metric of the route is changed to 16
(unreachable). If the route is still not updated in the next 120s (flush timer), the route is deleted from the routing table.
Default Route
In the routing table, a route to the destination network ::/0 is called default route.
The default route can be learned from a neighbor router, or sent to a neighbor router.
Route Redistribution
For RIPng, other types of routes (such as direct routes, static routes, and routes of other routing protocols) are called
external routes.
External routes (excluding the default route) can be redistributed to RIPng and advertised to neighbors.
Route Filtering
Filtering conditions can be configured to limit the routing information exchanged between adjacent routers. Only the routing
information that meets filtering conditions can be sent or received.
Related Configuration
RIPng Timers
By default, the update timer is 30s, the invalid timer is 180s, and the flush timer is 120s.
Run the timers basic command to modify durations of RIPng timers.
8-3
Configuration Guide Configuring RIPng
Increasing the duration of the flush timer can reduce the route flapping. Decreasing the duration of the flush timer helps
accelerate route convergence.
The durations of RIPng timers must be consistent on adjacent routers. Unless otherwise required, you are advised not to
modify the RIPng timers.
Default Route
Run the ipv6 rip default-information command to advertise the default route to neighbors on an interface.
Route Redistribution
Run the redistribute command to redistribute external routes (excluding the default route) to RIPng and advertise them to
neighbors.
Route Filtering
Run the distribute-list out command to set filtering rules to limit the routing information sent by the device.
Run the distribute-list in command to set filtering rules to limit the routing information received by the device.
Working Principle
Distance-Vector Algorithm
RIPng is a protocol based on the distance-vector algorithm. The distance-vector algorithm treats a route as a vector that
consists of the destination network and distance (metric). The router obtains a route from its neighbor and adds the distance
vector from itself to the neighbor to the route to form its own route.
RIPng uses the hop count to evaluate the distance (metric) to the destination network. By default, the hop count from a router
to its directly connected network is 0, the hop count from a router to a network that can be reached through a router is 1, and
so on. That is, the metric is equal to the number of routers from the local network to the destination network. To restrict the
convergence time, RIPng stipulates that the metric must be an integer between 0 and 15. If the metric is equal to or greater
than 16, the destination network or host is unreachable. For this reason, RIPng cannot be applied to a large-scale network.
As shown in the following figure 错误!未指定样式名。错误!未指定样式名。错误!未指定顺序。错误!未指定顺序。, Router A is
connected to the network 2::/64. Router B obtains the route (2::/64, 0) from Router A and adds the metric 1 to the route to
obtain its own route (2::/64, 1), and the next hop points to Router A.
8-4
Configuration Guide Configuring RIPng
RIPng selects an optimum route based on the following principle: If multiple routes to the same destination network is
available, a router preferentially selects the route with the smallest metric.
As shown in the following figure 错误!未指定样式名。错误!未指定样式名。错误!未指定顺序。错误!未指定顺序。, Router A is
connected to the network 2::/64. Router C obtains the route (2::/64, 0) from Router A and the route (2::/64, 1) from Router B.
Router C will select the route that is obtained from Router A and add metric 1 to this route to form its own route (2::/64, 1),
and the next hop points to Router A.
When routes coming from different sources exist on a router, the route with the smaller distance is preferentially
selected.
Route Source Default Distance
Directly-connected network 0
Static route 1
OSPF route 110
IS-IS route 115
RIPng route 120
Unreachable route 255
Related Configuration
For a RIPng route that is proactively discovered by a device, the default metric is equal to the number of hops from the local
network to the destination network. The metric offset of the interface is 1.
For a RIPng router that is manually configured (default route or redistributed route), the default metric is 1.
Run the ipv6 rip metric-offset command to modify the metric offset of the interface.
Run the default-metric command to modify the default metric of an external route (redistributed route).
8-5
Configuration Guide Configuring RIPng
Run the redistribute command to modify the metric of an external route (redistributed route) when advertising this route.
Run the ipv6 rip default-information command to modify the metric of a default route when advertising the default route.
Working Principle
Route Loop
A RIPng route loop occurs due to inherent defects of the distance-vector algorithm.
As shown in the following figure 错误!未指定样式名。错误!未指定顺序。, Router A is connected to the network 2::/64, and
sends an update packet every 30s. Router B receives the route to 2::/64 from Router A every 30s. If Router A is
disconnected from 2::/64, the route to 2::/64 will be deleted from the routing table on Router A. Next time, the update packet
sent by Router A no longer contains this route. As Router B does not receive an update packet related to 2::/64, Router B
determines that the route to 2::/64 is valid within 180s and uses the update packet to send this route to Router A. As the route
to 2::/64 does not exist on Router A, the route learned from Router B is added to the routing table. Router B determines that
data can reach 2::/64 through Router A, and Router A determines that data can reach 2::/64 through Router B. In this way, a
route loop is formed.
Split Horizon
Split horizon can prevent route loops. After split horizon is enabled, a route received on this interface will not be sent out from
this interface.
As shown in the following figure 错误!未指定样式名。错误!未指定顺序。, after split horizon is enabled on Router B, Router B
will not send the route to 2::/64 back to Router A. Router B will learn 180s later that 2::/64 is not reachable.
8-6
Configuration Guide Configuring RIPng
Poison Reverse
Poison reverse can also prevent route loops. Compared with slit horizon, poison reverse is more reliable, but brings more
protocol packets, which makes network congestion more severe.
After poison reverse is enabled on an interface, a route received from this interface will be sent out from this interface again,
but the metric of this router will be changed to 16 (unreachable).
As shown in the following figure, after poison reverse is enabled on Router A, if Route A detects a disconnection from 2::/64,
Router A will not delete the route to 2::/64. Instead, Router A changes the number of hops to 16, and advertises the route
through the update packet. On receiving the update packet, Router B learns that 2::/64 is not reachable.
Related Configuration
Split Horizon
Poison Reverse
8.4 Configuration
8-7
Configuration Guide Configuring RIPng
Notes
Configuration Steps
Mandatory.
Unless otherwise required, perform this configuration on every router in the RIPng routing domain.
8-8
Configuration Guide Configuring RIPng
Mandatory.
Unless otherwise required, perform this configuration on every interconnected interface of routers in the RIPng routing
domain.
Verification
Check the routing table on a router to verify that the route to a remote network can be obtained through RIPng.
Related Commands
8-9
Configuration Guide Configuring RIPng
Usage Guide The configuration for running the RIPng on an interface is different from that of RIPv2. In RIPv2, the
network command is configured in routing process configuration mode to define an IP address range. If the
IP address of an interface belongs to this IP address range, RIP automatically runs on this interface.
Configuration Example
8-10
Configuration Guide Configuring RIPng
Scenario
Figure 8-1
A(config-router)# exit
B
B# configure terminal
B(config-router)# exit
C
C# configure terminal
C(config-router)# exit
C(config-if-GigabitEthernet 0/0)#
8-11
Configuration Guide Configuring RIPng
Verification Check the routing tables on Router A, Router B, and Router C. The routing tables should contain routes to a
remote network that are learned through RIPng.
A
A# show ipv6 route
IA - Inter area
B
B# show ipv6 route
8-12
Configuration Guide Configuring RIPng
IA - Inter area
C
Ruijie# show ipv6 route
IA - Inter area
Common Errors
The interface used for interconnection between devices is configured as a passive interface.
8-13
Configuration Guide Configuring RIPng
In the RIPng domain, introduce a unicast route of another AS so that the unicast routing service to this AS can be
provided for users in the RIPng domain.
In the RIPng domain, inject a default route to another AS so that the unicast routing service to this AS can be provided
for users in the RIPng domain.
Notes
Configuration Steps
Optional.
Perform this configuration if external routes of the RIPng domain should be introduced to the AS border router (ASBR).
Optional.
Perform this configuration if the default route should be introduced to an ASBR so that other routers in the RIPng
domain access other AS domains through this ASBR by default.
Verification
Run the show ipv6 route rip command on a non-ASBR to check whether the external routes of the domain and default
route have been loaded.
Related Commands
8-14
Configuration Guide Configuring RIPng
Command redistribute { bgp | connected | isis [ area-tag ] | ospf process-id | static } [ metric metric-value |
route-map route-map-name ]
Parameter bgp: Indicates redistribution from BGP.
Description Connected: Indicates redistribution from direct routes.
isis [ area-tag ]: Indicates redistribution from IS-IS. area-tag indicates the IS-IS process ID.
ospf process-id: Indicates redistribution from OSPF. process-id indicates the OSPF process ID. The value
ranges from 1 to 65535.
static: Indicates redistribution from static routes.
metric metric-value: Sets the metric of the route redistributed to the RIPng domain.
route-map route-map-name: Sets the redistribution filtering rules.
Command Routing process configuration mode
Mode
Usage Guide During route redistribution, it is not necessary to convert the metric of one routing protocol to the metric of
another routing protocol because different routing protocols use completely different metric measurement
methods. RIP measures the metric based on the hop count, and OSPF measures the metric based on the
bandwidth. Therefore, the computed metrics cannot be compared with each other.
Configuration Example
Scenario
B
B# configure terminal
Verification Check the routing tables on Router A and Router B, and confirm that Router A can learn the route
3001:10:10::/64, and Router B can learn the default route ::/0.
8-15
Configuration Guide Configuring RIPng
A
A# show ipv6 route rip
IA - Inter area
B
B# show ipv6 route rip
IA - Inter area
Routes that do not meet filtering criteria cannot be loaded to the routing table, or advertised to neighbors. In this way,
users within the network can be prevented from accessing specified destination networks.
Notes
Configuration Steps
To refuse receiving some specified routes, you can configure the route distribution control list to process all the received
route update packets. If no interface is specified, route update packets received on all interfaces will be processed.
8-16
Configuration Guide Configuring RIPng
If this command does not contain any optional parameter, route update advertisement control takes effect on all
interfaces. If the command contains the interface parameter, route update advertisement control takes effect only on
the specified interface. If the command contains other routing process parameters, route update advertisement control
takes effect only on the specified routing process.
Verification
Run the show ipv6 route rip command to check that the routes that have been filtered out are not loaded to the routing
table.
Related Commands
Configuration Example
Scenario
Verification Check that Router A can learn only the route to 4001::/64.
8-17
Configuration Guide Configuring RIPng
A
A# show ipv6 route rip
IA - Inter area
Change the RIPng routes to enable the traffic pass through specified nodes or avoid passing through specified nodes.
Change the sequence that a router selects various types of routes so as to change the priorities of RIPng routes.
Notes
Configuration Steps
Optional.
Perform this configuration if you wish to change the priorities of RIPng routes on a router that runs multiple unicast
routing protocols.
Optional.
Unless otherwise required, perform this configuration on a router where the metrics of routes need to be adjusted.
Optional.
Unless otherwise required, perform this configuration on an ASBR to which external routes are introduced.
Verification
Run the show ipv6 rip command to display the administrative distance of RIPng routes.
Run the show ipv6 rip data command to display the metrics of external routes redistributed to RIPng.
8-18
Configuration Guide Configuring RIPng
Related Commands
Configuration Example
Scenario
8-19
Configuration Guide Configuring RIPng
A# configure terminal
Verification On Router A, check whether the administrative distance of a RIPng route is 160.
Change the duration of RIPng timers to accelerate or slow down the change of the protocol state or occurrence of an
event.
Notes
Modifying the protocol control parameters may result in protocol running failures. Therefore, you are advised not to
modify the timers.
Configuration Steps
Mandatory.
Unless otherwise required, perform this configuration on a router where RIPng timers need to be modified.
Verification
Related Commands
8-20
Configuration Guide Configuring RIPng
updated. The duration of the invalid timer must be at least three times the duration of the update timer. If no
update packet is received before the invalid timer expires, the corresponding route enters the invalid state. If
the update packet is received before the invalid timer expires, the timer is reset. The default duration of the
invalid timer is 180s.
Flush: Indicates the route flushing time in second, counted from the time when the RIPng route enters the
invalid state. When the flush timer expires, the route in the invalid state will be deleted from the routing table.
The default duration of the flush timer is 120s.
Command Routing process configuration mode
Mode
Usage Guide By default, the update timer is 30s, the invalid timer is 180s, and the flush timer is 120s.
Configuration Example
Scenario
B(config-router)# timers 10 30 90
8-21
Configuration Guide Configuring RIPng
B
B# show ipv6 rip
Outgoing update filter list for all interface is: not set
Incoming update filter list for all interface is: not set
Redistribution:
GigabitEthernet 0/1 1 1
Common Errors
Settings of RIPng timers on devices connected to the same network are inconsistent. Consequently, routes cannot be
learned properly.
Notes
Configuration Steps
Verification
Run the show ipv6 route rip command to display the protocol status.
8-22
Configuration Guide Configuring RIPng
Related Commands
Parameter all: Indicates that packets are allowed to be sent to all sub VLANs.
Description
vid: Specifies the sub VLAN ID. The value ranges from 1 to 4094.
Usage Guide In normal cases, a super VLAN contains multiple sub VLANs. Multicast packets of a super VLAN are also
sent to its sub VLANs. In this case, when RIPng multicast packets are sent over a super VLAN containing
multiple sub VLANs, the RIPng multicast packets are replicated multiple times, and the device processing
capability is insufficient. As a result, a large number of packets are discarded, causing the neighbor down
error. In most scenarios, the RIPng function does not need to be enabled on a super VLAN. Therefore, the
RIPng function is disabled by default. However, in some scenarios, the RIPng function must be run on the
super VLAN, but packets only need to be sent to one sub VLAN. In this case, run this command to specify a
particular sub VLAN. You must be cautious in configuring packet transmission to all sub VLANs, as the large
number of sub VLANs may cause a device processing bottleneck, which will lead to the neighbor down
error.
Configuration Example
Scenario
8-2
A A# configure terminal
8-23
Configuration Guide Configuring RIPng
B B# configure terminal
Verify that the entry 4001::/64 has been loaded to the routing table on Device A.
Verification
Verify that the entry 3001::/64 has been loaded to the routing table on Device B.
8.5 Monitoring
Displaying
Description Command
Displays information about the RIPng show ipv6 rip
process.
Displays the RIPng routing table. show ipv6 rip database
Debugging
System resources are occupied when debugging information is output. Therefore, disable debugging immediately after
use.
Description Command
Debugs RIPng. debug ipv6 rip [interface interface-type interface-num | nsm | restart | event [ ipsec ] ]
8-24
Configuration Guide Managing Routes
9 Managing Routes
9.1 Overview
The network service module (NSM) manages the routing table, consolidates routes sent by various routing protocols, and
selects and sends preferred routes to the routing table. Routes discovered by various routing protocols are stored in the
routing table. These routes are generally classified by source into three types:
Direct route: It is the route discovered by a link-layer protocol and is also called interface route.
Static route: It is manually configured by the network administrator. A static route is easy to configure and less
demanding on the system, and therefore applicable to a small-sized network that is stable and has a simple topology.
However, when the network topology changes, the static route must be manually reconfigured and cannot automatically
adapt to the topological changes.
9.2 Applications
Application Description
Basic Functions of the Static Route Manually configure a route.
Floating Static Route Configure a standby route in the multipath scenario.
Load Balancing Static Route Configure load balancing static routes in the multipath scenario.
Correlation of Static Routes with BFD Use the Bidirectional Forwarding Detection (BFD) function to test whether the next
hop of a static route is reachable.
Fast Reroute of Static Routes Use the fast reroute function to improve the switching performance in the multipath
scenario.
On a network with a simple topology, you can configure only static routes to implement network interworking. Appropriate
configuration and use of static routes can improve the network performance and guarantee the bandwidth for important
network applications.
As shown in Figure 9-1, to implement interworking between PC 1, PC 2, and PC 3, you can configure static routes on R 1, R
2, and R 3.
On R 1, configure a route to the network segment of PC 2 through R 2, and a route to the network segment of PC 3
through R 3.
On R 2, configure a route to the network segment of PC 1 through R 1, and a route to the network segment of PC 3
through R 3.
9-1
Configuration Guide Managing Routes
On R 3, configure a route to the network segment of PC 1 through R 1, and a route to the network segment of PC 2
through R 2.
Figure 9-1
Deployment
If no dynamic routing protocol is configured, you can configure floating static routes to implement dynamic switching of routes
to prevent communication interruption caused by the network connection failures.
As shown in Figure 9-2, to prevent communication interruption caused by a line failure between R 1 and R 3, you can
configure a floating static route respectively on R 1 and R 3. Normally, packets are forwarded on a path with a small
administrative distance. If a link on this path is down, the route is automatically switched to the path with a large
administrative distance.
On R1, configure two routes to the network segment of PC 3, including a route through R 3 (default distance = 1) and a
route through R 2 (default distance = 2).
On R 3, configure two routes to the network segment of PC 1, including a route through R 1 (default distance = 1) and a
route through R 2 (default distance = 2).
9-2
Configuration Guide Managing Routes
Figure 9-2
Deployment
If there are multiple paths to the same destination, you can configure load balancing routes. Unlike floating routes, the
administrative distances of load balancingroutes are the same. Packets are distributed among these routes based on the
balanced forwarding policy.
As shown in Figure 9-3, load balancing routes are configured respectively on R 1 and R 3 so that packets sent to the network
segment of PC 3 or PC 1 are balanced between two routes, including a route through R 2 and a route through R 4.
On R 1, configure two routes to the network segment of PC 3, including a route through R 2 and a route through R 4.
On R 3, configure two routes to the network segment of PC 1, including a route through R 2 and a route through R 4.
9-3
Configuration Guide Managing Routes
Figure 9-3
Remarks On the switch, the load is balanced based on the source IP address by default. Run the aggregateport
load-balance command to configure the load balancing mode of ECMP route.
Deployment
When the floating static routes or load balancing static routes are configured, the static routes may fail to sense the route
failures if the line is faulty but the interface status is normal. To resolve this problem, the device needs to check whether the
next hop of a static route is reachable. If the next hop is not reachable, the device can switch the traffic to the standby route.
You can use the Track or BFD function to check whether the next hop of a static route is reachable. The following scenario
takes BFD as an example.
You can use only one of the Track and BFD functions at a time.
As shown in Figure 9-4, to prevent communication interruption caused by a line failure between R 1 and R 3, you can
configure a floating static route respectively on R 1 and R 3, and correlate static routes with BFD.
On R 1, configure two routes to the network segment of PC 3, including a route through R 3 (default distance = 1) and a
route through R 2 (default distance = 2). BFD is enabled on the first route to check whether the next hop 1.1.13.3 is
reachable, and on the second route to check whether the next hop 1.1.12.2 is reachable.
On R 3, configure two routes to the network segment of PC 1, including a route through R 1 (default distance = 1) and a
route through R 2 (default distance = 2). BFD is enabled on the first route to check whether the next hop 1.1.13.1 is
reachable, and on the second route to check whether the next hop 1.1.23.2 is reachable.
9-4
Configuration Guide Managing Routes
Figure 9-4
Deployment
Configure static routes and correlate these static routes with BFD on R 1, R 2, and R 3.
To accelerate route switching and shorten the communication interruption time when no dynamic routing protocol is
configured, you can either correlate static routes with Track or BFD to check whether the next hop is reachable. In addition,
you can or configure fast reroute to further improve the convergence performance.
As shown in Figure 9-5, to prevent communication interruption caused by a line failure between R 1 and R 3, you can
configure static fast reroute respectively on R 1 and R 3. Normally, packets are forwarded on the path between R 1 and R 3.
When the link on this route is down, packets are automatically rerouted to R 2.
On R 1, configure a route with the exit interface set to Gi0/3 and the next hop set to 1.1.13.3, and a standby route with
the exit interface set to Gi0/2 and the next hop set to 1.1.12.2.
On R 3, configure a route with the exit interface set to Gi0/1 and the next hop set to 1.1.13.1, and a standby route with
the exit interface set to Gi0/2 and the next hop set to 1.1.23.2.
9-5
Configuration Guide Managing Routes
Figure 9-5
Deployment
9.3 Features
Feature Description
Route Computation Generate a valid route on a device.
Optimal Route Select an optimal route to forward packets.
Selection
Default Route Forward all packets and help reduce the size of a routing table.
Route Reliability Quickly detect a route failure and recover communication.
Routing functions are classified into IPv4 and IPv6 routing functions. If the routing functionsare disabled, a device is
equivalent to a host and cannot forward routes.
Dynamic Route
A dynamic routing protocol learns remote routes and dynamically updates routes by exchanging routes with neighbors. If a
neighbor is the next hop of a route and this neighbor fails, the route fails as well.
Static Route
9-6
Configuration Guide Managing Routes
On a network with a simple topology, you can configure only static routes to implement network interworking. Appropriate
configuration and use of static routes can improve the network performance and guarantee the bandwidth for important
network applications.
Whether a static route is active is computed based on the status of the local interface. When the exit interface of a static route
is located at layer 3 (L3) and is in Up status (the link status is Up and the IP address is configured), this route is active and
can be used for packet forwarding.
A static route can go across VPN routing & forwarding (VRF) instances. The next hop or exit interface of a static route of VRF
1 can be configured on VRF 2.
When multiple routing protocols generate routes to the same destination, the priorities of these routes can be determined
based on the administrative distance. A smaller administrative distance indicates a higher priority.
Equal-Cost Route
If multiple routes to the same destination have different next hops but the same administrative distance, these routes are
mutually equal-cost routes. Packets are distributed among these routes to implement load balancing based on the balanced
forwarding policy.
On a specific device, the total number of equal-cost routes is limited. Routes beyond the limit do not participate in packet
forwarding.
Floating Route
If multiple routes to the same destination have different next hops and different administrative distances, these routes are
mutually floating routes. The route with the smallest administrative distance will be first selected for packet forwarding. If this
route fails, a route with a larger administrative distance is further selected for forwarding, thus preventing communication
interruption caused by a network line failure.
Default Gateway
On a L3 switch, a static route with the network segment 0.0.0.0 and the subnet mask 0.0.0.0 is configured to generate the
default route.
9-7
Configuration Guide Managing Routes
Default Network
The default network is configured to generate a default route. If the ip default-network command is configured to specify a
network (a classful network, such as a Class A, B, or C network), and this network exists in the routing table, the router will
use this network as the default network and the next hop of this network is the default gateway. As the network specified by
the ip default-network command is a classful one, if this command is used to identify a subnet in a classful network, the
router automatically generates a static route of the classful network instead of any default route.
A track object is an abstract concept. It can be used to trace whether an IP address is reachable or whether an interface is up.
If a dynamic routing protocol or a static route is correlated with the Track function, the dynamic routing protocol or the static
route can quickly learn whether the next hop is reachable so as to respond quickly.
The BFD protocol provides a light-load and fast method for detecting the connectivity of the forwarding path between two
adjacent routers. If a dynamic routing protocol or a static route is correlated with the BFD function, the dynamic routing
protocol or the static route can quickly learn whether the next hop is reachable so as to respond quickly.
Fast Reroute
Fast reroute provides a standby route. When a dynamic routing protocol or a static route detects that the next hop is
unreachable, it immediately switches traffic over to the standby route to recovery communication.
9.4 Configuration
9-8
Configuration Guide Managing Routes
(Optional) It is used to limit the number of equal-cost routes and number of static routes,
or disable routing.
Generate a static route in the routing table. Use the static route to forward packets to a remote network.
Notes
9-9
Configuration Guide Managing Routes
If the no ip routing command is configured on a L3 switch, you cannot configure IPv4 static routes on this switch, and
existing IPv4 static routes will also be deleted. Before the device is restarted, reconfiguring the ip routing command
can recover the deleted IPv4 static routes. After the device is restarted, deleted IPv4 static routes cannot be recovered.
If the no ipv6 unicast- routing command is configured on a L3 switch, you cannot configure IPv6 static routes on this
switch, and existing IPv6 static routes will also be deleted. Before the device is restarted, reconfiguring the ipv6
unicast- routing command can recover the deleted IPv6 static routes. After the device is restarted, deleted IPv6 static
routes cannot be recovered.
To correlate a static route with the Track function, you must run the track command to configure a track object.
Configuration Steps
Command ip route [vrf vrf_name] networknet-mask {ip-address | interface [ip-address]} [distance] [tag tag]
[permanent | track object-number] [weight number] [descriptiondescription-text] [disabled | enabled]
[global]
Parameter vrfvrf_name (Optional) Indicates the routing VRF, which can be a single-protocol IPv4 VRF or a
Description multi-protocol VRF of a configured IPv4 address family. The VRF is a global VRF by
default.
network Indicates the address of the destination network.
net-mask Indicates the mask of the destination network.
ip-address (Optional) Indicates the next-hop address of the static route. You must specify at least
one of ip-address and interface, or both of them. If ip-address is not specified, a static
direct route is configured.
interface (Optional) Indicates the next-hop exit interface of the static route. You must specify at
least one of ip-address and interface, or both of them. If interface is not specified, a
recursive static direct route is configured. The exit interface is obtained by the next hop
in the routing table.
distance (Optional) Indicates the administrative distance of the static route. The administrative
distance is 1 by default.
tag (Optional) Indicates the tag of the static route. The tag is 0 by default.
permanent (Optional) Indicates the flag of the permanent route. The static route is not a permanent
route by default.
track (Optional) Indicates correlation with Track. object-number indicates the ID of the
object-number track object. By default, the static route is not correlated with the Track function.
weight number (Optional) Indicates the weight of the static route. The weight is 1 by default.
descriptiondescri (Optional) Indicates the description of the static route. By default, no description is
ption-text configured. description-text is a string of one to 60 characters.
disabled/enabled (Optional) Indicates the enable flag of the static route. The flag is enabled by default.
global (Optional) Indicates that the next hop belongs to a global VRF. By default, the VRF of
9-10
Configuration Guide Managing Routes
the next hop is the same as the VRF specified by vrf name.
Defaults By default, no static route is configured.
Command Global configuration mode
Mode
Usage Guide The simplest configuration of this command is ip route networknet-maskip-address.
If the static route is correlated with Track and the down status of the trace object is detected, the static route
is not active and does not participate in packet forwarding.
9-11
Configuration Guide Managing Routes
Verification
Run the show ip route command to display the IPv4 routing table and check whether the configured IPv4 static route
takes effect.
Run the show ipv6 route command to display the IPv6 routing table and check whether the configured IPv6 static route
takes effect.
Configuration Example
Scenario
Figure 9-6
9-12
Configuration Guide Managing Routes
R2
R2#configure terminal
R3
R3#configure terminal
R2
R2#configure terminal
R3
R3#configure terminal
9-13
Configuration Guide Managing Routes
R2
R2# show ip route
9-14
Configuration Guide Managing Routes
R3
R3# show ip route
Scenario
Figure 9-7
Configuration Configure static routes on R 1 and R 2, and specify the exit interface or next hop as the interworking
Steps interface.
Correlate static routes with Track on R 1 and R 2, and check the connectivity of the next hops of static
routes.
R1
R1#configure terminal
9-15
Configuration Guide Managing Routes
R2
R2#configure terminal
Track 2
Scenario
Figure 9-8
9-16
Configuration Guide Managing Routes
R2
R2#configure terminal
R2
R2#configure terminal
IA - Inter area
9-17
Configuration Guide Managing Routes
R2
R2# show ipv6 route
IA - Inter area
Common Errors
The static route is correlated with Track, but the track object is not configured.
9-18
Configuration Guide Managing Routes
Generate a default route in the routing table. The default route is used to forward packets that cannot be forwarded by
other routes.
Notes
On a L2 switch, run the ip default gateway or ipv6 default gateway command to configure the default gateway.
On a L3 switch, run the ip route 0.0.0.0 0.0.0.0 gatewayor ipv6 route ::/0 ipv6-gatewaycommand to configure the
default gateway.
If the no ip routing or no ipv6 unicast- routing command is configured on a L3 switch, you can run the ip default
gateway or ipv6 default gateway command to configure the default gateway.
Configuration Steps
Command ip default-gatewaygateway
Parameter gateway indicates the IPv4 gateway address.
Description
Defaults By default, no static default route is configured.
Command Global configuration mode
Mode
Usage Guide N/A
Command ip route [vrf vrf_name]0.0.0.00.0.0.0{ip-address | interface [ip-address]} [distance] [tag tag] [permanent ]
[weight number] [descriptiondescription-text] [disabled | enabled] [global]
Parameter (Optional) Indicates the routing VRF, which can be a single-protocol IPv4 VRF or a
Description vrfvrf_name multi-protocol VRF of a configured IPv4 address family. The VRF is a global VRF by
default.
0.0.0.0 Indicates the address of the destination network.
9-19
Configuration Guide Managing Routes
Command ipv6 route [vrfvrf-name] ::/0 { ipv6-address [nexthop-vrf {vrf-name1| default}] | interface [ ipv6-address
[nexthop-vrf {vrf-name1| default}]] } [distance] [weightnumber] [descriptiondescription-text]
Parameter (Optional) Indicates the routing VRF, which must be a multi-protocol VRF of a
vrfvrf-name
Description configured IPv6 address family. The VRF is a global VRF by default.
Indicates the IPv6 prefix, which must comply with the address expression specified in
::
RFC4291.
Indicates the length of the IPv6 prefix. Note that a slash (/) must be added in front of
0
the length.
(Optional) Indicates the next-hop address of the static route. You must specify at least
Ipv6-address one of ipv6-address and interface, or both of them. If ipv6-address is not specified, a
static direct route is configured.
(Optional) Indicates the next-hop exit interface of the static route. You must specify at
least one of ipv6-address and interface, or both of them. If interface is not specified, a
interface
recursive static direct route is configured. The exit interface is obtained by the next
hop in the routing table.
nexthop-vrf (Optional) Indicates the routing VRF of the next hop, which must be a multi-protocol
9-20
Configuration Guide Managing Routes
vrf-name1 VRF of a configured IPv6 address family. By default, the VRF of the next hop is the
same as the VRF specified by vrf name.nexthop-vrf default indicates that the VRF
of the next shop is a global VRF.
(Optional) Indicates the administrative distance of the static route. The administrative
distance
distance is 1 by default.
weight number (Optional) Indicates the weight of the static route, which must be specified when you
configure equal-cost routes. The weight ranges from 1 to 8. When the weights of all
equal-cost routes of a route are summed up, the sum cannot exceed the maximum
number of equal-cost routes that can be configured for the route. Weighting of
equal-cost routes of a route indicates the traffic ratio of these routes. The weight is 1
by default.
descriptiondescript (Optional) Indicates the description of the static route. By default, no description is
ion-text configured. description-text is a string of one to 60 characters.
Defaults By default, no static default route is configured.
Command Global configuration mode
Mode
Usage Guide The simplest configuration of this command is ipv6 route ::/0 ipv6-gateway.
Verification
On a L2 switch (or a L3 switch where routing is disabled), run the show ip redirects or show ipv6 redirects command
to display the default gateway.
On a L3 switch where routing is enabled, run the show ip route or show ipv6 route command to display the default
route.
Configuration Example
9-21
Configuration Guide Managing Routes
Scenario
Figure 9-9
R2
R2#configure terminal
R1#configure terminal
R2#configure terminal
R2
R2(config)#ip route 0.0.0.0 0.0.0.0 GigabitEthernet 0/1 1.1.12.1
9-22
Configuration Guide Managing Routes
Limit the number of equal-cost routes and number of static routes, or disable routing.
Notes
Configuration Steps
Command maximum-pathsnumber
Parameter number Indicates the maximum number of equal-cost routes. The value ranges from 1 to 64.
Description
Defaults N/A
Command Global configuration mode
Mode
Usage Guide Run this command to configure the maximum number of next hops in the equal-cost route. In load balancing
mode, the number of routes on which traffic is balanced does not exceed the configured number of
equal-cost routes.
9-23
Configuration Guide Managing Routes
Description
Defaults By default, a maximum of 1,024 IP static routes can be configured.
Command Global configuration mode
Mode
Usage Guide Run this command to configure the maximum number of IPv4 static routes. If the maximum number of IPv4
static routes is reached, no more IPv4 static route can be configured.
Command no ip routing
Parameter N/A
Description
Defaults By default, IPv4 routing is enabled.
Command Global configuration mode
Mode
Usage Guide Run this command to disable IPv4 routing. If the device functions only as a bridge or a voice over IP (VoIP)
gateway, the device does not need to use the IPv4 routing function of the RGOS software. In this case, you
can disable the IPv4 routing function of the RGOS software.
9-24
Configuration Guide Managing Routes
Verification
Run the show run command to display the configuration file and verify that the preceding configuration commands exist.
Configuration Example
Scenario
Figure 9-10
Configuration On R 1, configure the IP addresses, static routes, and maximum number of static routes.
Steps
R1#configure terminal
9-25
Configuration Guide Managing Routes
Verification Check the static routes that really take effect in the routing table.
A static route can quickly detect a route failure with the help of BFD.
9-26
Configuration Guide Managing Routes
Notes
You must configure the BFD session parameters by running the bfd interval xmin_rx xmultiplier x command.
Configuration Steps
Command ipv6 route static bfd [vrfvrf-name] interface-type interface-number gateway [source ipv6-address]
Parameter vrfvrf-name (Optional) Indicates the name of the VRF to which the static route belongs. The VRF is
Description a global VRF by default.
interface-type Indicates the interface type.
interface-number Indicates the interface number.
gateway Indicates the IP address of the gateway, that is, the neighbor IP address of BFD. If the
next hop of the static route is this neighbor, BFD is used to check the connectivity of the
forwarding path.
sourceip-addess (Optional) Indicates the source IP address used for the BFD session. This parameter
must be configured if the neighbor IP address involves multiple hops. By default, the
neighbor IP address of the BFD session is a single hop, and the source IP address is
not used.
Defaults By default, a static route is not correlated with BFD.
Command Global configuration mode
9-27
Configuration Guide Managing Routes
Mode
Usage Guide Run this command to correlate an IPv6 static route with BFD. If the down status of the BFD session is
detected, the IPv6 static route is not active and does not participate in packet forwarding.
Verification
Run the show bfd neighbors command to display information about BFD neighbors.
Run the show ip route static bfd or show ipv6 route static bfd command to display information about correlation of
static routes with BFD.
Configuration Example
Scenario
Figure 9-11
R2
R2#configure terminal
9-28
Configuration Guide Managing Routes
Common Errors
Notes
Configuration Steps
9-29
Configuration Guide Managing Routes
Verification
Run the show ip route fast-reroute command to display the active and standby routes that take effect.
Configuration Example
Scenario
Figure 9-12
Configuration On R 1, configure a static route to the network segment of PC 3, and the next hop of the exit interface is R 3.
9-30
Configuration Guide Managing Routes
Steps On R 1, configure static fast reroute. The next hop of the exit interface of the standby route is R2.
R1#configure terminal
R1(config)#route-map fast-reroute
R1(config-route-map)# exit
9-31
Configuration Guide Managing Routes
Common Errors
The matching conditions are not configured or are not properly configured in the road map.
9.5 Monitoring
Displaying
Description Command
Displays the IPv4 routing table. show ip route
Displays the IPv6 routing table. show ipv6route
Debugging
System resources are occupied when debugging information is output. Therefore, disable debugging immediately after
use.
Description Command
Debugs IPv4 route management. debug nsm kernel ucast- v4
Debugs IPv6 route management. debug nsm kernel ucast-v6
Debugs fast reroute management. debug nsm kernel frr
Debugs default network debug nsm kernel default-network
management.
Debugs internal events of route debug nsm events
management.
Debugs sending of route debug nsm packet send
management and routing protocol
messages.
Debugs receiving of route debug nsm packet recv
management and routing protocol
messages.
9-32
Configuration Guide Configuring Keys
10 Configuring Keys
10.1 Overview
Keys are a kind of parameters that are used in algorithms for conversion from plain text to cipher text or from cipher text to
plain text.
Plain text and cipher text authentication are supported for packet authentication in a routing protocol, during which keys need
to be used.
At present, keys are used only for RIP and ISIS packet authentication.
10.2 Applications
Application Description
RIP Authentication RIP uses keys for packet authentication.
Network devices run RIP and use the MD5 authentication mode to increase the protocol security.
Figure 10-1
Deployment
Configure a key chain on A. Configure RIP to enable packet authentication and use the key chain.
Configure a key chain on B. Configure RIP to enable packet authentication and use the key chain.
10.3 Features
Overview
33
Configuration Guide Configuring Keys
Feature Description
Key Chain Provide a tool for authentication in a routing protocol.
A key chain may contain multiple different keys. Each key contains the following attributes:
Key ID: Identifies a key. In the current key chain, keys and IDs are mapped in the one-to-one manner.
Authentication string: Indicates a set of key characters used for verifying the consistency of authentication strings in a
routing protocol.
Lifetime: Specifies the lifetime of the current key for sending or receiving packets. Different authentication keys can be
used in different periods.
Related Configuration
In the global configuration mode, run the key chain key-chain-name command to define a key chain and enter the key chain
configuration mode.
In the key chain configuration mode, run the key key-id command to define a key and enter the key chain key configuration
mode.
In the key chain key configuration mode, run the key-string [0|7] text command to specify an authentication string.
A plain text authentication string is configured by default. The value 0 indicates that a plain text authentication key is
configured.
The encryption authentication service is disabled by default. You can run the service password-encryption command
to enable the encryption service to forcibly convert plain text authentication into cipher text.
Configuring Lifetime
In the key chain key configuration mode, you can configure the lifetime of a key chain in the receiving and sending directions.
accept-lifetime start-time { infinite | end-time | duration seconds }: Configures the lifetime of a key chain in the
receiving direction.
send-lifetime start-time { infinite | end-time | duration seconds }: Configures the lifetime of a key chain in the sending
direction.
10.4 Configuration
34
Configuration Guide Configuring Keys
Notes
A key chain can take effect only after it is associated with a routing protocol.
Configuration Steps
If there is no special requirement, you should perform this configuration on all routers for which routing protocol
authentication needs to be performed.
Configuring a Key ID
If there is no special requirement, you should perform this configuration on all routers for which routing protocol
authentication needs to be performed.
If there is no special requirement, you should perform this configuration on all routers for which routing protocol
authentication needs to be performed.
Optional.
If the lifetime in the sending direction is not configured, the key chain will be always effective.
Optional.
35
Configuration Guide Configuring Keys
If the lifetime in the sending direction is not configured, the key chain will be always effective.
Verification
Use keys in a routing protocol and observe the neighborship established by the routing protocol. If the keys are
inconsistent, the neighborship fails to be established.
Related Commands
Configuring a Key ID
36
Configuration Guide Configuring Keys
Mode
Usage Guide Run this command to define the lifetime of the key in the sending direction.
Configuration Example
Configuring a Key Chain and Using the Key Chain in RIP Packet Authentication
Scenario
Figure 10-2
Configuration
Configure a key on all routers.
Steps
Configure RIP on all routers.
A
A>enable
A#configure terminal
A(config-keychain)#key 1
A(config-keychain-key)#key-string Hello
A(config-keychain-key)#exit
37
Configuration Guide Configuring Keys
A(config-keychain)#key 2
A(config-keychain-key)#key-string World
A(config-keychain-key)#exit
A(config-if)#exit
A(config)#router rip
A(config-router)#version 2
A(config-router)#network 192.168.27.0
B
B>enable
B#configure terminal
B(config-keychain)#key 1
B(config-keychain-key)#key-string Hello
B(config-keychain-key)#exit
B(config-keychain)#key 2
B(config-keychain-key)#key-string World
B(config-keychain-key)#exit
B(config-if)#exit
38
Configuration Guide Configuring Keys
B(config)#router rip
B(config-router)#version 2
B(config-router)#network 192.168.27.0
B(config-router)#redistribute static
Verification
Run the show ip route rip command to check whether router A can receive an RIP route from router B.
A
A(config)#show ip route rip
Common Errors
A key is not correctly associated with a routing protocol, which causes that authentication does not take effect.
The keys configured on multiple routers are not consistent, which causes authentication failure.
10.5 Monitoring
Displaying
Description Command
Displays the configurations of a key show key chain [ key-chain-name ]
chain.
39
Configuration Guide Configuring Routing Policies
11.1 Overview
Routing policies are a policy set for changing the packet forwarding path or routing information and are often implemented by
a filtering list and a route map. Routing policies are flexibly and widely applied in the following methods:
Use a route map in a routing protocol to filter or modify routing information. Where, the route map can further use a
filtering list.
Use a route map in policy-based routing (PBR) to control packet forwarding or modify packet fields.
11.2 Applications
Application Description
Route Filtering Use a filtering list in a routing protocol to filter the routing information sent or received by the
protocol.
Route Re-distribution Use a route map in a routing protocol to filter or modify routing information and re-distribute
RIP routes to OSPF. Only RIP routes with 4 hops can be re-distributed.
PBR Use a route map in PBR to control packet forwarding or modify packet fields and specify
optimum output interfaces for packets from different subnets.
Scenario
Figure 11-1
As shown in Figure 11-1, router A has routes to 3 networks: 10.0.0.0, 20.0.0.0 and 30.0.0.0.
Configure a filtering list on the routers to achieve the following purposes:
11-1
Configuration Guide Configuring Routing Policies
Filter the sent routing information on router A to filter routes that router A does not need to send.
Filter the received routing information on router B to filter routes that router B does not need to learn.
Deployment
Filter the received routing information 20.0.0.0 on router B to ensure that router B learns only routing information
10.0.0.0.
Specify the range for re-distributing routes and re-distribute only routing information that meets certain rules.
Scenario
Figure 111-2
As shown in Figure 111-2, configure route re-distribution on the devices to achieve the following purposes:
In the OSPF routing domain, the initial metric of this route is 40, the route type is the external route type-1 and the route
tag value is set to 40.
Deployment
Configure a route with 4 hops in the route map rip_to_ospf: match, and set the initial metric of this route to 40, the route
type to the external route type-1 and the route tag value to 40.
Configure route re-distribution to re-distribute RIP routes to OSPF and use the route map rip_to_ospf.
11.2.3 PBR
PBR is implemented by applying a route map including policies to interfaces and devices.
Similar to static routing, PBR is also manually configured, where recursive routing supports automatic update with network
changes. As compared with static and dynamic routing, PBR is more flexible. Static and dynamic routing can forward packets
only based on destination addresses. PBR can forward packets based on the source and destination addresses, packet
length and input interface.
Scenario
11-2
Configuration Guide Configuring Routing Policies
Figure 111-3
Configure PBR on the layer-3 device DEV1 to achieve the following purposes:
Deployment
Configure two different ACLs to match packets from subnets 1 and 2 respectively.
Configure the route map RM_FOR_PBR: policy 10 is used to ensure that "packets from subnet 1 are sent from GE0/1
first"; policy 20 is used to ensure that "packets from subnet 2 are sent from GE0/2 first".
Perform PBR for packets received from GE0/3 and use the route map RM_FOR_PBR.
11.3 Features
Overview
Feature Description
Filtering List Define a group of lists based on a route attribute, which can be used by a routing protocol for
route filtering.
Route Map A policy defines "if certain conditions are matched, you can perform certain processing actions".
Working Principle
11-3
Configuration Guide Configuring Routing Policies
Based on different routing attributes, filtering lists are classified into the following types:
ACLs comprise IPv4 and IPv6 ACLs. When defining ACLs, you can specify IPv4/IPv6 addresses and masks to match the
destination network segment or next-hop addresses of routing information.
Similar to ACLs, prefix-lists, including IPv4 prefix-lists and IPv6 prefix-lists, are used to match destination network segments
of routing information during route filtering.
AS-Path List
AS-path lists are used only for BGP. They are used to match AS paths during BGP route filtering.
Community-lists are used only for BGP. They are used to match community attributes during BGP route filtering.
Extcommunity-lists are used only for BGP. They are used to match extended community attributes during BGP route filtering.
Related Configuration
Creating an ACL
In the global configuration mode, run the ip access-list { extended | standard } { id | name } command to create an IPv4
ACL.
You can set multiple policies in an ACL, sorted by their sequence numbers. Policies have two working modes: permit and
deny.
Creating a Prefix-List
In the global configuration mode, run the ip prefix-list prefix-list-name [ seq seq-number ] { deny | permit } ip-prefix [ ge
minimum-prefix-length ] [ le maximum-prefix-length ] command to create an IPv4 prefix-list and add a prefix entry to the list.
You can set multiple entries in the prefix-list, sorted by their sequence numbers. Entries have two working modes: permit and
deny.
Run the ip prefix-list prefix-list-name description descripton-text command to add description to the prefix-list.
Run the ip prefix-list sequence-number command to enable the sorting function for the prefix-list.
11-4
Configuration Guide Configuring Routing Policies
In the global configuration mode, run the ip as-path access-list path-list-num { permit | deny } regular-expression command
to create an AS-path list and add an entry to the list.
You can set multiple entries in the AS-path list. Entries have two working modes: permit and deny.
Creating a Community-List
In the global configuration mode, run the ip community-list { { standard | expanded } community-list-name |
community-list-number } { permit | deny } [ community-number.. ] command to create a community-list and add an entry to
the list.
You can set multiple entries in the community-list. Entries have two working modes: permit and deny.
Creating an Extcommunity-List
In the global configuration mode, run the ip extcommunity-list {standard-list | standard list-name } { permit | deny } [ rt
value] [ soo value ] command to create a standard extcommunity list and add an entry to the list.
Run the ip extcommunity-list {expanded-list | expanded list-name } { permit | deny } [ regular-expression ] command to
create an extcommunity list and add an entry to the list.
You can also run the ip extcommunity-list {expanded-list | expanded list-name| standard-list | standard list-name }
command to create an extcommunity list and enter the configuration mode of ip extcommunity-list to add entries.
You can set multiple entries in the extcommunity-list. Entries have two working modes: permit and deny.
Working Principle
Executing policies
A route map may contain multiple policies. Each policy has a corresponding sequence number. A smaller sequence number
means a higher priority. Policies are executed based on their sequence numbers. Once the matching condition of a policy is
met, the processing action for this policy needs to be performed and the route map exits. If no matching condition of any
policy is met, no processing action will be performed.
permit: When the matching condition of a policy is met, the processing action for this policy will be performed and the
route map will exit.
deny: When the matching condition of a policy is met, the processing action for this policy will not be performed and the
route map will exit.
11-5
Configuration Guide Configuring Routing Policies
If the matching condition contains one or more match rules, all rules must be matched.
If the processing action contains 0 set rule, no processing action will be performed and the route map will directly exit.
If the processing action contains one or more set rules, all processing actions will be performed and then the route map
will exit.
If set rules have different priorities, the set rule with the highest priority will take effect.
Related Configuration
In the global configuration mode, you can run the route-map route-map-name [ permit | deny ] [ sequence-number ]
command to create a route map and add a policy to the route map.
You can set multiple policies in a route map. Each policy uses different sequence numbers.
By default, no match rule is set (that is, the matching condition of a policy contains 0 match rule).
In the route map mode, run the match command to set match rules. One match command is mapped to one match rule.
RGOS provides abundant match commands for setting flexible matching conditions.
Command Description
match as-path Uses the AS_PATH attribute of a BGP route as the matching condition.
match community Uses the community attribute of a BGP route as the matching condition.
match extcommunity Uses the extended community attribute of a BGP route as the matching
condition.
match interface Uses the output interface of a route as the matching condition.
match ip address Uses the destination IPv4 address of a route as the matching condition.
match ip next-hop Uses the next-hop IPv4 address of a route as the matching condition.
match ip route-source Uses the source IPv4 address of a route as the matching condition.
match ipv6 address Uses the destination IPv6 address of a route as the matching condition.
match ipv6 next-hop Uses the next-hop IPv6 address of a route as the matching condition.
match ipv6 route-source Uses the source IPv6 address of a route as the matching condition.
match metric Uses the metric of a route as the matching condition.
11-6
Configuration Guide Configuring Routing Policies
Command Description
match mpls-label Uses whether a route has label information as the matching condition.
match origin Uses the source of a route as the matching condition.
match route-type Uses the type of a route as the matching condition.
match tag Uses the tag value of a route as the matching condition.
By default, no set rule is configured (that is, the processing action of a policy contains 0 set rule).
In the route map mode, run the set command to configure set rules. One set command is mapped to one set rule.
RGOS provides abundant set commands for setting flexible processing actions.
Command Description
set aggregator as Modifies the AS attribute value of a route aggregator.
set as-path prepend Adds a specified as-path attribute value.
set atomic-aggregate Sets the atomic-aggregate attribute of a route.
set comm-list delete Deletes all community attribute values from the community attribute list for a
route matching the match rules.
set community Sets the community attribute value of a route.
set dampening Sets the flapping parameters of a route.
set extcomm-list delete Deletes all extended community attribute values from the extcommunity
attribute list for a route matching the match rules.
set extcommunity Sets the extended community attribute value of a route.
set fast-reroute Sets the backup output interface and next hop of a fast reroute.
set ip default nexthop Specifies the default next hop of a route. This command has a lower priority
than a common route and a higher priority than set default interface.
set ip dscp Modifies the dscp field of an IP packet.
set ip nexthop Specifies the next hop of a route. This command has a higher priority than
set interface.
set ip next-hop verify-availability Specifies the next-hop IP address of a route and checks the accessibility of
the next hop by using a third-party protocol.
set ip precedence Modifies the precedence field of an IP packet.
set ip tos Modifies the tos field of an IP packet.
set ipv6 default next-hop Specifies the default next hop of a route. This command has a lower priority
than a common route and a higher priority than the default route.
set ipv6 global next-hop Specifies the IPv6 next hop of a route, which belongs to a global VRF.
set ipv6 next-hop verify-availability Specifies the next-hop IP address of a route and checks the accessibility of
the next hop by using a third-party protocol.
set ipv6 precedence Sets the priority of an IPv6 packet header.
set level Sets the destination area type to which a route will be directed.
set local-preference Sets the local-preference attribute value of a route.
11-7
Configuration Guide Configuring Routing Policies
Command Description
set metric Modifies the metric value of a route.
set metric-type Sets the metric type of a route.
set mpls-label Sets the MPLS label.
set next-hop Sets the next-hop IP address of a route.
set origin Sets the source attribute of a route.
set originator-id Sets the originator IP address of a route.
set tag Sets the tag value of a route.
set weight Sets the weight value of a route.
11.4 Configuration
Notes
If a match command uses an ACL to define packet matching conditions, the ACL must be configured.
11-8
Configuration Guide Configuring Routing Policies
The Following match Cannot Be Configured with the Following match Commands At the Same Time
Commands
match ip address match ip prefix-list
match ipv6 address match ipv6 prefix-list
match ip next-hop match ip next-hop prefix-list
match ipv6 next-hop match ipv6 next-hop prefix-list
match ip route-source match ip route-source prefix-list
match ipv6 route-source match ipv6 route-source prefix-list
The Following set Commands Cannot Be Configured with the Following set Commands At the Same Time
set next-hop set vrf
set ip next-hop set ip next-hop verify-availability
set ip dscp set ip tos
set ip dscp set ip precedence
Configuration Steps
Mandatory.
Optional.
If multiple match rules are configured, all the match rules must be matched.
Optional.
If multiple set rules are configured, all set rules must be executed (if the set rules have different priorities, the set rule
with the highest priority takes effect).
Verification
Related Commands
11-9
Configuration Guide Configuring Routing Policies
11-10
Configuration Guide Configuring Routing Policies
11-11
Configuration Guide Configuring Routing Policies
Parameter access-list-number: Indicates the access list number. For a standard access list, the value ranges are 1 to
Description 99 and 1300 to 1999. For an extended access list, the value ranges are 100 to 199 and 2000 to 2699.
access-list-name: Indicates the access list name.
prefix-list prefix-list-name: Indicates the name of a prefix-list to be matched.
Command Route map configuration mode
Mode
Usage Guide This match rule matches the source IPv4 address of a route by using an ACL or a prefix-list. An ACL and a
prefix-list cannot be configured at the same time.
11-12
Configuration Guide Configuring Routing Policies
Command match route-type { local | internal | external [ type-1 | type-2 ] | level-1 | level-2}
Parameter local: Indicates a route locally generated.
Description Internal: Indicates an internal OSPF route.
external: Indicates an external route (that of BGP or OSPF).
type-1 | type-2: Indicates type-1 or type-2 external route of OSPF.
level-1 | level-2: Indicates level-1 or level-2 route of ISIS.
11-13
Configuration Guide Configuring Routing Policies
Usage Guide This set rule is used to modify the AS attribute value of a route's aggregator.
11-14
Configuration Guide Configuring Routing Policies
max-suppress-time: Indicates the longest time that a route can be suppressed, ranging from 1 to 255
minutes. The default value is 4 x half-life.
Command Route map configuration mode
Mode
Usage Guide This set rule is used to set the flapping parameters of a route.
11-15
Configuration Guide Configuring Routing Policies
Command set ip next-hop verify-availability ip-address [track track-obj-number | bfd interface-type interface-number
gateway ]
Parameter ip-address: Indicates the next-hop IP address.
Description track: Judges whether the next hop is effective by using Track.
track-obj-number: Indicates the track object number.
bfd: Indicates that BFD is used for neighbor detection.
interface-type: Configures the interface type.
interface-number: Configures the interface number.
gateway: Configures the gateway IP address, which is the neighbor IP address of BFD. If the next hop is
configured as the neighbor, BFD will be used to detect the accessibility of the forwarding path.
Command Route map configuration mode
Mode
Usage Guide This set rule is used to specify the next hop of a route and BFD or Track is used to fast detect the
effectiveness of the next hop.
Command set ip precedence { number | critical | flash | flash-override | immediate | internet | network | priority |
routine }
Parameter number: Indicates the priority of the IP header with a number, ranging from 0 to 7.
Description 7: critical
6: flash
5: flash-override
4: immediate
3: internet
2: network
1: priority
0: routine
critical | flash | flash-override | immediate | internet | network | priority | routine: priority of an IP
header.
11-16
Configuration Guide Configuring Routing Policies
Command set ipv6 next-hop verify-availability global-ipv6-address bfd interface-type interface-number gateway
Parameter global-ipv6-address: Indicates the next-hop IPv6 address.
Description bfd: Indicates that BFD is used for neighbor detection.
11-17
Configuration Guide Configuring Routing Policies
Command set ipv6 precedence { number | critical | flash | flash-override | immediate | internet | network | priority
| routine }
Parameter number: Indicates the priority of the IP header with a number, ranging from 0 to 7.
Description 7: critical
6: flash
5: flash-override
4: immediate
3: internet
2: network
1: priority
0: routine
critical | flash | flash-override | immediate | internet | network | priority | routine: priority of an IP
header.
Command Route map configuration mode
Mode
Usage Guide This set rule is used to set the priority of an IPv6 packet header.
11-18
Configuration Guide Configuring Routing Policies
Usage Guide This set rule is used to set the local-preference attribute value of a route.
11-19
Configuration Guide Configuring Routing Policies
Mode
Usage Guide This set rule is used to set the source attribute of a route.
Configuration Example
Using a Route Map in Route Re-distribution to Filter and Modify Routing Information
Scenario As shown in Figure 111-4, a device is connected to both an OSPF routing domain and RIP routing domain.
Figure 111-4
11-20
Configuration Guide Configuring Routing Policies
Re-distribute only RIP routes with 4 hops to OSPF. In the OSPF route domain, if the route type is the
external route type-1, set the tag value of the route to 40.
Re-distribute only OSPF routes with the tag value 10 to RIP. In the RIP route domain, set the initial
metric value of this route to 10.
Configuration Configure the route map redrip: Match a route with 4 hours, set the initial metric value of the route to
Steps 40, set the route type to the external route type-1, and set the tag value of the route to 40.
Configure the route map redospf: match a route with the tag value 10 and set the initial metric value of
the route to 10.
Configure re-distribution of the RIP route to OSPF and apply the route map redrip.
Configure re-distribution of the OSPF route to RIP and apply the route map redospf.
Ruijie(config-route-map)# exit
Ruijie(config-route-map)# exit
Ruijie(config-router)# exit
Ruijie(config-router)# exit
Verification Check the configurations of the route map to verify the policy rules.
Check the OSPF routing information library to verify that the rules matching the policy rules are
re-distributed.
Match clauses:
11-21
Configuration Guide Configuring Routing Policies
metric 4
Set clauses:
metric 40
metric-type type-1
tag 40
Match clauses:
tag 10
Set clauses:
metric 10
LS age: 5
LS Type: AS-external-LSA
Checksum: 0x554d
Length: 36
Metric Type: 1
TOS: 0
Metric: 4
11-22
Configuration Guide Configuring Routing Policies
Scenario
Figure 111-5
In the redundant backup mode, the sequence of multiple set next hops is the sequence of the priorities
for taking effect.
11-23
Configuration Guide Configuring Routing Policies
Ruijie(config-route-map)# exit
Ruijie(config-route-map)# exit
Verification Check the configurations of PBR to verify that the route map is applied to the interfaces.
Check the configurations of the route map to verify the policy rules.
Check the ACL configurations to verify the packet filtering rules.
Match clauses:
ip address 1
Set clauses:
ip next-hop 200.24.18.1
ip next-hop 200.24.19.1
11-24
Configuration Guide Configuring Routing Policies
Match clauses:
ip address 2
Set clauses:
ip next-hop 200.24.19.1
ip next-hop 200.24.18.1
ip access-list standard 1
ip access-list standard 2
Common Errors
After matching of ACLs and prefix-lists is configured, the corresponding ACLs and prefix lists are not defined.
Notes
A configured filtering list can take effect only after it is associated with a routing protocol.
Configuration Steps
Configuring a Prefix-List
If there is no special requirement, you should perform this configuration on a route for which filtering based on a
prefix-list needs to be performed.
If there is no special requirement, you should perform this configuration on a route for which filtering based on an AS
path needs to be performed.
11-25
Configuration Guide Configuring Routing Policies
If there is no special requirement, you should perform this configuration on a route for which community attributes need
to be filtered.
If there is no special requirement, you should perform this configuration on a route for which extended community
attributes need to be filtered.
Verification
Check the routing table to verify that routes can be correctly filtered.
Related Commands
11-26
Configuration Guide Configuring Routing Policies
Creating a Prefix-List
11-27
Configuration Guide Configuring Routing Policies
Command ipv6 prefix-list prefix-list-name [ seq seq-number ] { deny | permit } ipv6-prefix [ ge minimum-prefix-length ]
[ le maximum-prefix-length ]
Parameter prefix-list-name: Indicates the prefix-list name.
Description seq-number: Assigns a sequence number to an prefix-list entry, ranging from 1 to 2,147,483,647. If this
command does not contain the sequence number, the system will assign a default sequence number to the
prefix-list entry. The default sequence number of the first entry is 5. Subsequently, the default sequence
number of each entry not assigned with a value is the first multiple of 5 greater than the previous sequence
number.
deny: Denies access when certain conditions are matched.
permit: Permits access when certain conditions are matched.
ipv6-prefix: Configures the IP address and mask, ranging from 0 to 128 digits.
minimum-prefix-length: Specifies the minimum range (namely, the start length of a range).
maximum-prefix-length: Specifies the maximum range (namely, the end length of a range).
Command Global configuration mode
Mode
Usage Guide -
11-28
Configuration Guide Configuring Routing Policies
Usage Guide -
Configuration Example
Configuring a Prefix-List
Scenario
Figure 111-6
Configuration Configure an IBGP neighbor and advertise the neighbor to the three connected subnets.
Steps Configure a prefix-list.
Associate a prefix-list with A to filter sent routes.
A
A# configure terminal
A(config-router)# end
11-29
Configuration Guide Configuring Routing Policies
A# show ip bgp
B
B# show ip bgp
S Stale
11-30
Configuration Guide Configuring Routing Policies
Scenario
Figure 111-7
Configuration Create an AS-path filtering rule to match path information including only AS 200.
Steps Establish EBGP neighborship on A with B and C.
Associate an AS-path list with A to filter the routes received from B and C.
A
A(config)# ip as-path access-list 123 permit ^200$
permit ^200$
//When no AS-path list is associated with A, run the show command to check the BGP routing table.
11-31
Configuration Guide Configuring Routing Policies
//When an AS-path list is associated with A, run the show command to display the BGP routing table
and check whether the filtering behavior is correct.
Scenario
Figure 111-8
Configuration Define a standard community list to match the community attribute 100: 20.
Steps Establish EBGP neighborship between A and B.
Advertise a route with the community attribute on B.
Associate the community list on A (BGP can be applied only through a route map) to filter routes
received on B.
A
A(config)# ip community-list standard test permit 100:20
A(config-route-map)# exit
11-32
Configuration Guide Configuring Routing Policies
B
B(config)# route-map comm1
B(config-route-map)# exit
permit 100:20
//When no community list is associated with A, run the show command to check the BGP routing table.
A# show ip bgp
11-33
Configuration Guide Configuring Routing Policies
200
200
Community: 100:20
200
11-34
Configuration Guide Configuring Routing Policies
Community: 200:20
200
//When a community list is associated with A, run the show command to display the BGP routing table
and check whether the filtering behavior is correct.
A# show ip bgp
A#
200
11-35
Configuration Guide Configuring Routing Policies
200
Community: 100:20
Scenario
Figure 111-9
A(config-route-map)# exit
11-36
Configuration Guide Configuring Routing Policies
B
B(config)# route-map ecomm1
B(config-route-map)# exit
10 permit RT:1:100
//When no extcommunity list is associated with A, run the show command to check the BGP routing table.
A# show ip bgp
11-37
Configuration Guide Configuring Routing Policies
A#
200
200
200
11-38
Configuration Guide Configuring Routing Policies
200
//When an extcommunity list is associated with A, run the show command to display the BGP routing
table and check whether the filtering behavior is correct.
A# show ip bgp
A#
11-39
Configuration Guide Configuring Routing Policies
200
200
Common Errors
A filtering list is configured but is not correctly applied in a routing protocol, which causes that the filtering list cannot
take effect.
11.5 Monitoring
Displaying
Description Command
Displays the configurations of a route show route-map [ route-map-name ]
map.
Displays the configurations of an show access-lists [ id | name ]
ACL.
Displays the configurations of an show ip prefix-list [ prefix-name ]
IPv4 prefix-list.
Displays the configurations of an show ipv6 prefix-list [ prefix-name ]
IPv6 prefix-list.
Displays the configurations of an show ip as-path-access-list [ num ]
AS-path list.
11-40
Configuration Guide Configuring Routing Policies
11-41
Configuration Guide Configuring Routing Policies
42