0% found this document useful (0 votes)
6 views85 pages

Routing Configuration for Huawei AR Routers

The document provides configuration examples for Huawei AR Series Access Routers, focusing on deploying various routing protocols such as IP Static Route, RIP, OSPF, and BGP. It includes detailed steps for configuring static routes for IPv4 and IPv6, as well as NQA and BFD for monitoring and failover. Each section outlines the necessary procedures, configuration notes, and verification commands to ensure proper network setup and functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views85 pages

Routing Configuration for Huawei AR Routers

The document provides configuration examples for Huawei AR Series Access Routers, focusing on deploying various routing protocols such as IP Static Route, RIP, OSPF, and BGP. It includes detailed steps for configuring static routes for IPv4 and IPv6, as well as NQA and BFD for monitoring and failover. Each section outlines the necessary procedures, configuration notes, and verification commands to ensure proper network setup and functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Huawei AR Series Access Routers

CLI-based Typical Configuration Examples 8 Deploying Routing

8 Deploying Routing

8.1 IP Static Route


8.2 RIP
8.3 RIPng
8.4 OSPF
8.5 OSPFv3
8.6 IS-IS (IPv4)
8.7 IS-IS (IPv6)
8.8 BGP
8.9 Policy-based Routing
8.10 Routing Policy

8.1 IP Static Route

8.1.1 Example for Configuring IPv4 Static Routes

Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
In Figure 8-1, users on an enterprise network are divided into different subnets
and these users need to communicate with each other. The enterprise network is
not large in scale and requires simple, secure, reliable, and efficient traffic
forwarding. In this case, static routes can be configured to enable any two hosts
on the network to communicate with each other.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 433


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Before configuring IPv4 static routes, configure link layer protocol parameters and
IP addresses for interfaces to ensure that neighboring nodes are reachable at the
network layer.

Figure 8-1 Networking diagram of configuring static routes

Procedure
Step 1 Configure RouterA.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
ip route-static [Link] [Link] [Link] ip route-static [Link] [Link]
[Link] //Configure static routes on RouterA.
#
return

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 434


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Step 2 Configure RouterB.


#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface GigabitEthernet3/0/0
ip address [Link] [Link]
#
ip route-static [Link] [Link] [Link] ip route-static [Link] [Link]
[Link] //Configure static routes on RouterB.
#
return

Step 3 Configure RouterC.


#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
ip route-static [Link] [Link] [Link] ip route-static [Link] [Link]
[Link] //Configure static routes on RouterC.
#
return

Step 4 Configure hosts.


Set the default gateway of hosts in VLAN 10 to [Link], default gateway of hosts
in VLAN 20 to [Link], and default gateway of VLAN 30 to [Link].
Step 5 Configure switches.
Configure switches to allow hosts to communicate with their respective gateways.
Step 6 Verify the configuration.
# Run the display ip routing-table command to view the IP routing table.
# Run the ping command to verify the router connectivity.
----End

Configuration Notes
● Configure IPv4 addresses for routers' interfaces correctly.
● Configure IP addresses on the same network segment for the interfaces
connecting two routers together.
● Configure IPv4 default gateways for hosts.

8.1.2 Example for Configuring NQA for Static IPv4 Routes


Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
NQA for static IPv4 routes can quickly detect network faults and control
advertisement of static routes. As shown in Figure 8-2, RouterA connects to

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 435


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

RouterB through GE2/0/0 and connects to RouterC through GE1/0/0. Two links are
available from RouterA to RouterD: RouterA-->RouterB-->RouterD (primary link)
and RouterA-->RouterC-->RouterD (backup link). Configure an NQA ICMP test
instance on RouterA to detect the active link. When the active link becomes faulty,
packets sent from RouterA to RouterD are switched to the standby link.

Figure 8-2 Networking diagram of configuring NQA for static IPv4 routes

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface GigabitEthernet3/0/0
ip address [Link] [Link]
#
ip route-static [Link] [Link] [Link]
ip route-static [Link] [Link] [Link]
ip route-static [Link] [Link] [Link] preference 100 //Set the preference of static
routes to 100 so that the static routes can be used as backup routes.
ip route-static [Link] [Link] GigabitEthernet2/0/0 [Link] track nqa admin icmp //
Configure a static route to associate it with an NQA test instance.
#
nqa test-instance admin icmp //Configure an NQA test instance named admin icmp.
test-type icmp //Set the test type to ICMP.
destination-address ipv4 [Link] //Set the destination address of the NQA test instance to
[Link].
frequency 10 //Set the interval between two NQA tests to 10s.
probe-count 2 //Set the number of test probes of an NQA test instance to 2.
start now //Start the NQA test instance immediately.
#

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 436


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Step 2 Configure RouterB.


#
sysname RouterB
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
ip route-static [Link] [Link] [Link]
ip route-static [Link] [Link] [Link]
#

Step 3 Configure RouterC.


#
sysname RouterC
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
ip route-static [Link] [Link] [Link]
ip route-static [Link] [Link] [Link]
#

Step 4 Configure RouterD.


#
sysname RouterD
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface GigabitEthernet3/0/0
ip address [Link] [Link]
#
ip route-static [Link] [Link] [Link]
ip route-static [Link] [Link] [Link]
ip route-static [Link] [Link] [Link]
ip route-static [Link] [Link] [Link]
#

Step 5 Verify the configuration.

# Run the display nqa results test-instance admin icmp command on RouterA
to view the NQA test result. The command output displays "Lost packet ratio:
0 %", indicating that the link status is normal. Run the display ip routing-table
command on RouterA to view the IP routing table. The routing table contains the
static route with destination network segment [Link]/24 and next-hop
address [Link]. There is no static route with preference 100 in the routing
table.

# Run the shutdown command in the view of GE1/0/0 or GE2/0/0 on RouterB to


simulate a link failure. Run the display nqa results test-instance admin icmp
command on RouterA to view the NQA test result. The command output displays
"Completion:failed" and "Lost packet ratio: 100 %, indicating that a link failure has
been detected. Then run the display ip routing-table command on RouterA to
view the IP routing table. The routing table contains the static route with

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 437


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

preference 100. There is no static route with destination network segment


[Link]/24 and next-hop address [Link].

----End

Configuration Notes
● The static route associated with an NQA test instance is deleted from the
routing table only when the NQA test fails. You can run the display nqa
results command to view the NQA test result.
● Before modifying the configuration of an NQA test instance, stop the NQA
test instance.
● If the static route associated with one NQA test instance is associated with
another NQA test instance, the association between the static route and the
former NQA test instance is removed.
● Only the NQA ping test instance is used so that RouterA switches services
based on the test result. There is no requirement for the peer device
configuration.

8.1.3 Example for Configuring IPv6 Static Routes


Applicability
This example applies to all AR models of V200R002C00 and later versions.

Networking Requirements
Figure 8-3 shows the IPv6 addresses and masks of hosts and routers' interfaces.
Static routes need to be configured to ensure that any two hosts can
communicate with each other.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 438


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Figure 8-3 Networking diagram of configuring IPv6 static routes

Procedure
Step 1 Configure RouterA.
#
ipv6 //Enable IPv6 forwarding.
#
interface GigabitEthernet1/0/0
ipv6 enable //Enable IPv6 on the interface.
ipv6 address 1::1 64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 2::2 64
#
ipv6 route-static 3:: 64 2::1
ipv6 route-static 4:: 64 2::1
ipv6 route-static 5:: 64 2::1 //Configure static routes on RouterA.
#
return

Step 2 Configure RouterB.


#
ipv6

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 439


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 3::1 64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 2::1 64
#
interface GigabitEthernet3/0/0
ipv6 enable
ipv6 address 4::1 64
#
ipv6 route-static 1:: 64 2::2
ipv6 route-static 5:: 64 4::2
#
return

Step 3 Configure RouterC.


#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 5::1 64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 4::2 64
#
ipv6 route-static 1:: 64 4::1
ipv6 route-static 2:: 64 4::1
ipv6 route-static 3:: 64 4::1
#
return

Step 4 Configure hosts.

Set the default gateway of hosts in VLAN 10 to 1::1, default gateway of hosts in
VLAN 20 to 5::1, and default gateway of VLAN 30 to 3::1.

Step 5 Configure switches.

Configure switches to allow hosts to communicate with their respective gateways.

Step 6 Verify the configuration.

# Run the display ipv6 routing-table command to view the IP routing table.

# Run the ping ipv6 command to verify the router connectivity.

----End

Configuration Notes
● Before configuring an IPv6 routing protocol, enable IPv6 unicast forwarding
on routers. Before configuring IPv6 features on an interface, enable IPv6 on
the interface.
● Configure IPv6 addresses for routers' interfaces correctly.
● Configure default gateways for hosts.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 440


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

8.1.4 Example for Configuring BFD for IPv4 Static Routes

Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
On a company's internal network shown in Figure 8-4, there are two forwarding
paths from Router_1 and Router_2 and with next hops Router_2 and Router_3
respectively. Router_1 and Router_2 are far from each other, and the L2 Switch
acts as the relay agent between Router_1 and Router_2. In this example, Router_2
does not support bidirectional forwarding detection (BFD). BFD for IPv4 static
routes needs to be configured on Router_1 to ensure that Router_1 can fast detect
the failure (for example the Down state) of the link between Router_2 and the L2
Switch and switch traffic to the link of Router_3.

Figure 8-4 Networking diagram of configuring BFD for IPv4 static routes

Device Interface IP Address

Router_1 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

GE2/0/3 [Link]/24

Router_2 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

GE2/0/3 [Link]/24

Router_3 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 441


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Procedure
Step 1 Configure Router_1.
#
sysname Router_1
#
bfd
#
interface GigabitEthernet2/0/1 //Configure an IP address for GigabitEthernet2/0/1 on Router_1.
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
bfd aa bind peer-ip [Link] interface GigabitEthernet0/0/1 one-arm-echo //Configure the BFD
session between Router_1 and Router_2.
discriminator local 1
min-echo-rx-interval 100
commit
#
ip route-static [Link] 24 GigabitEthernet2/0/1 [Link] track bfd-session aa //Configure a static
route from Router_1 to [Link]/24. Ensure that traffic from Router_1 to Router_2 is first forwarded along
the link Router_1 –> L2 Switch –> Router_2. When the link fails, the traffic is switched to the link Router_1 –
> Router_3 –> Router_2.
ip route-static [Link] 24 GigabitEthernet2/0/2 [Link] preference 65
#
return

Step 2 Configure Router_2.


#
sysname Router_2
#
interface GigabitEthernet2/0/1 //Configure an IP address for GigabitEthernet2/0/1 on Router_2.
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
ip route-static [Link] 24 GigabitEthernet2/0/1 [Link] //Configure a static route from Router_2 to
[Link]/24. Ensure that traffic from Router_2 to Router_1 is first forwarded along the link Router_2 –> L2
Switch –> Router_1. When the link fails, the traffic is switched to the link Router_2 –> Router_3 –> Router_1.
ip route-static [Link] 24 GigabitEthernet2/0/2 [Link] preference 65
#
return

Step 3 Configure Router_3.


#
sysname Router_3
#
interface GigabitEthernet2/0/1 //Configure an IP address for GigabitEthernet2/0/1 on Router_3.
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
ip route-static [Link] 24 GigabitEthernet2/0/1 [Link] //Configure static routes from Router_3 to
[Link]/24 and [Link]/24.
ip route-static [Link] 24 GigabitEthernet2/0/2 [Link]
#
return

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 442


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Step 4 Verify the configuration.


# When Router_1, Router_2, and the links between Router_1 and Router_2 are
working normally:
● Run the display ip routing-table protocol static command on Router_1 to
check static route information. The command output shows that there are
reachable routes between Router_1 and Router_2.
● Run the display bfd session all command on Router_1. The command output
shows that a BFD session has been set up.
# When the link between Router_2 and the L2 switch is faulty, run the display ip
routing-table protocol static command on Router_1. The command output
shows that routes are reachable between Router_1 and Router_3.
----End

8.1.5 Example for Configuring AR Routers to Be Connected to


Layer 3 Switches Through IPv4 Static Routes
Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
Figure 8-5 shows IP addresses and masks of hosts and routers' interfaces. Static
routes need to be configured to ensure that any two hosts can communicate with
each other.

Figure 8-5 Configuring IPv4 static routes

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 443


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Procedure
Step 1 Configure the switch.
#
vlan batch 10 20 100
#
interface vlanif 10
ip address [Link] [Link]
#
interface vlanif 20
ip address [Link] [Link]
#
interface vlanif 100
ip address [Link] [Link]
#
interface gigabitEthernet0/0/1
port link-type access
port default vlan 100 //Add GigabitEthernet0/0/1 to VLAN 100 as an access interface. This interface
connects to the router.
#
interface gigabitEthernet0/0/2
port link-type access
port default vlan 10
#
interface gigabitEthernet0/0/3
port link-type access
port default vlan 20
#
ip route-static [Link] [Link] [Link] //Configure a default static route.
#
return

Step 2 Configure the Router.


#
interface GigabitEthernet0/0/0
ip address [Link] [Link] //Configure an IP address for GigabitEthernet0/0/1. This interface
connects to the switch.
#
interface loopback 0
ip address [Link] [Link] //Configure an IP address for the local loopback interface for tests.
#
ip route-static [Link] [Link] [Link] //Configure a static route so that data can reach the
switch.
#
return

Step 3 Configure PCs.

Run the route add [Link] mask 24 [Link] command to configure an IP


address for PC1 and run the route add [Link] mask 24 [Link] command
to configure an IP address for PC2.

Step 4 Verify the configuration.

# Run the display ip routing-table command to view the IP routing table of the
Router.

# Run the ping command to test the connectivity.

----End

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 444


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Configuration Notes
● Configure IPv4 addresses for routers' interfaces correctly.
● Configure IPv4 default gateways for hosts.

8.1.6 Example for Configuring Fixed IP Addresses for Two


Outbound Interfaces in IPv4 Static Routes
Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
To ensure network stability and reliability, you can configure fixed IP addresses for
two outbound interfaces in routes. If a route is unreachable, users can still access
the Internet through the other backup route. The active and standby links are
identified based on the priorities of static routes.

Figure 8-6 Configuring fixed IP addresses for two outbound interfaces in IPv4
static routes

Procedure
Step 1 Configure the Router.
#
sysname Router //Change the device name.
#
acl number 2000
rule 5 permit
#
acl number 2001
rule 5 permit
#
interface gigabitethernet 1/0/0
ip address [Link] 24 //Configure the external network interface 1.
nat outbound 2000
#
interface gigabitethernet 2/0/0
ip address [Link] 24 //Configure the external network interface 2.
nat outbound 2001
#
interface gigabitethernet 3/0/0
ip address [Link] 24 //Configure the internal network interface 3.
#
ip route-static [Link] [Link] [Link]
ip route-static [Link] [Link] [Link]
#

Step 2 Configure PCs.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 445


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Configure [Link] as the default gateway address of PC1.

Step 3 Verify the configuration.

# Run the display ip routing-table command to view the IP routing table of the
Router.

# Run the ping command to test the connectivity.

----End

Configuration Notes
● Configure an ACL to determine for which network segments NAT needs to be
performed.
● Configure NAT in the outbound interface view.

8.2 RIP

8.2.1 Example for Configuring RIP

Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
RIP needs to be configured to ensure that two hosts can communicate with each
other. Figure 8-7 shows the IP addresses and masks of hosts and routers'
interfaces.

Figure 8-7 Networking diagram of configuring RIP

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 446


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Procedure
Step 1 Configure RouterA.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
rip 1
version 2 //Set the RIP version.
network [Link] //Enable RIP on the specified network segment.
network [Link]
#
return

Step 2 Configure RouterB.


#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
rip 1
version 2
network [Link]
network [Link]
#
return

Step 3 Configure hosts.

Set the default gateway of hosts in VLAN 10 to [Link] and the default
gateway of hosts in VLAN 20 to [Link].

Step 4 Configure switches.

Configure switches to allow hosts to communicate with their respective gateways.

Step 5 Verify the configuration.

# Run the display rip process-id route command to view the RIP routing table.
The RIP routing table shows that the routes advertised by RIPv2 contain accurate
subnet masks.

# Run the ping command to verify the router connectivity.

----End

Configuration Notes
● Configure IPv4 addresses for routers' interfaces correctly.
● Configure IP addresses on the same network segment for interfaces
connecting two routers together.
● Configure IPv4 default gateways for hosts.
● Enable RIP on a natural network segment.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 447


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

8.2.2 Example for Configuring BFD for RIP

Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
In Figure 8-8, a company uses a L2 Switch as a relay agent to connect two
departments that are far from each other. Router_1, Router_2, and Router_3 run
Routing Information Protocol (RIP) and establish RIP neighbor relationships to
ensure that they are reachable at the network layer.

Router_3 does not support bidirectional forwarding detection (BFD). The company
wants to configure BFD for RIP on Router_1 and use BFD echo packets to ensure
that BFD can fast detect and notify RIP of the link failure between Router_1 (or
Router_3) and the L2 Switch.

The company wants to configure BFD for RIP on Router_1 and Router_3 to meet
the following requirements:
● Detect the link that passes through the L2 Switch.
● Ensure that the devices can fast detect and notify RIP of the link failure and
switch traffic to the link of Router_2.

Figure 8-8 Networking diagram of configuring BFD for RIP

Device Interface IP Address

Router_1 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

GE2/0/3 [Link]/24

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 448


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Device Interface IP Address

Router_2 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

Router_3 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

GE2/0/3 [Link]/24

Procedure
Step 1 Configure Router_1.
#
sysname Router_1
#
bfd
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
rip bfd static
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
rip 1 //Configure basic RIP functions on Router_1.
version 2
network [Link]
#
bfd 1 bind peer-ip [Link] interface GigabitEthernet2/0/1 one-arm-echo //Configure the BFD echo
function on Router_1.
discriminator local 1
min-echo-rx-interval 200
commit
#
return

Step 2 Configure Router_2.


#
sysname Router_2
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
rip 1 //Configure basic RIP functions on Router_2.
version 2
network [Link]

#
return

Step 3 Configure Router_3.


#
sysname Router_3
#

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 449


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
rip 1 //Configure basic RIP functions on Router_3.
version 2
network [Link]

#
return

Step 4 Verify the configuration.


# Run the display rip 1 bfd session all command on Router_1 to check BFD
session information. The command output shows that a BFD session has been set
up and is in Up state.
# Run the display ip routing-table command on Router_1 to check routes to
[Link]/24. The command output shows that packets from Router_1 are
forwarded to Router_3 through the L2 Switch.

----End

8.3 RIPng

8.3.1 Example for Configuring RIPng


Applicability
This example applies to all AR models of V200R002C00 and later versions.

Networking Requirements
RIPng needs to be configured to ensure that two hosts can communicate with
each other. Figure 8-9 shows the IPv6 addresses and masks of hosts and routers'
interfaces.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 450


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Figure 8-9 Networking diagram of configuring RIPng

Procedure
Step 1 Configure RouterA.
#
ipv6 //Enable IPv6 forwarding.
#
interface GigabitEthernet1/0/0
ipv6 enable //Enable IPv6 on the interface.
ipv6 address 1::1 64
ripng 1 enable //Enable RIPng on the specified interface.
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 2::2 64
ripng 1 enable
#
ripng 1 //Enable RIPng process 1.
#
return

Step 2 Configure RouterB.


#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 3::1 64
ripng 1 enable
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 2::1 64
ripng 1 enable
#
ripng 1
#
return

Step 3 Configure hosts.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 451


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Set the default gateway of hosts in VLAN 10 to 1::1 and the default gateway of
hosts in VLAN 20 to 3::1.
Step 4 Configure switches.
Configure switches to allow hosts to communicate with their respective gateways.
Step 5 Verify the configuration.
# Run the display ripng process-id route command to view the RIPng routing
table. The RIPng routing table contains the routes advertised by RIPng.
# Run the ping ipv6 command to verify the router connectivity.

----End

Configuration Notes
● Before configuring an IPv6 routing protocol, enable IPv6 unicast forwarding
on routers. Before configuring IPv6 features on an interface, enable IPv6 on
the interface.
● Configure IPv6 addresses for routers' interfaces.
● Configure IP addresses on the same network segment for interfaces
connecting two routers together.
● Configure default gateways for hosts.

8.4 OSPF

8.4.1 Example for Configuring OSPF


Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
An enterprise does not want to spend a large amount of manpower to maintain
network performance, and requires that new routes be calculated based on route
update packets. In this case, OSPF can be deployed to ensure network stability and
interconnection.
Before configuring basic OSPF functions, configure IP addresses for interfaces to
ensure that neighboring nodes are reachable at the network layer.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 452


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Figure 8-10 Networking diagram of configuring OSPF

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
router id [Link] //Set the router ID. You are advised to set the IP address of Loopback0 as the router ID.
#
vlan batch 10
#
interface Vlanif10
ip address [Link] [Link]
#
interface Ethernet2/0/0
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet3/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
area [Link]
network [Link] [Link] //Specify the network segment where the interface running OSPF process
2 as [Link]/24 and the area to which the interface belongs as Area 0.
network [Link] [Link]
#

Step 2 Configure RouterB.


#
sysname RouterB
#
router id [Link]
#
vlan batch 20
#
interface Vlanif20
ip address [Link] [Link]

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 453


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
interface Ethernet2/0/0
port link-type trunk
port trunk allow-pass vlan 20
#
interface GigabitEthernet3/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
area [Link]
network [Link] [Link]
network [Link] [Link]
#

Step 3 Configure hosts.

Set the default gateway of PC1 to [Link] and the default gateway of PC2 to
[Link].

Step 4 Configure switches.

Configure switches to allow hosts to communicate with their respective gateways.

Step 5 Verify the configuration.

# PC1 can successfully ping the IP address of PC2.

----End

Configuration Notes
● Configure the interface of SwitchA connected to RouterA as a trunk interface
and add it to VLAN 10.
● Configure the interface of SwitchB connected to RouterB as a trunk interface
and add it to VLAN 20.
● Each router ID in an OSPF process must be unique. Otherwise, the OSPF
neighbor relationship cannot be established and the routing information is
incorrect.
● GE3/0/0 interfaces on RouterA and RouterB must belong to the same OSPF
area.

8.4.2 Example for Configuring an OSPF Virtual Link

Applicability
This example applies to all versions and AR routers.

Networking Requirements
Area 2 is not directly connected to Area 0. Area 1 functions as a transit area to
connect Area 2 and Area 0. A virtual link needs to be established between RouterA
and RouterB so that RouterA can learn routes from Area 2. OSPF area
authentication needs to be performed on all OSPF neighbors and OSPF interface
authentication needs to be performed on all interfaces.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 454


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Figure 8-11 Networking diagram of configuring an OSPF virtual link

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
router id [Link] //Set the router ID. You are advised to set the IP address of Loopback0 as the router ID.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
ospf authentication-mode hmac-sha256 //Set the authentication mode to hmac-sha256 authentication.
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
ospf authentication-mode hmac-sha256
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
area [Link]
authentication-mode hmac-sha256 //Set the authentication mode to hmac-sha256 authentication.
network [Link] [Link] //Specify the network segment where the interface running OSPF process
2 as [Link]/24 and the area to which the interface belongs as Area 0.
area [Link]
authentication-mode hmac-sha256
network [Link] [Link]
vlink-peer [Link] //Create a virtual link with the remote router ID as [Link].
#

Step 2 Configure RouterB.


#
sysname RouterB
#
router id [Link]
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
ospf authentication-mode hmac-sha256
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
ospf authentication-mode hmac-sha256
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 455


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

area [Link]
authentication-mode hmac-sha256
network [Link] [Link]
vlink-peer [Link]
area [Link]
authentication-mode hmac-sha256
network [Link] [Link]
#

Step 3 Verify the configuration.


# Run the display ip routing-table command on RouterA to view the IP routing
table. The command output shows that there are OSPF routes to network
segment [Link]/24.
----End

Configuration Notes
● Each router ID in an OSPF process must be unique. Otherwise, the OSPF
neighbor relationship cannot be established and the routing information is
incorrect.
● When area authentication is used, all the routers in an area must have the
same authentication mode and password.
● When interface authentication is used, interfaces on the same network
segment must have the same authentication mode and password. The
interface authentication mode takes precedence over the area authentication
mode.
● Routers on two ends must have the same virtual link authentication mode
and password.

8.4.3 Example for Configuring an OSPF Stub Area


Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
RouterA and RouterB run in Area 0, and RouterB and RouterC run in Area 1.
RouterB is an ABR. Area 1 needs to be configured as a stub area so that RouterC
can use the default route advertised by the ABR to access the network outside the
area.

Figure 8-12 Networking diagram of configuring an OSPF stub area

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 456


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
router id [Link] //Set the router ID. You are advised to set the IP address of Loopback0 as the router ID.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
import-route direct //Configure the router to import direct routes.
area [Link]
network [Link] [Link] //Specify the network segment where the interface running OSPF process
2 as [Link]/24 and the area to which the interface belongs as Area 0.
#

Step 2 Configure RouterB.


#
sysname RouterB
#
router id [Link]
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
area [Link]
network [Link] [Link]
area [Link]
network [Link] [Link]
stub //Configure Area 1 as a stub area.
#

Step 3 Configure RouterC.


#
sysname RouterC
#
router id [Link]
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
area [Link]
network [Link] [Link]
stub
#

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 457


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Step 4 Verify the configuration.


# Run the ping command on RouterC. The command output shows that RouterC
can communicate with devices on network segments [Link]/24 and
[Link]/24.
# Run the display ip routing-table command on RouterB to view the IP routing
table. The routing table contains the direct route imported by RouterA.

----End

Configuration Notes
● Each router ID in an OSPF process must be unique. Otherwise, the OSPF
neighbor relationship cannot be established and the routing information is
incorrect.
● All the routers in a stub area must be configured with stub attributes.

8.4.4 Example for Configuring an OSPF NSSA


Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
RouterA and RouterB run in Area 0, and RouterB and RouterC run in Area 1.
RouterB is an ABR. Area 1 needs to be configured as an NSSA so that RouterC can
use the default route advertised by the ABR to access the network outside the
area.

Figure 8-13 Networking diagram of configuring an OSPF NSSA

Procedure
Step 1 Configure RouterA.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 458


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
sysname RouterA
#
router id [Link] //Set the router ID. You are advised to set the IP address of Loopback0 as the router ID.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
import-route direct //Configure the router to import direct routes.
area [Link]
network [Link] [Link] //Specify the network segment where the interface running OSPF process
2 as [Link]/24 and the area to which the interface belongs as Area 0.
#

Step 2 Configure RouterB.


#
sysname RouterB
#
router id [Link]
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
area [Link]
network [Link] [Link]
area [Link]
network [Link] [Link]
nssa default-route-advertise //Configure Area 1 as an NSSA and configure default Type7 LSAs to be
generated on the ABR and advertised to the NSSA.
#

Step 3 Configure RouterC.


#
sysname RouterC
#
router id [Link]
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
import-route direct
area [Link]
network [Link] [Link]
nssa //Configure Area 1 as an NSSA.
#

Step 4 Verify the configuration.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 459


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

# Run the ping command on RouterC. The command output shows that RouterC
can communicate with devices on network segments [Link]/24 and
[Link]/24.

# Run the display ip routing-table command on RouterB to view the IP routing


table. The routing table contains the direct routes imported by RouterA and
RouterC.

----End

Configuration Notes
● Each router ID in an OSPF process must be unique. Otherwise, the OSPF
neighbor relationship cannot be established and the routing information is
incorrect.
● All the routers in an NSSA must be configured with NSSA attributes.

8.4.5 Example for Configuring Route Summarization in an


OSPF Area
Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
RouterA and RouterB run in Area 0, and RouterB and RouterC run in Area 1.
RouterB is an ABR. RouterB is required to summarize routes of specified network
segments that are learned from RouterA and advertise the summarized routes to
RouterC.

Figure 8-14 Networking diagram of configuring OSPF area route summarization

Procedure
Step 1 Configure RouterA.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 460


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
sysname RouterA
#
router id [Link] //Set the router ID. You are advised to set the IP address of Loopback0 as the router ID.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface GigabitEthernet3/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
area [Link]
network [Link] [Link] //Specify the network segment where the interface running OSPF process
2 as [Link]/24 and the area to which the interface belongs as Area 0.
network [Link] [Link]
network [Link] [Link]
#

Step 2 Configure RouterB.


#
sysname RouterB
#
router id [Link]
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
area [Link]
abr-summary [Link] [Link] //Configure route summarization on the ABR.
network [Link] [Link]
area [Link]
network [Link] [Link]
#

Step 3 Configure RouterC.


#
sysname RouterC
#
router id [Link]
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
area [Link]
network [Link] [Link]
#

Step 4 Verify the configuration.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 461


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

# Run the display ip routing-table command on RouterC to view the IP routing


table. The routing table contains the OSPF routes to network segments
[Link]/23 and [Link]/24 that are advertised from RouterB.

----End

Configuration Notes
● Each router ID in an OSPF process must be unique. Otherwise, the OSPF
neighbor relationship cannot be established and the routing information is
incorrect.

8.4.6 Example for Configuring OSPF to Summarize Imported


Routes
Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
RouterA and RouterB run in Area 0, and RouterB and RouterC run in Area 1.
RouterA is an ASBR and RouterB is an ABR. RouterA is required to summarize
imported direct routes and advertise the summarized routes to other routers in
the same OSPF AS.

Figure 8-15 Networking diagram of configuring OSPF to summarize imported


routes

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
router id [Link] //Set the router ID. You are advised to set the IP address of Loopback0 as the router ID.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 462


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface GigabitEthernet3/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
asbr-summary [Link] [Link] //Configure the ASBR to summarize imported routes.
import-route direct //Configure the ASBR to import direct routes.
area [Link]
network [Link] [Link] //Specify the network segment where the interface running OSPF process
2 as [Link]/24 and the area to which the interface belongs as Area 0.
#

Step 2 Configure RouterB.


#
sysname RouterB
#
router id [Link]
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
area [Link]
network [Link] [Link]
area [Link]
network [Link] [Link]
#

Step 3 Configure RouterC.


#
sysname RouterC
#
router id [Link]
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
ospf 2
area [Link]
network [Link] [Link]
#

Step 4 Verify the configuration.


# Run the display ip routing-table command on RouterB to view the IP routing
table. The routing table contains the imported direct route of network segment
[Link]/23 that is advertised by RouterA.
# Run the display ip routing-table command on RouterC to view the IP routing
table. The routing table contains the imported direct route of network segment
[Link]/23 that is advertised by RouterA.

----End

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 463


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Configuration Notes
● Each router ID in an OSPF process must be unique. Otherwise, the OSPF
neighbor relationship cannot be established and the routing information is
incorrect.
● Imported intra-area routes must be summarized by an ASBR but not an ABR.

8.4.7 Example for Configuring OSPF Route Filtering

Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
As shown in Figure 8-16, Company A uses Open Shortest Path First (OSPF) to
implement interconnection between all devices. Company A merges with
Company B that uses the Routing Information Protocol (RIP), requiring OSPF and
RIP to import routes to each other so that departments can communicate.
Router_1 and Router_2 function as core devices to ensure communication between
departments. To meet service requirements, Company A needs to control and
adjust network routes by taking the following measures:
● Filter the imported routes on Router_5 to prevent R&D department 2 from
accessing Marketing department 1, R&D department 1, and After-sales Service
department.
● Filter routes on Router_3 to prevent Marketing department 1 from accessing
R&D department 1.
● Filter routes on Router_4 to prevent R&D department 1 and After-sales
Service department from accessing Marketing department 2.

Figure 8-16 Networking diagram of configuring OSPF route filtering

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 464


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Device Interface IP Address Device Interface IP Address

Router_1 GE2/0/1 [Link]/24 Router_2 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24 GE2/0/2 [Link]/24

GE2/0/3 [Link]/24

Router_3 GE2/0/1 [Link]/24 Router_4 GE2/0/1 [Link]/24

GE2/0/2 [Link]/2 GE2/0/2 [Link]/2


4 (network 4 (network
segment segment
where where
Marketing After-sales
departmen Service
t 1 resides) departmen
t resides)

GE2/0/3 [Link]/2
4 (network
segment
where R&D
departmen
t 1 resides)

Router_5 GE2/0/1 [Link]/24 Router_6 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24 GE2/0/2 [Link]/2


4 (network
segment
where R&D
departmen
t 2 resides)

GE2/0/3 [Link]/2
4 (network
segment
where
Marketing
departmen
t 2 resides)

Procedure
Step 1 Configure Router_1.
#
sysname Router_1
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 465


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

ip address [Link] [Link]


#
ospf 1 //Enable OSPF on the specified network segment.
area [Link]
network [Link] [Link]
area [Link]
network [Link] [Link]
area [Link]
network [Link] [Link]
#
return

Step 2 Configure Router_2.


#
sysname Router_2
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
ospf 1 //Enable OSPF on the specified network segment.
area [Link]
network [Link] [Link]
area [Link]
network [Link] [Link]
#
return

Step 3 Configure Router_3.


#
sysname Router_3
#
acl number 2000 //Create a basic ACL to deny packets with the source IP address [Link]/24.
rule 0 deny source [Link] [Link]
rule 5 permit
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
ospf 1 //Enable OSPF on the specified network segment.
filter-policy 2000 import //Use ACL 2000 to filter the routes to be added to the routing table.
area [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 4 Configure Router_4.


#
sysname Router_4
#
acl number 2000 //Create a basic ACL to deny packets with the source IP address [Link]/24.
rule 0 deny source [Link] [Link]
rule 5 permit
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 466


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

ospf 1 //Enable OSPF on the specified network segment.


filter-policy 2000 import //Use ACL 2000 to filter the routes to be added to the routing table.
area [Link]
network [Link] [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 5 Configure Router_5.


#
sysname Router_5
#
acl number 2000 //Create a basic ACL to deny packets with the source IP address [Link]/24.
rule 0 deny source [Link] [Link]
rule 5 permit
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
ospf 1 //Enable OSPF on the specified network segment.
import-route direct //Import direct routes into the OSPF network.
import-route rip 1 //Import RIP routes into the OSPF network.
filter-policy 2000 export rip 1 //Use ACL 2000 to filter the RIP routes to be imported into OSPF.
area [Link]
network [Link] [Link]
#
rip 1 //Enable RIP on the specified network segment.
undo summary
version 2
network [Link]
import-route direct //Import direct routes into the RIP network.
import-route ospf 1 //Import OSPF routes into the RIP network.
#
return

Step 6 Configure Router_6.


#
sysname Router_6
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
rip 1 //Enable RIP on the specified network segment.
undo summary
version 2
network [Link]
network [Link]
network [Link]
#
return

Step 7 Verify the configuration.


# On Router_3, ping the destination address [Link] from the source address
[Link]. The ping operation fails, indicating that Marketing department 1 cannot
access R&D department 1.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 467


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

# On Router_4, ping the destination address [Link] from source addresses


[Link] and [Link]. The ping operations fail, indicating that R&D department
1 and After-sales Service department cannot access Marketing department 2.
# Check information about Router_3 and Router_4 routing tables. The two routing
tables do not contain routes to [Link]/24, indicating that R&D department 2
cannot access Marketing department 1, R&D department 1, and After-sales Service
department.

----End

Configuration Notes
● When filtering routes, you need to specify the export keyword to filter
imported external routes. This keyword is only applicable to an autonomous
system boundary router (ASBR).
● The route filtering function filters only the routes in routing tables but not the
LSAs advertised in OSPF.
● Routing communication is bidirectional. After you filter routes from a router
to a specified destination network segment, other network segments
connected to the router cannot access devices on the destination network
segment and devices on the destination network segment cannot access
devices on the source network segment.
● When using ACLs to implement the route filtering function, you must set the
last ACL to permit the packets sent from all source addresses to avoid filtering
the routes of all network segments.

8.4.8 Example for Configuring BFD for OSPF


Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
Figure 8-17 shows a company's network architecture. The company wants to not
only ensure network connectivity at Layer 3, but also quickly detect and monitor
the connectivity of links or IP routes on the network. BFD for OSPF can be
deployed to meet the company's requirements. BFD control packets are
transmitted to quickly detect link failures between Router_1 or Router_3 and the
Layer 2 switch, and BFD will notify OSPF of the link failures.
BFD for OSPF can be configured on Router_1 and Router_3 to meet the following
requirements:
● Detect the status of links along which the Layer 2 switch resides.
● Ensure that devices can quickly detect and notify OSPF of the link failure and
switch traffic to the link of Router_2.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 468


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Figure 8-17 Networking diagram of configuring BFD for OSPF

Device Interface IP Address

Router_1 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

GE2/0/3 [Link]/24

Host A - [Link]/24

Router_2 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

Router_3 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

GE2/0/3 [Link]/24

Host C - [Link]/24

Procedure
Step 1 Configure Router_1.
#
sysname Router_1
#
bfd
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
ospf bfd enable //Enable BFD on the interface.
ospf bfd min-tx-interval 100 min-rx-interval 100
#
interface GigabitEthernet2/0/2

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 469


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

ip address [Link] [Link]


#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
ospf 1 //Configure basic OSPF functions on Router_1, and enable BFD for OSPF.
bfd all-interfaces enable
area [Link]
network [Link] [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 2 Configure Router_2.


#
sysname Router_2
#
bfd
#
acl number 2000 //Create ACL 2000 to permit packets with the source IP address [Link]/24.
rule 0 permit source [Link] [Link]
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
ospf 1 //Configure basic OSPF functions on Router_2.
bfd all-interfaces enable
area [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 3 Configure Router_3.


#
sysname Router_3
#
bfd
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
ospf bfd enable //Enable BFD on the interface.
ospf bfd min-tx-interval 100 min-rx-interval 100
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
ospf 1 //Configure basic OSPF functions on Router_3, and enable BFD for OSPF.
bfd all-interfaces enable
area [Link]
network [Link] [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 4 Verify the configuration.

# Run the ping command to check whether there are reachable routes from Host
A at [Link] connected to Router_1 to Host C at [Link] connected to

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 470


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Router_3. The command output shows that there are reachable routes from Host
A to Host C.
# Run the display ospf peer command on Router_1 to check OSPF neighbor
information. The command output shows that Router_1 and Router_3 have
established an OSPF neighbor relationship.
# Run the display ospf bfd session all command on Router_1 and Router_3 to
check BFD session information. The command output shows that a BFD session
has been set up between Router_1 and Router_3 and is in Up state.
# Run the display ip routing-table [Link] verbose command on Router_1 to
check routes to [Link]/24. The command output shows that Router_1 and
Router_3 communicate through the Layer 2 switch.
----End

8.5 OSPFv3

8.5.1 Example for Configuring OSPFv3


Applicability
This example applies to all AR models of V200R002C00 and later versions.

Networking Requirements
OSPFv3 runs on RouterA, RouterB, and RouterC. RouterA and RouterC import
direct routes. PC1 and PC2 connect to RouterA and RouterC respectively. It is
required that PC1 and PC2 successfully ping each other.

Figure 8-18 Networking diagram of configuring OSPFv3

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 471


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
ipv6 //Enable IPv6 unicast forwarding.
#
ospfv3 2
router-id [Link] //Set the router ID of the router running OSPFv3 process 2 to [Link].
import-route direct //Configure the router to import external routes.
#
interface GigabitEthernet1/0/0
ipv6 enable //Enable IPv6 on the interface.
ipv6 address 1999::1/64
#
interface GigabitEthernet2/0/0
ipv6 enable //Enable IPv6 on the interface.
ipv6 address 2000::1/64
ospfv3 2 area [Link] //Configure OSPFv3 process 2 on the interface and specify the area to which the
interface belongs as Area 0.
#

Step 2 Configure RouterB.


#
sysname RouterB
#
ipv6
#
ospfv3 2
router-id [Link]
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 2001::1/64
ospfv3 2 area [Link]
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 2000::2/64
ospfv3 2 area [Link]
#

Step 3 Configure RouterC.


#
sysname RouterC
#
ipv6
#
ospfv3 2
router-id [Link]
import-route direct
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 2002::1/64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 2001::2/64
ospfv3 2 area [Link]
#

Step 4 Verify the configuration.


# PC1 and PC2 can successfully ping each other.
----End

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 472


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Configuration Notes
● The OSPFv3 router ID must be manually configured. If no router ID is
configured, OSPFv3 cannot run properly.
● The ID of each router in an AS must be unique. If multiple OSPFv3 processes
run on the same router, set a unique router ID for each process.
● Before configuring an IPv6 routing protocol, enable IPv6 unicast forwarding
on routers. Before configuring IPv6 features on an interface, enable IPv6 on
the interface.

8.5.2 Example for Configuring Two OSPFv3 Processes for


Communication
Applicability
This example applies to all AR models of V200R002C00 and later versions.

Networking Requirements
OSPFv3 process 2 runs on RouterA and RouterB, and OSPFv3 process 3 runs on
RouterB and RouterC. It is required that GE1/0/0 interfaces on RouterA and
RouterC successfully ping each other.

Figure 8-19 Networking diagram of configuring two OSPFv3 processes for


communication

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
ipv6 //Enable IPv6 unicast forwarding.
#
ospfv3 2
router-id [Link] //Set the router ID of the router running OSPFv3 process 2 to [Link].
#
interface GigabitEthernet1/0/0
ipv6 enable //Enable IPv6 on the interface.
ipv6 address 1999::1/64
ospfv3 2 area [Link] //Configure OSPFv3 process 2 on the interface and specify the area to which the

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 473


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

interface belongs as Area 0.


#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 2000::1/64
ospfv3 2 area [Link]
#

Step 2 Configure RouterB.


#
sysname RouterB
#
ipv6
#
ospfv3 2
router-id [Link]
import-route ospfv3 3 //Configure the router to import routes from OSPFv3 process 3.
#
ospfv3 3
router-id [Link]
import-route ospfv3 2
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 2001::1/64
ospfv3 3 area [Link]
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 2000::2/64
ospfv3 2 area [Link]
#

Step 3 Configure RouterC.


#
sysname RouterC
#
ipv6
#
ospfv3 3
router-id [Link]
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 2002::1/64
ospfv3 3 area [Link]
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 2001::2/64
ospfv3 3 area [Link]
#

Step 4 Verify the configuration.

# Run the ping ipv6 -a 1999::1 2002::1 command on RouterA. The command
output shows that GE1/0/0 interfaces on RouterA and RouterC successfully ping
each other.

----End

Configuration Notes
● The OSPFv3 router ID must be manually configured. If no router ID is
configured, OSPFv3 cannot run properly.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 474


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

● You must configure different router IDs for routers in an AS and specify
different router IDs for multiple OSPFv3 processes running on the same
router.
● Before configuring an IPv6 routing protocol, enable IPv6 unicast forwarding
on routers. Before configuring IPv6 features on an interface, enable IPv6 on
the interface.

8.5.3 Example for Configuring OSPFv3 Route Filtering


Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
As shown in Figure 8-20, Company A uses Open Shortest Path First version 3
(OSPFv3) to implement interconnection between all devices. Company A merges
with Company B that uses the Routing Information Protocol next generation
(RIPng), requiring OSPFv3 and RIPng to import routes to each other so that
departments can communicate. Router_1 and Router_2 function as core devices to
ensure communication between departments. To meet service requirements,
Company A needs to control and adjust network routes by taking the following
measures:
● Filter the imported routes on Router_5 to prevent R&D department 2 from
accessing Marketing department 1, R&D department 1, and After-sales Service
department.
● Filter routes on Router_3 to prevent Marketing department 1 from accessing
R&D department 1.
● Filter routes on Router_4 to prevent R&D department 1 and After-sales
Service department from accessing Marketing department 2.

Figure 8-20 Networking diagram of configuring OSPFv3 route filtering

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 475


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Device Interface IPv6 Device Interface IPv6


Address Address

Router_1 GE2/0/1 FC01::1/64 Router_2 GE2/0/1 FC01::2/64

GE2/0/2 FC02::1/64 GE2/0/2 FC03::1/64

GE2/0/3 FC04::1/64

Router_3 GE2/0/1 FC02::2/64 Router_4 GE2/0/1 FC03::2/64

GE2/0/2 FC13::1/64 GE2/0/2 FC11::1/64


(network (network
segment segment
where where
Marketing After-sales
departmen Service
t 1 resides) departmen
t resides)

GE2/0/3 FC12::1/64
(network
segment
where R&D
departmen
t 1 resides)

Router_5 GE2/0/1 FC04::2/64 Router_6 GE2/0/1 FC05::2/64

GE2/0/2 FC05::1/64 GE2/0/2 FC14::1/64


(network
segment
where R&D
departmen
t 2 resides)

GE2/0/3 FC15::1/64
(network
segment
where
Marketing
departmen
t 2 resides)

Procedure
Step 1 Configure Router_1.
#
sysname Router_1
#
ipv6
#
interface GigabitEthernet2/0/1
ipv6 enable
ipv6 address FC01::1/64
ospfv3 1 area [Link]

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 476


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
interface GigabitEthernet2/0/2
ipv6 enable
ipv6 address FC02::1/64
ospfv3 1 area [Link]
#
interface GigabitEthernet2/0/3
ipv6 enable
ipv6 address FC04::1/64
ospfv3 1 area [Link]
#
ospfv3 1 //Create an OSPFv3 process, and enable OSPFv3 on Router_1 interfaces.
router-id [Link]
area [Link]
area [Link]
area [Link]
#
return

Step 2 Configure Router_2.


#
sysname Router_2
#
ipv6
#
interface GigabitEthernet2/0/1
ipv6 enable
ipv6 address FC01::2/64
ospfv3 1 area [Link]
#
interface GigabitEthernet2/0/2
ipv6 enable
ipv6 address FC03::1/64
ospfv3 1 area [Link]
#
ospfv3 1 //Create an OSPFv3 process, and enable OSPFv3 on Router_2 interfaces.
router-id [Link]
area [Link]
area [Link]
#
return

Step 3 Configure Router_3.


#
sysname Router_3
#
acl ipv6 number 2000 //Create a basic IPv6 ACL to deny packets with the source IPv6 address FC12::1/64.
rule 0 deny source FC12::/64
rule 5 permit
#
ipv6
#
interface GigabitEthernet2/0/1
ipv6 enable
ipv6 address FC02::2/64
ospfv3 1 area [Link]
#
interface GigabitEthernet2/0/2
ipv6 enable
ipv6 address FC13::1/64
ospfv3 1 area [Link]
#
ospfv3 1 //Create an OSPFv3 process, and enable OSPFv3 on Router_3 interfaces.
router-id [Link]
filter-policy 2000 import //Use IPv6 ACL 2000 to filter the routes to be added to the routing table.
area [Link]
#
return

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 477


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Step 4 Configure Router_4.


#
sysname Router_4
#
acl ipv6 number 2000 //Create a basic IPv6 ACL to deny packets with the source IPv6 address FC15::1/64.
rule 0 deny source FC15::/64
rule 5 permit
#
ipv6
#
interface GigabitEthernet2/0/1
ipv6 enable
ipv6 address FC03::2/64
ospfv3 1 area [Link]
#
interface GigabitEthernet2/0/2
ipv6 enable
ipv6 address FC11::1/64
ospfv3 1 area [Link]
#
interface GigabitEthernet2/0/3
ipv6 enable
ipv6 address FC12::1/64
ospfv3 1 area [Link]
#
ospfv3 1 //Create an OSPFv3 process, and enable OSPFv3 on Router_4 interfaces.
router-id [Link]
filter-policy 2000 import //Use IPv6 ACL 2000 to filter the routes to be added to the routing table.
area [Link]
#
return

Step 5 Configure Router_5.


#
sysname Router_5
#
acl ipv6 number 2000 //Create a basic IPv6 ACL to deny packets with the source IPv6 address FC14::1/64.
rule 0 deny source FC14::/64
rule 5 permit
#
ipv6
#
interface GigabitEthernet2/0/1
ipv6 enable
ipv6 address FC04::2/64
ospfv3 1 area [Link]
#
interface GigabitEthernet2/0/2
ipv6 enable
ipv6 address FC05::1/64
ripng 1 enable
#
ospfv3 1 //Create an OSPFv3 process, and enable OSPFv3 on Router_5 interfaces.
router-id [Link]
filter-policy 2000 export ripng 1 //Use IPv6 ACL 2000 to filter the RIPng routes to be imported into
OSPFv3.
import-route direct //Import direct routes into the OSPFv3 network.
import-route ripng 1 //Import RIPng routes into the OSPFv3 network.
area [Link]
#
ripng 1 //Create a RIPng process, and enable RIPng on Router_5 interfaces.
import-route direct //Import direct routes into the RIPng network.
import-route ospfv3 1 //Import OSPFv3 routes into the RIPng network.
#
return

Step 6 Configure Router_6.


#
sysname Router_6

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 478


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
ipv6
#
interface GigabitEthernet2/0/1
ipv6 enable
ipv6 address FC05::2/64
ripng 1 enable
#
interface GigabitEthernet2/0/2
ipv6 enable
ipv6 address FC14::1/64
ripng 1 enable
#
interface GigabitEthernet2/0/3
ipv6 enable
ipv6 address FC15::1/64
ripng 1 enable
#
ripng 1 //Create a RIPng process, and enable RIPng on Router_6 interfaces.
#
return

Step 7 Verify the configuration.


# On Router_3, ping the destination address FC12::1 from the source address
FC13::1. The ping operation fails, indicating that Marketing department 1 cannot
access R&D department 1.
# On Router_4, ping the destination address FC15::1 from source addresses FC11::1
and FC12::1. The ping operations fail, indicating that R&D department 1 and After-
sales Service department cannot access Marketing department 2.
# Check information about Router_3 and Router_4 routing tables. The two routing
tables do not contain routes to FC14::/64, indicating that R&D department 2
cannot access Marketing department 1, R&D department 1, and After-sales Service
department.

----End

Configuration Notes
● When filtering routes, you need to specify the export keyword to filter
imported external routes. This keyword is only applicable to an autonomous
system boundary router (ASBR).
● The route filtering function filters only the routes in routing tables but not the
LSAs advertised in OSPFv3.
● Routing communication is bidirectional. After you filter routes from a router
to a specified destination network segment, other network segments
connected to the router cannot access devices on the destination network
segment and devices on the destination network segment cannot access
devices on the source network segment.
● When using ACLs to implement the route filtering function, you must set the
last ACL to permit the packets sent from all source addresses to avoid filtering
the routes of all network segments.
● When configuring OSPFv3, you must specify the router ID.

8.6 IS-IS (IPv4)

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 479


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

8.6.1 Example for Configuring IS-IS Route Leaking


Applicability
This example applies to all AR models of all versions.

Networking Requirements
As shown in Figure 8-21, the company headquarters and branch 1 use
Intermediate System to Intermediate System (IS-IS) for communication. An
independent network has been deployed for the Marketing department and
Finance department in the headquarters. Branch 2 uses Open Shortest Path First
(OSPF). The company has the following requirements:
● The Marketing department and Finance department in the headquarters can
communicate. The route leaking function is configured so that branches can
communicate normally with the headquarters and Marketing department but
cannot communicate with the Finance department and cannot view routes of
the Finance department.
● OSPF routes of branch 2 are imported into the branch network so that the
Marketing department can communicate with branch 2.
● Communication is not interrupted when the IS-IS process of the headquarter
gateway Router_3 restarts.

Figure 8-21 Networking diagram of configuring IS-IS route leaking

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 480


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Procedure
Step 1 Configure Router_1.
#
sysname Router_1
#
isis 1 //Configure basic IS-IS functions.
is-level level-1
network-entity 10.0000.0000.1001.00
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
isis enable 1
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
isis enable 1
#
return

Step 2 Configure Router_2.


#
sysname Router_2
#
isis 1 //Configure basic IS-IS functions.
is-level level-1
network-entity 10.0000.0000.2001.00
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
isis enable 1
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
isis enable 1
#
return

Step 3 Configure Router_3.


#
sysname Router_3
#
isis 1 //Configure basic IS-IS functions.
graceful-restart //Enable IS-IS GR.
network-entity 10.0000.0001.0001.00
import-route isis level-1 into level-2 filter-policy ip-prefix 1 //Configure IS-IS route leaking and use the IP
prefix list 1 to advertise only routes of the network segment [Link]/24 from level-1 area to level-2 area.
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
isis enable 1
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
isis enable 1
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
isis enable 1
#
ip ip-prefix 1 index 10 permit [Link] 24
#
return

Step 4 Configure Router_4.


#
sysname Router_4

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 481


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
isis 1 //Configure basic IS-IS functions.
is-level level-2
network-entity 20.0000.0002.0001.00
import-route direct //Configure the IS-IS process to import direct routes.
import-route ospf 1 //Configure the IS-IS process to import routes of the OSPF process.
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
isis enable 1
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
isis enable 1
#
ospf 1 //Configure basic OSPF functions.
import-route direct //Configure the OSPF process to import direct routes.
import-route isis 1 //Configure the OSPF process to import routes of the IS-IS process.
area [Link]
network [Link] [Link]
#
return

Step 5 Configure Router_5.


#
sysname Router_5
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
ospf 1 //Configure basic OSPF functions.
area [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 6 Verify the configuration.

# Check the IS-IS routing table on Router_4. The routing table contains routes of
the Marketing department ([Link]/24) but does not contain routes of the
Finance department ([Link]/24). This indicates that branches can
communicate only with the Marketing department.

# Check the IS-IS routing table on Router_3. The routing table contains routes of
the network segment [Link]/24. Ping [Link] from Router_3. The ping
operation succeeds, indicating that the Marketing department can communicate
normally with branch 2.

# Ping Router_2 from Router_1, and restart the IS-IS process on Router_3 during
the ping operation. Communication is not interrupted during the restart of the IS-
IS process on Router_3. You can view the IS-IS graceful restart (GR) status on
Router_3 in the display isis graceful-restart status command output.

----End

Configuration Notes
Do not change the network topology during the GR of devices. Otherwise, a
routing blackhole may occur.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 482


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

8.6.2 Example for Configuring IS-IS Route Aggregation


Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
As shown in Figure 8-22, IS-IS is configured on three routers. RouterA is the
Level-1 router, RouterB is the Level-1-2 router, and RouterA and RouterB belong to
area 10. RouterC is the Level-2 router and belongs to area 20. All routes in area 10
need to be aggregated and sent to RouterC.

Figure 8-22 Networking diagram of configuring IS-IS route aggregation

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
isis 10 //Enable IS-IS process 10.
is-level level-1 //Set the router level to Level-1.
network-entity 10.0000.0000.0001.00 //Set a NET for the IS-IS process.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
isis enable 10 //Enable IS-IS on the interface.
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
isis enable 10
#
interface GigabitEthernet3/0/0
ip address [Link] [Link]
isis enable 10
#

Step 2 Configure RouterB.


#
sysname RouterB
#
isis 10

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 483


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

network-entity 10.0000.0000.0002.00
summary [Link] [Link] level-1-2 //Configure IS-IS to aggregate routes.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
isis enable 10
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
isis enable 10
#

Step 3 Configure RouterC.


#
sysname RouterC
#
isis 10
is-level level-2
network-entity 20.0000.0000.0003.00
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
isis enable 10
#

Step 4 Verify the configuration.


# Run the display isis route command on RouterC. All the routes in area 10 are
aggregated to one route destined for [Link]/16.

----End

Configuration Notes
● When using the network-entity command to set a NET for an IS-IS process,
configure the same area ID for routers in an area.

8.6.3 Example for Configuring BFD for IS-IS


Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
In Figure 8-23, a company uses a L2 Switch as a relay agent to connect two
departments that are far from each other. Router_1, Router_2, and Router_3 run
Intermediate System to Intermediate System (IS-IS) and establish IS-IS neighbor
relationships to ensure that they are reachable to each other at the network layer.
Router_1, Router_2, and Router_3 support bidirectional forwarding detection
(BFD). The company wants to use BFD for IS-IS and BFD control packets to ensure
that BFD can fast detect and notify IS-IS of the failure (for example the Down
state) of the link between Router_1 or Router_3 and the L2 Switch).
The company wants to configure BFD for IS-IS on Router_1 and Router_3 to meet
the following requirements:
● Detect the link that passes through the L2 Switch.
● Ensure that the devices can fast detect and notify IS-IS of the link failure and
switch traffic to the link of Router_2.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 484


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Figure 8-23 Networking diagram of configuring BFD for IS-IS

Device Interface IP Address

Router_1 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

GE2/0/3 [Link]/24

Router_2 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

Router_3 GE2/0/1 [Link]/24

GE2/0/2 [Link]/24

GE2/0/3 [Link]/24

Procedure
Step 1 Configure Router_1.
#
sysname Router_1
#
bfd
#
isis 1 //Configure basic IS-IS functions on Router_1, and enable BFD for IS-IS.
is-level level-2
bfd all-interfaces enable
network-entity 10.0000.0000.0001.00
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
isis enable 1
isis cost 5
isis bfd enable

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 485


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

isis bfd min-tx-interval 100 min-rx-interval 100 //Set the minimum interval for sending and receiving
single-hop BFD control packets to 100 ms.
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
isis enable 1
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
return

Step 2 Configure Router_2.


#
sysname Router_2
#
bfd
#
isis 1
is-level level-2
bfd all-interfaces enable
network-entity 10.0000.0000.0003.00
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
isis enable 1
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
isis enable 1
#
return

Step 3 Configure Router_3.


#
sysname Router_3
#
bfd
#
isis 1
is-level level-2
bfd all-interfaces enable
network-entity 10.0000.0000.0002.00
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
isis enable 1
isis cost 5
isis bfd enable
isis bfd min-tx-interval 100 min-rx-interval 100 //Set the minimum interval for sending and receiving
single-hop BFD control packets to 100 ms.
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
isis enable 1
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
isis enable 1
#
return

Step 4 Verify the configuration.

# Run the display isis peer verbose command on Router_1 to check IS-IS
neighbor information. When the State field displays Up, Router_1 and Router_3
have established an IS-IS neighbor relationship.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 486


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

# Run the display isis bfd session all command on Router_1 and Router_3 to
check BFD session information. The command output shows that a BFD session
has been set up and Session State is in Up state.
# Run the display ip routing-table [Link] verbose command on Router_1 to
check routes to [Link]/24. The command output shows that Router_1 and
Router_3 communicate through the L2 Switch.
----End

8.7 IS-IS (IPv6)

8.7.1 Example for Configuring IS-IS IPv6


Applicability
This example applies to all AR models of V200R002C00 and later versions.

Networking Requirements
As shown in Figure 8-24:
● RouterA, RouterB, RouterC, and RouterD belong to the same AS. The four
routers need to run IS-IS to implement IPv6 interworking.
● RouterA, RouterB, and RouterC belong to Area 10, and RouterD belongs to
Area 20.
● RouterA and RouterB are Level-1 routers, RouterC is a Level-1-2 router, and
RouterD is a Level-2 router.

Figure 8-24 Networking diagram of configuring IS-IS IPv6

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 487


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
ipv6 //Enable IPv6 unicast forwarding.
#
isis 1 //Enable IS-IS process 1.
is-level level-1 //Set the router as a Level-1 router.
network-entity 10.0000.0000.0001.00 //Set the NET for IS-IS process 1.
#
ipv6 enable topology standard //Enable the IPv6 capability for IS-IS process 1.
#
#
interface GigabitEthernet1/0/0
ipv6 enable //Enable IPv6 on the interface.
ipv6 address 10:1::2/64 //Configure a global unicast IPv6 address for the interface.
isis ipv6 enable 1 //Enable the IPv6 capability for IS-IS process 1 on the interface.
#
return

Step 2 Configure RouterB.


#
sysname RouterB
#
ipv6
#
isis 1
is-level level-1
network-entity 10.0000.0000.0002.00 //Set the NET for IS-IS process 1.
#
ipv6 enable topology standard
#
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 10:2::2/64 //Configure a global unicast IPv6 address for the interface.
isis ipv6 enable 1
#
return

Step 3 Configure RouterC.


#
sysname RouterC
#
ipv6
#
isis 1
network-entity 10.0000.0000.0003.00 //Set the NET for IS-IS process 1.
#
ipv6 enable topology standard
#
#
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 30::1/64 //Configure a global unicast IPv6 address for the interface.
isis ipv6 enable 1
isis circuit-level level-2 //Set the circuit type as Level-2, allowing only Level-2 adjacencies to be
established on the interface.
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 10:1::1/64 //Configure a global unicast IPv6 address for the interface.
isis ipv6 enable 1
#
interface GigabitEthernet2/0/0
ipv6 enable

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 488


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

ipv6 address 10:2::1/64 //Configure a global unicast IPv6 address for the interface.
isis ipv6 enable 1
#
return

Step 4 Configure RouterD.


#
sysname RouterD
#
ipv6
#
isis 1
is-level level-2 //Set the router as a Level-2 router.
network-entity 20.0000.0000.0004.00 //Set the NET for IS-IS process 1.
#
ipv6 enable topology standard
#
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 30::2/64 //Configure a global unicast IPv6 address for the interface.
isis ipv6 enable 1
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 20::1/64 //Configure a global unicast IPv6 address for the interface.
isis ipv6 enable 1
#
return

Step 5 Verify the configuration.

# Run the display isis route command on each router to view IS-IS routes.

# Interfaces on RouterA, RouterB, RouterC, and RouterD can successfully ping


each other.

----End

Configuration Notes
● IPv6 must be enabled in the system view and interface view.
● The IPv6 capability must be enabled for IS-IS on interfaces.
● When using the network-entity command to set a NET for an IS-IS process,
configure the same area ID for routers in an area.

8.8 BGP

8.8.1 Example for Configuring BGP


Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
Multiple ASs exist in a region. To access each other, these ASs must exchange their
local routes. As multiple routers exist in the ASs, there are a large number of

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 489


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

routes that change frequently. How to efficiently transmit a great deal of routing
information between ASs without consuming lots of bandwidth resources has
become a problem. BGP can be used to solve this problem.

Figure 8-25 shows IP addresses and masks of hosts and routers' interfaces.
RouterC is in AS 200, and RouterA and RouterB are in AS 100. After BGP is
enabled on the routers, the routers can exchange routing information. When
routes of one router change, the router will send update messages carrying only
changed routing information to its peers without having to send its entire routing
table. This implementation greatly reduces bandwidth consumption.

Figure 8-25 Networking diagram of configuring basic BGP functions

Procedure
Step 1 Configure RouterA.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
bgp 100 //Enter the BGP view.
router-id [Link] //Set the router ID in routing management.
peer [Link] as-number 100 //Configure an IP address and an AS number for a peer.
#
ipv4-family unicast //Enter the IPv4 unicast address family view.
undo synchronization
network [Link] 24 //Add routes in the local routing table to the BGP routing table statically and
advertise the routes to a peer.
peer [Link] enable
#
return

Step 2 Configure RouterB.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 490


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
bgp 100
router-id [Link]
peer [Link] as-number 100
peer [Link] as-number 200
#
ipv4-family unicast
undo synchronization
peer [Link] enable
peer [Link] next-hop-local
peer [Link] enable
#
return

Step 3 Configure RouterC.


#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
bgp 200
router-id [Link]
peer [Link] as-number 100
#
ipv4-family unicast
undo synchronization
network [Link] 24
peer [Link] enable
#
return

Step 4 Configure hosts.

Set the default gateway of hosts in VLAN 10 to [Link] and the default gateway
of hosts in VLAN 20 to [Link].

Step 5 Verify the configuration.

# Run the display bgp routing-table command to view the BGP routing table.

# Run the ping command to verify the router connectivity.

----End

Configuration Notes
● You must configure IP addresses on the same network segment for interfaces
connecting two routers together.
● You must configure IPv4 default gateways for hosts.
● If no mask or mask length is specified in the network command, the IP
address in the network command is considered as a classful address.
● By default, IGP-BGP synchronization is disabled.
● By default, peers are automatically enabled in the BGP-IPv4 unicast address
family view.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 491


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

8.8.2 Example for Configuring a BGP Route Reflector


Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
Figure 8-26 shows IP addresses and masks of hosts and routers' interfaces.
RouterB is a route reflector (RR), RouterC is its client, and RouterA is a non-client.
RouterC does not establish a BGP connection with RouterA but can learn the
routes advertised by RouterA through RouterB.

Figure 8-26 Networking diagram of configuring a BGP RR

Procedure
Step 1 Configure RouterA.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
bgp 100 //Enter the BGP view.
router-id [Link] //Set the router ID in routing management.
peer [Link] as-number 100 //Configure an IP address and an AS number for a peer.
#
ipv4-family unicast //Enter the IPv4 unicast address family view.
undo synchronization
network [Link] 24 //Add routes in the local routing table to the BGP routing table statically and
advertise the routes to a peer.
peer [Link] enable
#
return

Step 2 Configure RouterB.


#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
bgp 100
router-id [Link]
peer [Link] as-number 100
peer [Link] as-number 100

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 492


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
ipv4-family unicast
undo synchronization
peer [Link] enable
peer [Link] enable
peer [Link] reflect-client //Configure an RR and its clients.
#
return

Step 3 Configure RouterC.


#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
bgp 100
router-id [Link]
peer [Link] as-number 100
#
ipv4-family unicast
undo synchronization
peer [Link] enable
#
return

Step 4 Verify the configuration.

# Run the display bgp routing-table command on RouterC to view the BGP
routing table. The command output shows that RouterC has learned from RouterB
the routes advertised by RouterA. You can also view the Originator and Cluster_ID
attributes of a specified route.

----End

Configuration Notes
● You must configure IP addresses on the same network segment for interfaces
connecting two routers together.
● If no mask or mask length is specified in the network command, the IP
address in the network command is considered as a classful address.
● By default, IGP-BGP synchronization is disabled.
● By default, peers are automatically enabled in the BGP-IPv4 unicast address
family view.

8.8.3 Example for Configuring the Local Preference and


Community Attribute in a BGP Route-policy
Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
BGP runs on RouterA and RouterB. RouterA imports two static blackhole routes.
RouterB needs to change the local preference and add the community attribute of
routes of [Link]/24.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 493


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Figure 8-27 Networking diagram of configuring the local preference and


community attribute in a BGP route-policy

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
bgp 10
router-id [Link] //Set the router ID. You are advised to set the IP address of Loopback 0 as the router ID.
peer [Link] as-number 10 //Configure an IP address and an AS number for a peer.
#
ipv4-family unicast
undo synchronization
import-route static //Configure the router to import static routes.
peer [Link] enable
#
ip route-static [Link] [Link] NULL0 //Configure static blackhole routes.
ip route-static [Link] [Link] NULL0
#

Step 2 Configure RouterB.


#
sysname RouterB
#
acl number 2001
rule 2 permit source [Link] [Link] //Add a rule in ACL 2001 to permit the packets from
[Link]/24 to pass through.
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
bgp 10
router-id [Link]
peer [Link] as-number 10
#
ipv4-family unicast
undo synchronization
peer [Link] enable
peer [Link] route-policy admin import //Configure a route-policy admin to filter the routes of
peers.
#

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 494


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

route-policy admin permit node 10 //Configure a route-policy admin and set the index of the node in the
route-policy to 10 and the matching mode to permit.
if-match acl 2001 //Configure a matching rule based on ACL 2001.
apply local-preference 120 //Set the local preference of BGP routes to 120.
apply community 10:1 //Set the BGP community attribute of BGP routes to 10:1.
#
route-policy admin permit node 20 //Configure a route-policy admin and set the index of the node in the
route-policy to 20 and the matching mode to permit.
#

Step 3 Verify the configuration.


# Run the display bgp routing-table command on RouterB to view the BGP
routing table. The routing table contains routes of [Link]/24 and
[Link]/24. Run the display bgp routing-table [Link] 24 command
on RouterB. You can view detailed information about routes of [Link]/24,
including the local preference 120 and community attribute 10:1.

----End

Configuration Notes
● By default, IGP-BGP synchronization is disabled.
● By default, peers are automatically enabled in the BGP-IPv4 unicast address
family view.
● A permit node without contents must be appended to a route-policy so that
the routes that do not match the previous nodes can be added to the BGP
routing table.
● The local preference is only used for route selection within an AS and is not
advertised outside the AS. Therefore, the apply local-preference command
does not take effect when a route-policy is configured for an EBGP peer.

8.8.4 Example for Applying the AS-Path Attribute to a Route-


Policy
Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
As shown in Figure 8-28, four routers belong to different ASs and establish EBGP
connections. When RouterD sends routes to RouterA, the AS-Path attribute needs
to be changed so that route from RouterA to [Link]/24 is changed.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 495


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Figure 8-28 Networking diagram of applying the AS-Path attribute to a route-


policy

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
bgp 100
router-id [Link] //Set the router ID. You are advised to set the IP address of Loopback 0 as the router ID.
peer [Link] as-number 200 //Specify the peer IP address and AS number.
peer [Link] as-number 400
#
ipv4-family unicast
undo synchronization
peer [Link] enable
peer [Link] enable
#

Step 2 Configure RouterB.


#
sysname RouterB
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface LoopBack0

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 496


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

ip address [Link] [Link]


#
bgp 200
router-id [Link]
peer [Link] as-number 100
peer [Link] as-number 300
#
ipv4-family unicast
undo synchronization
peer [Link] enable
peer [Link] enable
#

Step 3 Configure RouterC.


#
sysname RouterC
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
bgp 300
router-id [Link]
peer [Link] as-number 200
peer [Link] as-number 400
#
ipv4-family unicast
undo synchronization
peer [Link] enable
peer [Link] enable
#

Step 4 Configure RouterD.


#
sysname RouterD
#
interface GigabitEthernet1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet2/0/0
ip address [Link] [Link]
#
interface GigabitEthernet3/0/0
ip address [Link] [Link]
#
interface LoopBack0
ip address [Link] [Link]
#
bgp 400
router-id [Link]
peer [Link] as-number 100
peer [Link] as-number 300
#
ipv4-family unicast
undo synchronization
network [Link] [Link] //Configure BGP to advertise local routes.
peer [Link] enable
peer [Link] route-policy t1 export //Apply a route-policy to the advertised routes.
peer [Link] enable
#
route-policy t1 permit node 5 //Create a route-policy.
apply as-path 400 400 400 additive //Add AS number 400 400 400 to the AS-Path list.
#

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 497


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Step 5 Verify the configuration.


# Before a route-policy is applied to RouterD, run the display bgp routing-table
command on RouterA. You can see that there are two BGP routes destined for
[Link]/24. A route with next-hop address [Link] has AS-Path 200 300
400, and the other route with next-hop address [Link] has AS-Path 400. Then
run the display ip routing-table command. You can see that the route with next-
hop address [Link] is preferred.
# After a route-policy is applied to RouterD, run the display bgp routing-table
command on RouterA. You can see that there are two BGP routes destined for
[Link]/24. A route with next-hop address [Link] has AS-Path 200 300
400, and the other route with next-hop address [Link] has AS-Path
400,400,400,400. Then run the display ip routing-table command. You can see
that the route with next-hop address [Link] is preferred.
----End

Configuration Notes
● If no mask or mask length is specified in the network command, the IP
address in the network command is considered as a classful address.
● By default, IGP-BGP synchronization is disabled.
● By default, peers are automatically enabled in the BGP-IPv4 unicast address
family view.

8.8.5 Example for Configuring a BGP4+ Route Reflector


Applicability
This example applies to all AR models of V200R002C00 and later versions.

Networking Requirements
As shown in Figure 8-29, RouterB receives a route update from RouterA using
EBGP and forwards the route update to RouterC. RouterC is configured as a route
reflector, which has two clients, RouterB and RouterD.
RouterB and RouterD do not need to establish an IBGP connection. After receiving
a route update from RouterB, RouterC reflects the route update to RouterD.
Similarly, RouterC reflects the route update received from RouterD to RouterB.

Figure 8-29 Networking diagram of configuring a BGP4+ RR

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 498


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Procedure
Step 1 Configure RouterA.
#
ipv6 //Enable IPv6 forwarding.
#
interface GigabitEthernet1/0/0
ipv6 enable //Enable IPv6 on the interface.
ipv6 address 100::1 96
#
bgp 100 //Enter the BGP view.
router-id [Link] //Set the router ID in routing management.
peer 100::2 as-number 200 //Set an IPv6 address and an AS number for a peer.
#
ipv6-family unicast //Enter the IPv6 unicast address family view.
undo synchronization
network 100:: 96 //Add the routes in the local routing table to the BGP routing table statically and
advertise the routes to the peer.
peer 100::2 enable //Enable peers to exchange routing information.
#
return

Step 2 Configure RouterB.


#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 101::2 96
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 100::2 96
#
bgp 200
router-id [Link]
peer 100::1 as-number 100
peer 101::1 as-number 200
#
ipv6-family unicast
undo synchronization
network 100:: 96 network 101:: 96
peer 100::1 enable peer 101::1 enable
#
return

Step 3 Configure RouterC.


#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 101::1 96
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 102::1 96
#
bgp 200
router-id [Link]
peer 101::2 as-number 200
peer 102::2 as-number 200
#
ipv6-family unicast
undo synchronization

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 499


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

network 101:: 96 network 102:: 96


peer 101::2 enable
peer 101::2 reflect-client //Configure RouterC as the route reflector and RouterB as the client.
peer 102::2 enable
peer 102::2 reflect-client
#
return

Step 4 Configure RouterD.


#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 102::2 96
#
bgp 200
router-id [Link]
peer 102::1 as-number 200
#
ipv6-family unicast
undo synchronization
network 102:: 96
peer 102::1 enable
#
return

Step 5 Verify the configuration.

# Run the display bgp ipv6 routing-table command on RouterD to view the BGP
IPv6 routing table. The routing tables show that RouterD has learned from
RouterC the routes advertised by RouterA.

----End

Configuration Notes
● You must configure IP addresses on the same network segment for interfaces
connecting two routers together.
● If no mask or mask length is specified in the network command, the IP
address in the network command is considered as a classful address.
● By default, IGP-BGP synchronization is disabled.
● After configuring a BGP4+ peer in the BGP view, enable the BGP4+ peer in the
IPv6 unicast address family view.

8.8.6 Example for Configuring BGP4+ Load Balancing

Applicability
This example applies to all AR models of V200R002C00 and later versions.

Networking Requirements
RouterA establishes EBGP connections with RouterB and RouterC. RouterB and
RouterC import static routes to 3000::/64. Load balancing needs to be
implemented between RouterB and RouterC.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 500


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Figure 8-30 Networking diagram of configuring BGP4+ load balancing

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
ipv6 //Enable IPv6 unicast forwarding.
#
interface GigabitEthernet1/0/0
ipv6 enable //Enable IPv6 on the interface.
ipv6 address 1000::1/64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 2000::1/64
#
interface LoopBack0
ip address [Link] [Link]
#
bgp 10
router-id [Link] //Set the router ID. You are advised to set the IP address of Loopback 0 as the router ID.
peer 1000::2 as-number 20 //Set an IP address and an AS number for a peer.
peer 2000::2 as-number 20
#
ipv6-family unicast
undo synchronization
maximum load-balancing 2 //Set the maximum number of equal-cost routes to 2.
peer 1000::2 enable //Enable peers to exchange routing information.
peer 2000::2 enable
#

Step 2 Configure RouterB.


#
sysname RouterB
#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 2000::2/64
#
interface LoopBack0
ip address [Link] [Link]
#
bgp 20
router-id [Link]
peer 2000::1 as-number 10

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 501


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
ipv6-family unicast
undo synchronization
import-route static //Configure the router to import IPv6 static routes.
peer 2000::1 enable
#
ipv6 route-static 3000:: 64 NULL0 //Configure an IPv6 static route.
#

Step 3 Configure RouterC.


#
sysname RouterC
#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 1000::2/64
#
interface LoopBack0
ip address [Link] [Link]
#
bgp 20
router-id [Link]
peer 1000::1 as-number 10
#
ipv6-family unicast
undo synchronization
import-route static
peer 1000::1 enable
#
ipv6 route-static 3000:: 64 NULL0 //Configure an IPv6 static route.
#

Step 4 Verify the configuration.


# Run the display bgp ipv6 routing-table command on RouterA to view the BGP
IPv6 routing table. The routing table contains two routes to 3000::/64. The two
routes have next-hop addresses 1000::2 and 2000::2.

----End

Configuration Notes
● After configuring a BGP4+ peer in the BGP view, enable the BGP4+ peer in the
IPv6 unicast address family view.
● Before configuring an IPv6 routing protocol, enable IPv6 unicast forwarding
on routers. Before configuring IPv6 features on an interface, enable IPv6 on
the interface.

8.8.7 Example for Configuring a BGP4+ Confederation


Applicability
This example applies to all AR models of V200R002C00 and later versions.

Networking Requirements
As shown in Figure 8-31. AS 20 is divided into three sub-ASs: AS 65001, AS 65002,
and AS 65003. EBGP and IBGP need to be configured to allow routers in the two
ASs to communicate.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 502


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Figure 8-31 Networking diagram of configuring a BGP4+ confederation

Procedure
Step 1 Configure RouterA.
#
sysname RouterA
#
ipv6 //Enable IPv6 unicast forwarding.
#
interface GigabitEthernet1/0/0
ipv6 enable //Enable IPv6 on the interface.
ipv6 address 1000::1/64
#
interface LoopBack0
ip address [Link] [Link]
#
bgp 10
router-id [Link] //Set the router ID. You are advised to set the IP address of Loopback 0 as the router ID.
peer 1000::2 as-number 20 //Set an IP address and an AS number for a peer.
#
ipv6-family unicast
undo synchronization
peer 1000::2 enable //Enable peers to exchange routing information.
#

Step 2 Configure RouterB.


#
sysname RouterB
#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 1000::2/64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 2000::2/64
#
interface GigabitEthernet3/0/0
ipv6 enable
ipv6 address 3000::2/64

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 503


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
interface LoopBack0
ip address [Link] [Link]
#
bgp 65002
router-id [Link]
confederation id 20 //Set the confederation ID to 20.
confederation peer-as 65001 65003 //Set the sub-AS number of peers in the confederation.
peer 1000::1 as-number 10
peer 2000::1 as-number 65001
peer 3000::1 as-number 65003
#
ipv6-family unicast
undo synchronization
import-route direct //Configure the router to import direct routes.
peer 1000::1 enable
peer 2000::1 enable
peer 3000::1 enable
#

Step 3 Configure RouterC.


#
sysname RouterC
#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 2000::1/64
#
interface LoopBack0
ip address [Link] [Link]
#
bgp 65001
router-id [Link]
confederation id 20
confederation peer-as 65002
peer 2000::2 as-number 65002
#
ipv6-family unicast
undo synchronization
peer 2000::2 enable
#

Step 4 Configure RouterD.


#
sysname RouterD
#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 3000::1/64
#
interface LoopBack0
ip address [Link] [Link]
#
bgp 65003
router-id [Link]
confederation id 20
confederation peer-as 65002
peer 3000::2 as-number 65002
#
ipv6-family unicast
undo synchronization
peer 3000::2 enable
#

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 504


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Step 5 Verify the configuration.


# Run the ping ipv6 2000::1 command on RouterD. The command output shows
that RouterD can successfully ping RouterC. Run the ping ipv6 1000::1 command
on RouterD. The command output shows that RouterD can successfully ping
RouterA.
----End

Configuration Notes
● Before configuring an IPv6 routing protocol, enable IPv6 unicast forwarding
on routers. Before configuring IPv6 features on an interface, enable IPv6 on
the interface.
● After configuring a BGP4+ peer in the BGP view, enable the BGP4+ peer in the
IPv6 unicast address family view.
● RouterB advertises only the existing routes in the local routing table.
Therefore, direct routes must be imported to RouterB using BGP4+. Otherwise,
RouterA, RouterC, and RouterD cannot communicate.

8.8.8 Example for Configuring BFD for BGP


Applicability
This example applies to all AR models of all versions.

Networking Requirements
As shown in Figure 8-32, Departments A and B of the company are far from each
other. Router_1 and Router_6 function as egress devices of Departments A and B
respectively. Border Gateway Protocol (BGP) has been deployed to ensure that the
two departments can communicate. Router_2 and Router_4 support bidirectional
forwarding detection (BFD). The company wants to use BFD for BGP and use BFD
control packets to detect the active link between autonomous system (AS) 200
and AS 300. When the link between Router_2 and Router_4 fails, for example, the
link becomes Down, BFD can fast detect and notify BGP of the link failure. The
following requirements must be met:
● Use Open Shortest Path First (OSPF) as an Interior Gateway Protocol (IGP) in
AS 100.
● Configure the link Router_2 <->Router_3 <-> Router_4 as the active link that
forwards traffic between Router_1 and Router_6, and use BFD control packets
to detect the active link status.

Figure 8-32 Networking diagram of configuring BFD for BGP

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 505


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Device Interface IP Address Device Interface IP Address

Router_1 GE2/0/1 [Link]/2 Router_4 GE2/0/1 [Link]/


4 24

Router_2 GE2/0/1 [Link]/ GE2/0/2 [Link]


24 /24

GE2/0/2 [Link] GE2/0/3 [Link]/2


/24 4

GE2/0/3 [Link]/2 Router_5 GE2/0/1 [Link]


4 /24

Router_3 GE2/0/1 [Link]/ GE2/0/2 [Link]


24 /24

GE2/0/2 [Link]/ Router_6 GE2/0/1 [Link]/2


24 4

Procedure
Step 1 Configure Router_1.
#
sysname Router_1
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
bgp 200 //Enable BGP and set the local AS number to 200.
router-id [Link]
peer [Link] as-number 100 //Configure Router_1 and Router_2 to set up an EBGP connection.
#
ipv4-family unicast
undo synchronization
network [Link] [Link]
peer [Link] enable
#
return

Step 2 Configure Router_2.


#
sysname Router_2
#
bfd
#
acl number 2000
rule 0 permit source [Link] [Link]
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
bgp 100 //Enable BGP and set the local AS number to 100.
router-id [Link]

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 506


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

peer [Link] as-number 100


peer [Link] bfd enable
peer [Link] as-number 200 //Configure Router_2 and Router_1 to set up an EBGP connection.
peer [Link] as-number 100 //Configure Router_2 and Router_4 to set up an IBGP connection.
#
ipv4-family unicast
undo synchronization
preference 255 100 130
import-route ospf 1
peer [Link] enable
peer [Link] route-policy local-pre export
peer [Link] next-hop-local
peer [Link] enable
peer [Link] enable
peer [Link] next-hop-local
#
ospf 1 //Configure OSPF in AS 100 to ensure that there are reachable routes between devices.
import-route bgp
area [Link]
network [Link] [Link]
network [Link] [Link]
#
route-policy local-pre permit node 10 //Configure a route-policy to advertise the routes to the peer at
[Link], and set the local priority to 200.
if-match ip route-source acl 2000
apply local-preference 200
#
return

Step 3 Configure Router_3.


#
sysname Router_3
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
ospf 1 //Configure OSPF in AS 100 to ensure that there are reachable routes between devices.
area [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 4 Configure Router_4.


#
sysname Router_4
#
bfd
#
acl number 2000 //Create ACL 2000 to permit packets with the source IP address [Link]/24.
rule 0 permit source [Link] [Link]
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
bgp 100 //Enable BGP and set the local AS number to 100.
router-id [Link]
peer [Link] as-number 100 //Configure Router_4 and Router_2 to set up an IBGP connection.
peer [Link] bfd min-tx-interval 100 min-rx-interval 100
peer [Link] bfd enable //Configure BFD.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 507


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

peer [Link] as-number 100


peer [Link] as-number 300 //Configure Router_4 and Router_6 to set up an EBGP connection.
peer [Link] ebgp-max-hop 255
#
ipv4-family unicast
undo synchronization
preference 255 100 130
peer [Link] enable
peer [Link] route-policy local-pre export
peer [Link] next-hop-local //In the BGP IPv4 unicast address family view, configure the device to set
its IP address as the next hop of routes when advertising BGP routes to the peer at [Link].
peer [Link] enable
peer [Link] next-hop-local //In the BGP IPv4 unicast address family view, configure the device to
set its IP address as the next hop of routes when advertising BGP routes to the peer at [Link].
peer [Link] enable
#
ospf 1 //Configure OSPF in AS 100 to ensure that there are reachable routes between devices.
import-route direct
area [Link]
network [Link] [Link]
network [Link] [Link]
#
route-policy local-pre permit node 10 //Configure a route-policy to advertise the routes to the peer at
[Link], and set the local priority to 200.
if-match ip route-source acl 2000
apply local-preference 200
#
return

Step 5 Configure Router_5.


#
sysname Router_5
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
ospf 1 //Configure OSPF in AS 100 to ensure that there are reachable routes between devices.
area [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 6 Configure Router_6.


#
sysname Router_6
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
bgp 300 //Enable BGP and set the local AS number to 300.
router-id [Link]
peer [Link] as-number 100 //Configure Router_6 and Router_4 to set up an EBGP connection.
peer [Link] ebgp-max-hop 255
#
ipv4-family unicast
undo synchronization
network [Link] [Link]
peer [Link] enable
#
return

Step 7 Verify the configuration.


# Run the ping command on Router_1. The command output shows that there is
a reachable route from Router_1 to Router_6.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 508


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

# Run the display bgp peer command on Router_2 to check BGP peer
information. The command output shows that Router_2 has set up an Internal
Border Gateway Protocol (IBGP) connection and External Border Gateway Protocol
(EBGP) connection with Router_4 and Router_1 respectively, and the two
connections are in Established state.

# Run the display bgp bfd session all command on Router_2 to check BFD
session information. The command output shows that a BFD session has been set
up and Session State is in Up state.

# Run the display ip routing-table command on Router_2 to check routes to


[Link]/24. The command output shows that Router_2 communicates with the
network segment [Link]/24 through the link Router_2 <-> Router_3 <->
Router_4.

----End

8.9 Policy-based Routing

8.9.1 Example for Configuring Interface PBR

Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
In Figure 8-33, by default, the Router forwards the packets that are received from
GE2/0/0 and destined for the Server through the next hop at [Link] according to
the routing table. Local policy-based routing (PBR) needs to be configured on the
Router to meet the following requirements:
● Redirect the packets that are received from GE2/0/0 and destined for the
Server and have the source IP address [Link] to the next hop at [Link]. The
flow policy call for this interface has a higher priority.
● Redirect the HTTP packets that are received from GE2/0/0 and destined for
the Server the next hop at [Link].

Figure 8-33 Networking diagram of configuring local PBR

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 509


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Procedure
Step 1 Configure the router.
#
sysname Router
#
acl number 3005 //Create ACL 3005 to permit packets with the source IP address [Link].
rule 0 permit ip source [Link] 0
#
acl number 3006 //Create ACL 3006 to permit HTTP packets.
rule 0 permit tcp destination-port eq www
#
traffic classifier [Link] operator or
if-match acl 3005
traffic classifier www operator or
if-match acl 3006
#
traffic behavior [Link]
redirect ip-nexthop [Link]
traffic behavior www
redirect ip-nexthop [Link]
#
Traffic policy pbr
Classifier [Link] behavior [Link] precedence 5
Classifier www behavior www precedence 10
#
interface GigabitEthernet2/0/0 ////Configure an IP address for GE2/0/0
ip address [Link] [Link]
traffic-policy pbr inbound
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
ip route-static [Link] 24 [Link] //Configure static routes and ensure that the three paths are
reachable and the default next hop is at [Link]
ip route-static [Link] 24 [Link] preference 40
ip route-static [Link] 24 [Link]
#
return

Step 2 Verify the configuration.

# Run the display traffic classifier user-defined [ classifier-name ] command.


The command displays the traffic classifier configuration on the device.

# Run the display traffic behavior { system-defined | user-defined } [ behavior-


name ] command. The command displays the traffic behavior configuration on
the device.

# Run the display traffic policy user-defined [ policy-name [ classifier classifier-


name ] ] command. The command displays the traffic policy configuration on the
device.

# Run the display traffic-policy applied-record [ policy-name ] command. The


command displays traffic policy records.

----End

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 510


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

8.9.2 Example for Configuring PBR


Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
An enterprise wants to allow network administrators to make user-defined policies
for routing packet, allow different data flows to be forwarded on different links,
which improves flexibility of route selection, increases link usage and reduces the
cost of enterprise data services. In this case, SPR can be deployed to ensure.
As shown in Figure 8-34, RouterA, RouterB, and RouterC use OSPF to ensure
routes between them are reachable. In the routing table of RouterA, the next-hop
address of the route to [Link] is the IP address of GE1/0/0 on RouterC.
PBR is configured on RouterA so that traffic from RouterA to [Link]/24 is
redirected to RouterB.

Figure 8-34 Networking diagram for configuring PBR

Procedure
Step 1 Configure RouterA.
#
acl number 3001 //Define an ACL rule to match packets with the destination IP address [Link]/24 and
destination IP address [Link]/24.
rule 5 permit ip source [Link] [Link] destination [Link] [Link]
#
traffic classifier rdt operator or //Configure a traffic classifier.
if-match acl 3001
#
traffic behavior rdt //Configure a traffic behavior, with the next hop address as the IP address of GE1/0/0
on RouterB.
redirect ip-nexthop [Link]
#
traffic policy rdt //Bind the traffic policy.
classifier rdt behavior rdt

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 511


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
interface GigabitEthernet 1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet 2/0/0
ip address [Link] [Link]
#
interface GigabitEthernet 3/0/0
ip address [Link] [Link]
traffic-policy rdt inbound //The traffic sent from [Link]/24 to [Link]/24 is redirected to RouterB.
#
ospf 1 //Configure OSPF.
area [Link]
network [Link] [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 2 Configure RouterB.


#
interface GigabitEthernet 1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet 2/0/0
ip address [Link] [Link]
#
ospf 1 //Configure OSPF.
area [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 3 Configure RouterC.


#
interface GigabitEthernet 1/0/0
ip address [Link] [Link]
#
interface GigabitEthernet 2/0/0
ip address [Link] [Link]
#
ospf 1 //Configure OSPF.
area [Link]
network [Link] [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 4 Verify the configuration.


# Run the tracert command on the device on [Link]/24 to check the path from
[Link]/24 to [Link]/24. The traffic from [Link]/24 to [Link]/24 is redirected
to RouterB.

----End

8.10 Routing Policy

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 512


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

8.10.1 Example for Configuring a Route-Policy

Context

Applicability
This example applies to all models of AR routers in all versions.

Networking Requirements
As shown in Figure 8-35, Departments A and B of the company are far from each
other. Router_1 and Router_6 function as egress devices of Departments A and B
respectively. Devices in AS 100 use Open Shortest Path First (OSPF) as an Interior
Gateway Protocol (IGP). The company has the following requirements:
● The Border Gateway Protocol (BGP) is deployed to enable Departments A and
B to communicate.
● A route-policy is configured to make the link Router_2 <-> Router_3 <->
Router_4 become the active link that forwards traffic between Router_1 and
Router_6. When the active link is disconnected, traffic is automatically
switched to the standby link Router_2 <-> Router_5 <-> Router_4.

Figure 8-35 Networking diagram of configuring a route-policy

Device Interface IP Address Device Interface IP Address

Router_1 GE1/0/1 [Link]/2 Router_4 GE2/0/1 [Link]/


4 24

GE2/0/1 [Link]/2 GE2/0/2 [Link]


4 /24

Router_2 GE2/0/1 [Link]/ GE2/0/3 [Link]/2


24 4

GE2/0/2 [Link] Router_5 GE2/0/1 [Link]


/24 /24

GE2/0/3 [Link]/2 GE2/0/2 [Link]


4 /24

Router_3 GE2/0/1 [Link]/ Router_6 GE1/0/1 [Link]/2


24 4

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 513


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

Device Interface IP Address Device Interface IP Address

GE2/0/2 [Link]/ GE2/0/1 [Link]/2


24 4

Procedure
Step 1 Configure Router_1.
#
sysname Router_1
#
interface GigabitEthernet1/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
bgp 200 //Enable BGP, set the local AS number to 200, and set the BGP router ID to [Link].
router-id [Link]
peer [Link] as-number 100 //Configure Router_1 and Router_2 to set up an EBGP connection.
#
ipv4-family unicast
undo synchronization
network [Link] [Link] //In the BGP IPv4 unicast address family view, add routes to the
network segment [Link]/24 in the IP routing table to the BGP routing table.
peer [Link] enable
#
return

Step 2 Configure Router_2.


#
sysname Router_2
#
acl number 2000 //Create ACL 2000 to permit packets with the source IP address [Link]/24.
rule 0 permit source [Link] [Link]
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
bgp 100 //Enable BGP, set the local AS number to 100, and set the BGP router ID to [Link].
router-id [Link]
peer [Link] as-number 100 //Configure Router_2 and Router_4 to set up an IBGP connection.
peer [Link] as-number 100
peer [Link] as-number 200 //Configure Router_2 and Router_1 to set up an EBGP connection.
#
ipv4-family unicast
undo synchronization
preference 255 100 130 //Set the EBGP route priority to 255, IBGP route priority to 100, and local route
priority 130 to ensure that IBGP routes are preferred over OSPF routes.
peer [Link] enable
peer [Link] route-policy local-pre export //Set the route-policy used to advertise routes to the peer
at [Link] to local-pre.
peer [Link] next-hop-local //In the BGP IPv4 unicast address family view, configure the device to set
its IP address as the next hop of routes when advertising BGP routes to the peer at [Link].
peer [Link] enable
peer [Link] enable
peer [Link] next-hop-local //In the BGP IPv4 unicast address family view, configure the device to
set its IP address as the next hop of routes when advertising BGP routes to the peer at [Link].

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 514


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

#
ospf 1
import-route direct
import-route bgp
area [Link]
network [Link] [Link]
network [Link] [Link]
#
route-policy local-pre permit node 10 //Configure a route-policy to advertise the routes learned from the
peer at [Link] to the peer at [Link], and set the local priority to 200.
if-match ip route-source acl 2000
apply local-preference 200
#
return

Step 3 Configure Router_3.


#
sysname Router_3
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
ospf 1
area [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 4 Configure Router_4.


#
sysname Router_4
#
acl number 2000 //Create ACL 2000 to permit packets with the source IP address [Link]/24.
rule 0 permit source [Link] [Link]
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
interface GigabitEthernet2/0/3
ip address [Link] [Link]
#
bgp 100 //Enable BGP, set the local AS number to 100, and set the BGP router ID to [Link].
router-id [Link]
peer [Link] as-number 100 //Configure Router_4 and Router_2 to set up an IBGP connection.
peer [Link] as-number 300 //Configure Router_4 and Router_6 to set up an EBGP connection.
peer [Link] as-number 100 //Configure Router_4 and Router_2 to set up an IBGP connection.
#
ipv4-family unicast
undo synchronization
preference 255 100 130 //Set the EBGP route priority to 255, IBGP route priority to 100, and local route
priority 130 to ensure that IBGP routes are preferred over OSPF routes.
peer [Link] enable
peer [Link] next-hop-local //In the BGP IPv4 unicast address family view, configure the device to set
its IP address as the next hop of routes when advertising BGP routes to the peer at [Link].
peer [Link] route-policy local-pre export
peer [Link] enable
peer [Link] next-hop-local //In the BGP IPv4 unicast address family view, configure the device to
set its IP address as the next hop of routes when advertising BGP routes to the peer at [Link].
peer [Link] enable
#
ospf 1
import-route direct

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 515


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

import-route bgp
area [Link]
network [Link] [Link]
network [Link] [Link]
#
route-policy local-pre permit node 10 //Configure a route-policy to advertise the routes learned from the
peer at [Link] to the peer at [Link], and set the local priority to 200.
if-match ip route-source acl 2000
apply local-preference 200
#
return

Step 5 Configure Router_5.


#
sysname Router_5
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet2/0/2
ip address [Link] [Link]
#
ospf 1
area [Link]
network [Link] [Link]
network [Link] [Link]
#
return

Step 6 Configure Router_6.


#
sysname Router_6
#
interface GigabitEthernet2/0/1
ip address [Link] [Link]
#
interface GigabitEthernet1/0/1
ip address [Link] [Link]
#
bgp 300 //Enable BGP, set the local AS number to 300, and set the BGP router ID to [Link].
router-id [Link]
peer [Link] as-number 100 //Configure Router_6 and Router_4 to set up an EBGP connection.
#
ipv4-family unicast
undo synchronization
network [Link] [Link] //In the BGP IPv4 unicast address family view, add routes to the
network segment [Link]/24 in the IP routing table to the BGP routing table.
peer [Link] enable
#
return

Step 7 Verify the configuration.

# Ping PC_6 from PC_1. The ping operation succeeds, indicating that PC_1 and
PC_6 can communicate.

# Run the display bgp routing-table command on Router_2 to check the BGP
routing table. The BGP routing table contains two routes with the destination
network segment [Link]/24 and local route priority 100 and 200.

# Run the tracert command on PC_1 to check its connectivity to PC_6. Packets are
transmitted along the link Router_1 <-> Router_2 <-> Router_3 <-> Router_4 <->
Router_6.

# Check the BGP routing table of Router_2 after the active link is disconnected.
The BGP routing table contains only one route to [Link]/24.

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 516


Huawei AR Series Access Routers
CLI-based Typical Configuration Examples 8 Deploying Routing

# Run the tracert command on PC_1 to check its connectivity to PC_6 again.
Packets are transmitted along the link Router_1 <-> Router_2 <-> Router_5 <->
Router_4 <-> Router_6. This indicates that traffic has been successfully switched
from the active link to the standby link.

----End

Issue V3.5 (2021-02-08) Copyright © Huawei Technologies Co., Ltd. 517

You might also like