HCIP-Routing & Switching-IENP V2.5 Lab Guide
HCIP-Routing & Switching-IENP V2.5 Lab Guide
Huawei e-Learning
https://ilearningx.huawei.com/portal/#/portal/ebg/51
Huawei Certification
http://support.huawei.com/learning/NavigationAction!createNavi?navId=_31
&lang=en
Find Training
http://support.huawei.com/learning/NavigationAction!createNavi?navId=_trai
ningsearch&lang=en
More Information
Huawei learning APP
Huawei Certification
Lab Guide
HUAWEI TECHNOLOGIES
HCIP-Routing & Switching-IENP Lab Guide
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property
of their respective holders.
Notice
The information in this document is subject to change without notice. Every effort
has been made in the preparation of this document to ensure accuracy of the
contents, but all statements, information, and recommendations in this document
do not constitute a warranty of any kind, expressed or implied.
Huawei Certification
Lab Guide
Edition 2.5
HUAWEI TECHNOLOGIES
HCIP-Routing & Switching-IENP Lab Guide
Relying on its strong technical and professional training and certification system and
in accordance with customers of different ICT technology levels, Huawei certification
is committed to providing customers with authentic, professional certification, and
addresses the need for the development of quality engineers that are capable of
supporting Enterprise networks in the face of an eer changing ICT industry. The
Huawei certification portfolio for routing and switching (R&S) is comprised of three
levels to support and validate the growth and value of customer skills and
knowledge in routing and switching technologies.
The Huawei Certified Network Associate (HCIA) certification level validates the skills
and knowledge of IP network engineers to implement and support small to
medium-sized enterprise networks. The HCIA certification provides a rich foundation
of skills and knowledge for the establishment of such enterprise networks, along
with the capability to implement services and features within existing enterprise
networks, to effectively support true industry operations.
HCIA certification covers fundamentals skills for TCP/IP, routing, switching and
related IP network technologies, together with Huawei data communications
products, and skills for versatile routing platform (VRP) operation and management.
The Huawei Certified Network Professional (HCIP-R&S) certification is aimed at
enterprise network engineers involved in design and maintenance, as well as
professionals who wish to develop an in depth knowledge of routing, switching,
network efficiency and optimization technologies. HCIP-R&S consists of three units
including Implementing Enterprise Routing and Switching Network (IERS),
Improving Enterprise Network Performance (IENP), and Implementing Enterprise
Network Engineering Project (IEEP), which includes advanced IPv4 routing and
switching technology principles, network security, high availability and QoS, as well
as application of the covered technologies in Huawei products.
The Huawei Certified Internet Expert (HCIE-R&S) certification is designed to imbue
engineers with a variety of IP network technologies and proficiency in maintenance,
for the diagnosis and troubleshooting of Huawei products, to equip engineers with
in-depth competency in the planning, design and optimization of large-scale IP
networks.
HUAWEI TECHNOLOGIES
HCIP-Routing & Switching-IENP Lab Guide
Overview
Chapter 1 introduces principles and configurations of MPLS and MPLS VPN, and
helps readers master methods to improve enterprise network service bearer
capabilities.
This course helps readers gradually understand routing technologies and how these
technologies are implemented on Huawei products.
HUAWEI TECHNOLOGIES
HCIP-Routing & Switching-IENP Lab Guide
Icons
HUAWEI TECHNOLOGIES
HCIP-Routing & Switching-IENP Lab Guide
CONTENTS
LAB 4-1 FIREWALL ZONE AND SECURITY POLICY CONFIGURATION .................................................................... 103
LAB 4-2 FIREWALL NAT CONFIGURATION............................................................................................................ 124
LAB 6-1 ASSOCIATION BETWEEN BFD AND STATIC ROUTES .............................................................................. 179
LAB 6-2 ASSOCIATION BETWEEN BFD AND OSPF .............................................................................................. 196
LAB 6-3 ASSOCIATION BETWEEN BFD AND VRRP.............................................................................................. 208
HUAWEI TECHNOLOGIES
HCIP-Routing & Switching-IENP Lab Guide
Learning Objectives
Topology
Scenario
Assume that you are a network administrator of an enterprise. Your enterprise uses
an IP network with poor forwarding performance. You need to use MPLS to improve
the forwarding rate of routers. Static LSPs are configured manually, while LDP is a
protocol developed for label distribution. To perform flexible configuration, use LDP
to set up MPLS LSPs.
HUAWEI TECHNOLOGIES 1
HCIP-Routing & Switching-IENP Lab Guide
Tasks
<Huawei>system-view
[Huawei]sysname S1
[S1]interface Vlanif 1
<Huawei>system-view
[Huawei]sysname R1
[R1-GigabitEthernet0/0/1]quit
[R1-Serial1/0/0]quit
[R1]interface loopback 0
<Huawei>system-view
[Huawei]sysname R2
[R2-Serial1/0/0]quit
HUAWEI TECHNOLOGIES 2
HCIP-Routing & Switching-IENP Lab Guide
[R2-Serial2/0/0]quit
[R2]interface loopback 0
<Huawei>system-view
[Huawei]sysname R3
[R3-GigabitEthernet0/0/2]quit
[R3-Serial2/0/0]quit
[R3]interface loopback 0
<Huawei>system-view
[Huawei]sysname S2
[S2]interface Vlanif 1
After the configurations are complete, test the connectivity of direct links.
[S1-ospf-1]area 0
HUAWEI TECHNOLOGIES 3
HCIP-Routing & Switching-IENP Lab Guide
[R1-ospf-1]area 0
[R2-ospf-1]area 0
[R3-ospf-1]area 0
[S2-ospf-1]area 0
Check the routing table and test connectivity on the entire network.
[R2]ping 10.0.1.2
HUAWEI TECHNOLOGIES 4
HCIP-Routing & Switching-IENP Lab Guide
5 packet(s) transmitted
5 packet(s) received
[R2]ping 10.0.2.2
5 packet(s) transmitted
5 packet(s) received
Run the display ip routing-table command to check the OSPF routing table.
[R2]display ip routing-table
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 5
HCIP-Routing & Switching-IENP Lab Guide
Destinations : 19 Routes : 19
HUAWEI TECHNOLOGIES 6
HCIP-Routing & Switching-IENP Lab Guide
[R1]mpls
[R1-mpls]mpls ldp
[R2]mpls
[R2-mpls]mpls ldp
[R3]mpls
[R3-mpls]mpls ldp
[R1-Serial1/0/0]mpls
[R1-Serial1/0/0]mpls ldp
[R2-Serial1/0/0]mpls
[R2-Serial1/0/0]mpls ldp
[R2-Serial1/0/0]quit
[R2-Serial2/0/0]mpls
[R2-Serial2/0/0]mpls ldp
[R3-Serial2/0/0]mpls
HUAWEI TECHNOLOGIES 7
HCIP-Routing & Switching-IENP Lab Guide
[R3-Serial2/0/0]mpls ldp
After the configurations are complete, run the display mpls ldp session command
on Routers. You can see that the status of local LDP sessions between R1 and R2
and between R1 and R3 are Operational.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 8
HCIP-Routing & Switching-IENP Lab Guide
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
All LSRs are triggered to establish LDP LSPs based on the host route, which is the
default trigger policy.
Run the display mpls ldp lsp command on LSRs. All host routes are triggered to
establish LDP LSPs.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 9
HCIP-Routing & Switching-IENP Lab Guide
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 10
HCIP-Routing & Switching-IENP Lab Guide
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 11
HCIP-Routing & Switching-IENP Lab Guide
In most cases, the default trigger policy is used. The establishment of an LDP LSP is
triggered in Host mode.
Change the trigger policy to All on LSRs so that all static routes and IGP entries can
trigger the establishment of the LDP LSPs.
[R1]mpls
[R1-mpls]lsp-trigger all
[R2]mpls
[R2-mpls]lsp-trigger all
[R3]mpls
[R3-mpls]lsp-trigger all
After the configuration is complete, run the display mpls ldp lsp command on each
node to view the established LDP LSPs.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 12
HCIP-Routing & Switching-IENP Lab Guide
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 13
HCIP-Routing & Switching-IENP Lab Guide
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 14
HCIP-Routing & Switching-IENP Lab Guide
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 15
HCIP-Routing & Switching-IENP Lab Guide
After an inbound LDP policy is configured, R1 receives label mapping messages only
from R2 and establishes LSPs to R2, saving resources.
Run the display mpls lsp command on R1. Information about established LSPs is
displayed.
[R1]display mpls lsp
----------------------------------------------------------------------------
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 16
HCIP-Routing & Switching-IENP Lab Guide
You can see that LSPs to R2 and R3 are established on R1. Configure the inbound
policy on R1 to allow only the routes to R2.
[R1]mpls ldp
[R1-mpls-ldp]quit
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----End
How can you configure R1 to receive Label Mapping messages from R1 to R3?
Device Configuration
<S1>display current-configuration
HUAWEI TECHNOLOGIES 17
HCIP-Routing & Switching-IENP Lab Guide
sysname S1
interface Vlanif1
area 0.0.0.0
return
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
mpls
lsp-trigger all
mpls ldp
interface Serial1/0/0
link-protocol ppp
mpls
mpls ldp
HUAWEI TECHNOLOGIES 18
HCIP-Routing & Switching-IENP Lab Guide
interface GigabitEthernet0/0/1
interface LoopBack0
area 0.0.0.0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
mpls
lsp-trigger all
mpls ldp
interface Serial1/0/0
link-protocol ppp
HUAWEI TECHNOLOGIES 19
HCIP-Routing & Switching-IENP Lab Guide
mpls
mpls ldp
interface Serial2/0/0
link-protocol ppp
mpls
mpls ldp
interface LoopBack0
area 0.0.0.0
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
mpls
lsp-trigger all
HUAWEI TECHNOLOGIES 20
HCIP-Routing & Switching-IENP Lab Guide
mpls ldp
interface Serial2/0/0
link-protocol ppp
mpls
mpls ldp
interface GigabitEthernet0/0/2
interface LoopBack0
area 0.0.0.0
return
<S2>display current-configuration
sysname S2
interface Vlanif1
HUAWEI TECHNOLOGIES 21
HCIP-Routing & Switching-IENP Lab Guide
area 0.0.0.0
return
Learning Objectives
Topology
Scenario
An enterprise has networks A and B. Employees on the two networks are required to
communicate through VPN routes. The edge device needs to use the Border
HUAWEI TECHNOLOGIES 22
HCIP-Routing & Switching-IENP Lab Guide
Gateway Protocol (BGP) to advertise VPN routes to the carrier network. The carrier
uses MP-BGP to transmit VPN routes on the public network, and ensures security
and privacy of customer network information through MPLS VPN.
Tasks
<Huawei>system-view
[Huawei]sysname R1
[R1-Serial1/0/0]quit
[R1-Serial3/0/0]quit
[R1]interface LoopBack 0
<Huawei>system-view
[Huawei]sysname R2
[R2-Serial1/0/0]quit
[R1-Serial2/0/0]quit
[R2]interface LoopBack 0
HUAWEI TECHNOLOGIES 23
HCIP-Routing & Switching-IENP Lab Guide
<Huawei>system-view
[Huawei]sysname R3
[R3-Serial2/0/0]quit
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
<Huawei>system-view
[Huawei]sysname R4
[R4-Serial1/0/0]quit
[R4]interface LoopBack 0
<Huawei>system-view
[Huawei]sysname R5
[R5-Serial1/0/0]quit
HUAWEI TECHNOLOGIES 24
HCIP-Routing & Switching-IENP Lab Guide
[R5]interface LoopBack 0
[R1]router id 1.1.1.1
[R1]ospf 1
[R1-ospf-1]area 0
[R2]router id 2.2.2.2
[R2]ospf 1
[R2-ospf-1]area 0
[R3]router id 3.3.3.3
[R3]ospf 1
[R3-ospf-1]area 0
Check the OSPF neighbor relationship on R1, R2, and R3 after the configurations are
complete.
HUAWEI TECHNOLOGIES 25
HCIP-Routing & Switching-IENP Lab Guide
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Total Peer(s): 1
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Total Peer(s): 2
----------------------------------------------------------------------------
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 26
HCIP-Routing & Switching-IENP Lab Guide
Total Peer(s): 1
Configure VPN instances for network A and network B on R1 and R3 respectively. Set
the VPN instance to VPN1, router distinguisher (RD) to 1:1, and route target to 1:2
for network A. Set the VPN instance to VPN2, RD to 2:2, and route target to 1:2 for
network B.
[R1-vpn-instance-VPN1]route-distinguisher 1:1
[R1-vpn-instance-VPN1-af-ipv4]quit
[R1-vpn-instance-VPN1]quit
[R3-vpn-instance-VPN2]route-distinguisher 2:2
[R3-vpn-instance-VPN2-af-ipv4]quit
[R3-vpn-instance-VPN2]quit
HUAWEI TECHNOLOGIES 27
HCIP-Routing & Switching-IENP Lab Guide
Interfaces : Serial3/0/0
Log Interval : 5
Interfaces : Serial3/0/0
HUAWEI TECHNOLOGIES 28
HCIP-Routing & Switching-IENP Lab Guide
Log Interval : 5
Set AS numbers of network A, carrier network, and network B to 14, 123, and 35
respectively. Establish BGP neighbor relationships between CE and PE to advertise
customer VPN routes to PE using BGP.
[R1]bgp 123
[R3]bgp 123
[R4]bgp 14
[R4-bgp]network 192.168.1.0 24
[R5]bgp 35
[R5-bgp]network 192.168.2.0 24
HUAWEI TECHNOLOGIES 29
HCIP-Routing & Switching-IENP Lab Guide
Check the OSPF neighbor relationship between R1 and R4 and between R3 and R5
after the configurations are complete.
Local AS number : 14
HUAWEI TECHNOLOGIES 30
HCIP-Routing & Switching-IENP Lab Guide
Local AS number : 35
Check VPN routes learned from customer networks in VPN routing table on R1 and
R3.
------------------------------------------------------------------------------
Destinations : 6 Routes : 6
HUAWEI TECHNOLOGIES 31
HCIP-Routing & Switching-IENP Lab Guide
------------------------------------------------------------------------------
Destinations : 6 Routes : 6
Establish the IBGP neighbor relationship between R1 and R3, and transmit customer
VPN routes to the remote PE using MP-BGP.
[R1]bgp 123
[R3]bgp 123
HUAWEI TECHNOLOGIES 32
HCIP-Routing & Switching-IENP Lab Guide
Check the MP-BGP neighbor relationship on R1 and R3 after the configurations are
complete.
Enable MPLS LDP on each device of the carrier network, and use labels to forward
customer VPN data to isolate customer data from other network data.
HUAWEI TECHNOLOGIES 33
HCIP-Routing & Switching-IENP Lab Guide
[R1]mpls
[R1-mpls]mpls ldp
[R1-mpls-ldp]quit
[R1-Serial1/0/0]mpls
[R1-Serial1/0/0]mpls ldp
[R2]mpls
[R2-mpls]mpls ldp
[R2-mpls-ldp]quit
[R2]interface s1/0/0
[R2-Serial1/0/0]mpls
[R2-Serial1/0/0]mpls ldp
[R2-Serial1/0/0]quit
[R2]interface s2/0/0
[R2-Serial2/0/0]mpls
[R2-Serial2/0/0]mpls ldp
[R3]mpls
[R3-mpls]mpls ldp
[R3-mpls-ldp]quit
[R3-Serial2/0/0]mpls
[R3-Serial2/0/0]mpls ldp
HUAWEI TECHNOLOGIES 34
HCIP-Routing & Switching-IENP Lab Guide
Check the MPLS LDP neighbor relationship on R1, R2, and R3 after the
configurations are complete.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 35
HCIP-Routing & Switching-IENP Lab Guide
----------------------------------------------------------------------------
Use Loopback0 to simulate the user network on R4 and R5 respectively, and run the
ping command to test connectivity between network A and network B.
5 packet(s) transmitted
5 packet(s) received
HUAWEI TECHNOLOGIES 36
HCIP-Routing & Switching-IENP Lab Guide
5 packet(s) transmitted
5 packet(s) received
<R4>display ip routing-table
Destinations : 12 Routes : 12
<R5>display ip routing-table
HUAWEI TECHNOLOGIES 37
HCIP-Routing & Switching-IENP Lab Guide
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
----End
Device Configuration
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
HUAWEI TECHNOLOGIES 38
HCIP-Routing & Switching-IENP Lab Guide
router id 1.1.1.1
ip vpn-instance VPN1
ipv4-family
route-distinguisher 1:1
mpls
mpls ldp
interface Serial1/0/0
link-protocol ppp
mpls
mpls ldp
interface Serial3/0/0
link-protocol ppp
interface LoopBack0
bgp 123
HUAWEI TECHNOLOGIES 39
HCIP-Routing & Switching-IENP Lab Guide
ipv4-family unicast
undo synchronization
ipv4-family vpnv4
policy vpn-target
ospf 1
area 0.0.0.0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
router id 2.2.2.2
HUAWEI TECHNOLOGIES 40
HCIP-Routing & Switching-IENP Lab Guide
mpls
mpls ldp
interface Serial1/0/0
link-protocol ppp
mpls
mpls ldp
interface Serial2/0/0
link-protocol ppp
mpls
mpls ldp
interface LoopBack0
ospf 1
area 0.0.0.0
return
HUAWEI TECHNOLOGIES 41
HCIP-Routing & Switching-IENP Lab Guide
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
router id 3.3.3.3
ip vpn-instance VPN2
ipv4-family
route-distinguisher 2:2
mpls
mpls ldp
interface Serial2/0/0
link-protocol ppp
mpls
mpls ldp
interface Serial3/0/0
link-protocol ppp
HUAWEI TECHNOLOGIES 42
HCIP-Routing & Switching-IENP Lab Guide
interface LoopBack0
bgp 123
ipv4-family unicast
undo synchronization
ipv4-family vpnv4
policy vpn-target
ospf 1
area 0.0.0.0
return
<R4>display current-configuration
[V200R007C00SPC600]
HUAWEI TECHNOLOGIES 43
HCIP-Routing & Switching-IENP Lab Guide
sysname R4
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
bgp 14
ipv4-family unicast
undo synchronization
network 192.168.1.0
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
HUAWEI TECHNOLOGIES 44
HCIP-Routing & Switching-IENP Lab Guide
bgp 35
ipv4-family unicast
undo synchronization
network 192.168.2.0
return
HUAWEI TECHNOLOGIES 45
HCIP-Routing & Switching-IENP Lab Guide
Learning Objectives
Topology
Scenario
Assume that you are a network administrator of an enterprise. A DHCP server needs
to be configured on the network because it is difficult to manage many hosts with
static addresses.
R1 functions as the DHCP server, R4 as the DHCP client, and R2 as the gateway for
devices on S1. DHCP Discover packets are broadcast packets and cannot pass
HUAWEI TECHNOLOGIES 46
HCIP-Routing & Switching-IENP Lab Guide
through routers, so a DHCP relay agent is deployed to send DHCP Request packets
from R2 to R1. S2 does not require any configuration, and only transparently
transmit packets.
To improve network security and prevent DHCP clients from obtaining incorrect IP
addresses from other DHCP servers, deploy DHCP snooping on S1 so that R4 obtains
the IP address of R1 (DHCP server 1) but not the IP address of R3 (DHCP server 2). To
further enhance security, enable some features of DHCP snooping to prevent DHCP
exhaustion and DHCP man-in-the-middle attacks.
Tasks
<Huawei>system-view
[Huawei]sysname R1
[R1-GigabitEthernet0/0/2]quit
[R1]interface loopback 0
<Huawei>system-view
[Huawei]sysname R2
HUAWEI TECHNOLOGIES 47
HCIP-Routing & Switching-IENP Lab Guide
<Huawei>system-view
[Huawei]sysname R3
<Huawei>system-view
[Huawei]sysname R4
[R4]dhcp enable
<Huawei>system-view
[Huawei]sysname S1
[S1-GigabitEthernet0/0/9]shutdown
[S1-GigabitEthernet0/0/9]quit
[S1-GigabitEthernet0/0/10]shutdown
[S1-GigabitEthernet0/0/10]quit
[S1-GigabitEthernet0/0/13]shutdown
[S1-GigabitEthernet0/0/13]quit
HUAWEI TECHNOLOGIES 48
HCIP-Routing & Switching-IENP Lab Guide
[S1-GigabitEthernet0/0/14]shutdown
<Huawei>system-view
[Huawei]sysname S2
[S2-GigabitEthernet0/0/6]shutdown
[S2-GigabitEthernet0/0/6]quit
[S2-GigabitEthernet0/0/7]shutdown
[R1]ping 10.0.12.2
5 packet(s) transmitted
5 packet(s) received
R1 advertises the route of its loopback interface to R2, and R2 advertises the route of
HUAWEI TECHNOLOGIES 49
HCIP-Routing & Switching-IENP Lab Guide
the interface connected to S1 to R1 so that the LAN gateway and external network
can communicate.
[R1]ospf 1
[R1-ospf-1]area 0
[R2]ospf 1
[R2-ospf-1]area 0
5 packet(s) transmitted
5 packet(s) received
HUAWEI TECHNOLOGIES 50
HCIP-Routing & Switching-IENP Lab Guide
[R1-ip-pool-DHCP]gateway-list 10.10.10.1
[R1-ip-pool-DHCP]dns-list 1.1.1.1
[R1-ip-pool-DHCP]lease day 3
[R3-ip-pool-DHCP]gateway-list 192.168.1.1
[R3-ip-pool-DHCP]dns-list 192.168.1.1
[R1-ip-pool-DHCP]lease day 3
<R1>display ip pool
----------------------------------------------------------------------------
HUAWEI TECHNOLOGIES 51
HCIP-Routing & Switching-IENP Lab Guide
Pool-name : DHCP
Pool-No :0
Gateway-0 : 10.10.10.1
Network : 10.10.10.0
Mask : 255.255.255.0
VPN instance : --
Conflict :0 Disable :9
IP address Statistic
Total :253
<R3>display ip pool
----------------------------------------------------------------------------
Pool-name : DHCP
Pool-No :0
Gateway-0 : 192.168.1.1
Network : 192.168.1.0
Mask : 255.255.255.0
VPN instance : --
HUAWEI TECHNOLOGIES 52
HCIP-Routing & Switching-IENP Lab Guide
Conflict :0 Disable :9
IP address Statistic
Total :253
DHCP address pool parameters have been configured, but cannot be used by clients.
DHCP needs to be enabled globally and on the interface.
[R3]dhcp enable
Directed-broadcast packets:
HUAWEI TECHNOLOGIES 53
HCIP-Routing & Switching-IENP Lab Guide
Request packet: 0
Reply packet: 0
Unknown packet: 0
Echo reply: 0
Unreachable: 0
Source quench: 0
Routing redirect: 0
Echo request: 0
Router advert: 0
Router solicit: 0
Time exceed: 0
IP header bad: 0
Timestamp request: 0
Timestamp reply: 0
Information request: 0
Information reply: 0
Netmask request: 0
Netmask reply: 0
Unknown type: 0
HUAWEI TECHNOLOGIES 54
HCIP-Routing & Switching-IENP Lab Guide
server is R1. Because DHCP Discover packets cannot be directly sent from DHCP
clients to R1. In this case, configure R2 as the DHCP relay agent and specify R2 as the
gateway of the LAN connected to S1. Then R2 can transmit DHCP Request packets of
DHCP clients.
[R1]dhcp enable
On R2, specify the IP address of the DHCP server as 10.0.12.1 and configure the
DHCP relay on the interface.
[R2]dhcp enable
[R2-dhcp-server-group-DHCP]dhcp-server 10.0.12.1
[R2-dhcp-server-group-DHCP]quit
Group-name : DHCP
Gateway : --
VPN instance : --
HUAWEI TECHNOLOGIES 55
HCIP-Routing & Switching-IENP Lab Guide
The DHCP server group is configured on R2 and the IP address of the DHCP server in
the DHCP server group is 10.0.12.1. The DHCP relay function is enabled on G0/0/1 of
R2, and the DHCP relay agent sends DHCP Request packets to the DHCP server.
To further verify whether the DHCP relay is deployed successfully, disable the
interface on R3 (to prevent R2 from obtaining an IP address from R3), disable the
interface on R4, and then enable the interfaces again. Normally, R4 can obtain the
subnet address of 10.10.10.0/24.
[R3-GigabitEthernet0/0/1]shutdown
[R4-GigabitEthernet0/0/1]shutdown
[R4-GigabitEthernet0/0/1]undo shutdown
Directed-broadcast packets:
Request packet: 0
HUAWEI TECHNOLOGIES 56
HCIP-Routing & Switching-IENP Lab Guide
Reply packet: 0
Unknown packet: 0
Echo reply: 0
Unreachable: 0
Source quench: 0
Routing redirect: 0
Echo request: 0
Router advert: 0
Router solicit: 0
Time exceed: 0
IP header bad: 0
Timestamp request: 0
Timestamp reply: 0
Information request: 0
Information reply: 0
Netmask request: 0
Netmask reply: 0
Unknown type: 0
HUAWEI TECHNOLOGIES 57
HCIP-Routing & Switching-IENP Lab Guide
<R1>display ip pool
----------------------------------------------------------------------------
Pool-name : DHCP
Pool-No :0
Gateway-0 : 10.10.10.1
Network : 10.10.10.0
Mask : 255.255.255.0
VPN instance : --
Conflict :0 Disable :9
HUAWEI TECHNOLOGIES 58
HCIP-Routing & Switching-IENP Lab Guide
IP address Statistic
Total :253
Check the route of R4, and test the connectivity from R4 to the loopback interface of
R1.
<R4>display ip routing-table
------------------------------------------------------------------------------
Destinations : 8 Routes : 8
<R4>ping 1.1.1.1
HUAWEI TECHNOLOGIES 59
HCIP-Routing & Switching-IENP Lab Guide
5 packet(s) transmitted
5 packet(s) received
[S1]dhcp enable
HUAWEI TECHNOLOGIES 60
HCIP-Routing & Switching-IENP Lab Guide
[S1-GigabitEthernet0/0/3]quit
Trusted interface : No
HUAWEI TECHNOLOGIES 61
HCIP-Routing & Switching-IENP Lab Guide
Trusted interface : No
Enable the interface on R4 again. In this case, R4 cannot obtain an IP address from
HUAWEI TECHNOLOGIES 62
HCIP-Routing & Switching-IENP Lab Guide
any DHCP server because the interfaces connected to the two servers are untrusted
interfaces.
[R4-GigabitEthernet0/0/1]shutdown
[R4-GigabitEthernet0/0/1]undo shutdown
Directed-broadcast packets:
Request packet: 0
Reply packet: 0
Unknown packet: 0
Echo reply: 0
Unreachable: 0
Source quench: 0
Routing redirect: 0
Echo request: 0
HUAWEI TECHNOLOGIES 63
HCIP-Routing & Switching-IENP Lab Guide
Router advert: 0
Router solicit: 0
Time exceed: 0
IP header bad: 0
Timestamp request: 0
Timestamp reply: 0
Information request: 0
Information reply: 0
Netmask request: 0
Netmask reply: 0
Unknown type: 0
Because R1 is the authorized DHCP server, the interface on the switch connected to
R2 can be configured as the trusted interface.
HUAWEI TECHNOLOGIES 64
HCIP-Routing & Switching-IENP Lab Guide
Directed-broadcast packets:
Request packet: 0
Reply packet: 0
Unknown packet: 0
Echo reply: 0
Unreachable: 0
HUAWEI TECHNOLOGIES 65
HCIP-Routing & Switching-IENP Lab Guide
Source quench: 0
Routing redirect: 0
Echo request: 0
Router advert: 0
Router solicit: 0
Time exceed: 0
IP header bad: 0
Timestamp request: 0
Timestamp reply: 0
Information request: 0
Information reply: 0
Netmask request: 0
Netmask reply: 0
Unknown type: 0
Check whether the value of Check dhcp-chaddr is Enable. If the value of Check
dhcp-chaddr is Enable, the switch checks the CHADDR field in the received DHCP
Request packet and determines whether the value of the CHADDR field is consistent
with the hardware address of the host. If the value of the CHADDR field is
inconsistent with the hardware address of the host, the interface does not forward
the DHCP Request packet.
HUAWEI TECHNOLOGIES 66
HCIP-Routing & Switching-IENP Lab Guide
Trusted interface : No
HUAWEI TECHNOLOGIES 67
HCIP-Routing & Switching-IENP Lab Guide
----End
Configuration Reference
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
dhcp enable
ip pool DHCP
gateway-list 10.10.10.1
dns-list 1.1.1.1
HUAWEI TECHNOLOGIES 68
HCIP-Routing & Switching-IENP Lab Guide
interface GigabitEthernet0/0/2
interface LoopBack0
ospf 1
area 0.0.0.0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
dhcp enable
dhcp-server 10.0.12.1 0
interface GigabitEthernet0/0/1
HUAWEI TECHNOLOGIES 69
HCIP-Routing & Switching-IENP Lab Guide
interface GigabitEthernet0/0/2
ospf 1
silent-interface GigabitEthernet0/0/1
area 0.0.0.0
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
dhcp enable
ip pool DHCP
gateway-list 192.168.1.1
dns-list 192.168.1.1
interface GigabitEthernet0/0/1
HUAWEI TECHNOLOGIES 70
HCIP-Routing & Switching-IENP Lab Guide
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
dhcp enable
interface GigabitEthernet0/0/1
ip address dhcp-alloc
return
<SW1>display current-configuration
sysname S1
dhcp enable
interface GigabitEthernet0/0/2
HUAWEI TECHNOLOGIES 71
HCIP-Routing & Switching-IENP Lab Guide
interface GigabitEthernet0/0/3
interface GigabitEthernet0/0/4
interface GigabitEthernet0/0/9
shutdown
interface GigabitEthernet0/0/10
shutdown
interface GigabitEthernet0/0/13
shutdown
interface GigabitEthernet0/0/14
shutdown
return
<SW2>display current-configuration
sysname SW2
interface GigabitEthernet0/0/6
shutdown
HUAWEI TECHNOLOGIES 72
HCIP-Routing & Switching-IENP Lab Guide
interface GigabitEthernet0/0/7
shutdown
return
HUAWEI TECHNOLOGIES 73
HCIP-Routing & Switching-IENP Lab Guide
Learning Objectives
Topology
Scenario
Assume that you are a network administrator of an enterprise. R1 and S1 are located
in the enterprise headquarters, and R2 and S2 are located in the enterprise branch.
The headquarters and branch are connected through a leased line.
HUAWEI TECHNOLOGIES 74
HCIP-Routing & Switching-IENP Lab Guide
The intranet bandwidth increases gradually, but the bandwidth of the leased line
does not increase. In this case, important services are delayed or some services are
unavailable.
You can use differentiated services of QoS and adjust QoS parameters to ensure that
important service data is first sent to the destination.
In the lab, S3 and S4 use NQA to exchange a large number of data flows. R3, R4, and
R5 simulate the clients and server to check whether important applications are
available.
Tasks
Configure IP addresses and masks for all the routers and switches S3 and S4.
Set the baud rate of S1/0/0 on R1 to 72000, and simulate congestion on the WAN
link because of insufficient bandwidth.
<Huawei>system-view
[Huawei]sysname R1
[R1-Serial1/0/0]baudrate 72000
<Huawei>system-view
[Huawei]sysname R2
HUAWEI TECHNOLOGIES 75
HCIP-Routing & Switching-IENP Lab Guide
<Huawei>system-view
[Huawei]sysname R3
<Huawei>system-view
[Huawei]sysname R4
<Huawei>system-view
[Huawei]sysname R5
<Huawei>system-view
[Huawei]sysname S3
[S3]interface Vlanif 1
<Huawei>system-view
HUAWEI TECHNOLOGIES 76
HCIP-Routing & Switching-IENP Lab Guide
[Huawei]sysname S4
[S4]interface Vlanif 1
After the configurations are complete, test the connectivity of direct links.
[R1]ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.145.3
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.145.4
HUAWEI TECHNOLOGIES 77
HCIP-Routing & Switching-IENP Lab Guide
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.145.5
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.34.3
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.34.4
HUAWEI TECHNOLOGIES 78
HCIP-Routing & Switching-IENP Lab Guide
1 packet(s) transmitted
1 packet(s) received
Configure static routes for all the routers and switches S3 and S4.
[S3]ping -c 1 10.0.34.4
HUAWEI TECHNOLOGIES 79
HCIP-Routing & Switching-IENP Lab Guide
1 packet(s) transmitted
1 packet(s) received
[R4]ping -c 1 10.0.34.3
1 packet(s) transmitted
1 packet(s) received
[R5]ping -c 1 10.0.34.3
1 packet(s) transmitted
1 packet(s) received
HUAWEI TECHNOLOGIES 80
HCIP-Routing & Switching-IENP Lab Guide
The links between S3 and S4, between R4 and R3, and between R5 and R3 are
reachable, indicating that network communication is normal.
Congestion easily occurs on the 72 kbit/s serial link between the headquarters and
branch.
Use NQA to generate traffic. S4 functions as the NQA server and S3 functions as the
NQA client.
Create NQA UDP and jitter test instances to simulate data and voice traffic
respectively.
Set parameters in NQA test instances to simulate the environment where congestion
does not occur if there is only data or voice traffic and congestion occurs if there is
data and voice traffic.
Configure S4 as the NQA server, and set the IP address of the interface used for
monitoring UDP services to 10.0.34.4 and port number to 6000.
On S3, configure an NQA UDP test instance to simulate data traffic, and set the ToS
to 28, packet size to 5800 bytes, interval at which packets are sent to 1s, interval for
the NQA test to 3s, and timeout interval for the NQA test to 1s, and start the NQA
UDP test instance.
[S3-nqa-admin-udp]test-type udp
[S3-nqa-admin-udp]destination-port 6000
[S3-nqa-admin-udp]tos 28
[S3-nqa-admin-udp]datasize 5800
[S3-nqa-admin-udp]interval seconds 1
[S3-nqa-admin-udp]frequency 3
[S3-nqa-admin-udp]timeout 1
HUAWEI TECHNOLOGIES 81
HCIP-Routing & Switching-IENP Lab Guide
[S3-nqa-admin-udp]start now
Destination ip address:10.0.34.4
No packet is discarded and congestion does not occur. Shut down the NQA UDP test
instance.
[S3-nqa-admin-udp]stop
On S3, configure an NQA jitter test instance to simulate voice traffic, and set the ToS
to 46, packet size to 90 bytes, interval at which packets are sent to 20 ms, interval for
the NQA test to 3s, and timeout interval for the NQA test to 1s, and start the NQA
jitter test instance.
[S3-nqa-admin-jitter]test-type jitter
HUAWEI TECHNOLOGIES 82
HCIP-Routing & Switching-IENP Lab Guide
[S3-nqa-admin-jitter]destination-port 6000
[S3-nqa-admin-jitter]tos 46
[S3-nqa-admin-jitter]datasize 90
[S3-nqa-admin-jitter]interval milliseconds 20
[S3-nqa-admin-jitter]frequency 3
[S3-nqa-admin-jitter]timeout 1
[S3-nqa-admin-jitter]start now
SendProbe:60 ResponseProbe:60
HUAWEI TECHNOLOGIES 83
HCIP-Routing & Switching-IENP Lab Guide
TimeStamp unit: ms
No packet is discarded and congestion does not occur. Shut down the NQA jitter
test instance.
[S3-nqa-admin-jitter]stop
Run the ping command to simulate traffic of less important services, and map DSCP
priorities of traffic to BE without QoS guarantee.
[R1-Serial1/0/0]trust dscp
Specify override in the trust command on G0/0/1 so that DSCP priorities are
changed to mapped values after priority mapping is configured on R1.
HUAWEI TECHNOLOGIES 84
HCIP-Routing & Switching-IENP Lab Guide
Run the ping command on R4 to simulate the traffic destined for R3 and set the ToS
to 26.
[R1-maptbl-dscp-dscp]input 26 output 0
-------------------
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 15
HUAWEI TECHNOLOGIES 85
HCIP-Routing & Switching-IENP Lab Guide
16 16
17 17
18 18
19 19
20 20
21 21
22 22
23 23
24 24
25 25
26 0
27 27
28 28
29 29
30 30
The preceding information shows that DSCP priority 26 is mapped to 0 and other
DSCP priorities use default values.
Start NQA UDP and jitter test instances on S3 to simulate congestion on the 72
kbit/s link between the headquarters and branch.
[S3-nqa-admin-udp]start now
[S3-nqa-admin-udp]quit
[S3-nqa-admin-jitter]start now
HUAWEI TECHNOLOGIES 86
HCIP-Routing & Switching-IENP Lab Guide
On R4, run the ping command with the packet size of 700 bytes and packet count of
10 to simulate the traffic destined for R3.
10 packet(s) transmitted
1 packet(s) received
Severe congestion occurs on the link between the headquarters and branch, causing
serious packet loss. There is a long delay for forwarded data packets. In this case, R4
cannot communicate with R3.
The following describes how to configure traffic policing and traffic shaping to
eliminate congestion on the link so that R4 in headquarters can communicate with
R3 on the branch.
HUAWEI TECHNOLOGIES 87
HCIP-Routing & Switching-IENP Lab Guide
GigabitEthernet0/0/13 lr inbound:
On R4, run the ping command with the packet size of 700 bytes and packet count of
10 to simulate the traffic destined for R3.
10 packet(s) transmitted
10 packet(s) received
HUAWEI TECHNOLOGIES 88
HCIP-Routing & Switching-IENP Lab Guide
No packets are discarded and R4 can communicate with R3 normally, indicating that
traffic policing takes effect.
The following uses traffic shaping to eliminate congestion. On S3, configure traffic
shaping on GE0/0/13 and set the CIR to 64 kbit/s.
[S3]interface GigabitEthernet0/0/13
On R4, run the ping command with the packet size of 700 bytes and packet count of
10 to simulate the traffic destined for R3.
HUAWEI TECHNOLOGIES 89
HCIP-Routing & Switching-IENP Lab Guide
10 packet(s) transmitted
10 packet(s) received
No packets are discarded and R4 can communicate with R3 normally, indicating that
traffic shaping takes effect.
[S3]interface GigebitEthernet0/0/13
On R4, run the ping command with the packet size of 700 bytes and packet count of
10 to simulate the traffic destined for R3.
HUAWEI TECHNOLOGIES 90
HCIP-Routing & Switching-IENP Lab Guide
10 packet(s) transmitted
2 packet(s) received
After the configuration is deleted, many packets are discarded and forwarded data
packets are delayed. R4 cannot communicate with R3.
To prevent network congestion on the link between the headquarters and branch,
configure queue-based congestion management and congestion avoidance.
On R1, create a WRED drop profile named data based on DSCP priorities and set the
upper drop threshold to 90, lower drop threshold to 50, and maximum drop
probability to 30.
[R1]drop-profile data
[R1-drop-profile-data]wred dscp
Create a queue profile named queue-profile1 on R1, put data traffic into WFQ
queues, bind the queue profile to the WRED drop profile data, and put high-priority
and delay-sensitive voice traffic to PQ queues.
[R1-qos-queue-profile-queue-profile1]schedule wfq 3 pq 5
HUAWEI TECHNOLOGIES 91
HCIP-Routing & Switching-IENP Lab Guide
Queue-profile: queue-profile1
-----------------------------------------------------------------
5 PQ - 0/0 -/-
Data traffic and voice traffic enter WFQ and PQ queues respectively.
Drop-profile[1]: data
-----------------------------------------------------------------
default 30 100 10
1 30 100 10
2 30 100 10
3 30 100 10
4 30 100 10
5 30 100 10
6 30 100 10
7 30 100 10
cs1 30 100 10
9 30 100 10
HUAWEI TECHNOLOGIES 92
HCIP-Routing & Switching-IENP Lab Guide
af11 30 100 10
11 30 100 10
af12 30 100 10
13 30 100 10
af13 30 100 10
15 30 100 10
cs2 30 100 10
17 30 100 10
af21 30 100 10
19 30 100 10
af22 30 100 10
21 30 100 10
af23 30 100 10
23 30 100 10
cs3 30 100 10
25 30 100 10
af31 30 100 10
27 30 100 10
af32 50 90 30
29 30 100 10
af33 30 100 10
31 30 100 10
cs4 30 100 10
33 30 100 10
af41 30 100 10
Parameters in the WRED drop profile data take effect, and other parameters use
default values.
HUAWEI TECHNOLOGIES 93
HCIP-Routing & Switching-IENP Lab Guide
To prevent network congestion on the link between the headquarters and branch,
configure flow-based congestion management and congestion avoidance.
Define the traffic exchanged between R4 in the headquarters and R3 on the branch
as important traffic and perform QoS guarantee for the traffic so that R4 can
communicate with R3.
On R4, run the ping command with the source address of 10.0.145.4, packet size of
700 bytes, and packet count of 10 to test the connectivity between R4 and R3.
10 packet(s) transmitted
HUAWEI TECHNOLOGIES 94
HCIP-Routing & Switching-IENP Lab Guide
4 packet(s) received
Congestion has occurred on the link between the headquarters and branch, a large
number of packets are discarded, and R4 cannot communicate with R3.
Create ACL 3001 on R1 to match the traffic sent from 10.0.145.4 to 10.0.34.3.
Create a traffic classifier class-ef, reference ACL 3001 in the traffic classifier, create a
traffic behavior behavior-ef, set the queue scheduling mode to EF, and set the
bandwidth to 10 kbit/s.
[R1-classifier-class-ef]quit
[R1-behavior-behavior-ef]queue ef bandwidth 10
Create a traffic classifier class-af32 to match data traffic with the DSCP priority of
AF32, create a traffic behavior behavior-af32, set the queue scheduling mode to AF,
set the bandwidth to 30 kbit/s, and bind the traffic behavior to the drop profile data.
[R1-classifier-class-af32]quit
[R1-behavior-behavior-af32]queue af bandwidth 30
HUAWEI TECHNOLOGIES 95
HCIP-Routing & Switching-IENP Lab Guide
[R1-behavior-behavior-af32]drop-profile data
Create a traffic policy policy-1, associate the traffic policy with the traffic classifier
class-ef and traffic behavior behavior-ef, and the traffic classifier class-af32 and
traffic behavior behavior-af32, and apply the traffic policy to S1/0/0 on R1.
[R1-trafficpolicy-policy-1]quit
On R4, run the ping command with the source address of 10.0.145.4, packet size of
700 bytes, and packet count of 10 to test the connectivity between R4 and R3.
HUAWEI TECHNOLOGIES 96
HCIP-Routing & Switching-IENP Lab Guide
10 packet(s) transmitted
10 packet(s) received
----End
QoS uses differentiated services to ensure bandwidth and shorten the delay for
various services. Does increased bandwidth solve service quality problems so that
QoS is not required?
Device Configuration
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
drop-profile data
wred dscp
HUAWEI TECHNOLOGIES 97
HCIP-Routing & Switching-IENP Lab Guide
schedule wfq 3 pq 5
input 26 output 0
queue af bandwidth 30
drop-profile data
queue af bandwidth 30
interface Serial1/0/0
link-protocol ppp
trust dscp
HUAWEI TECHNOLOGIES 98
HCIP-Routing & Switching-IENP Lab Guide
baudrate 72000
interface GigabitEthernet0/0/1
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
interface Serial1/0/0
link-protocol ppp
interface GigabitEthernet0/0/2
return
<R3>display current-configuration
[V200R007C00SPC600]
HUAWEI TECHNOLOGIES 99
HCIP-Routing & Switching-IENP Lab Guide
sysname R3
interface GigabitEthernet0/0/2
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
interface GigabitEthernet0/0/1
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
interface GigabitEthernet0/0/1
return
<S3>display current-configuration
sysname S3
interface Vlanif1
test-type udp
destination-port 6000
tos 28
frequency 3
interval seconds 1
timeout 1
datasize 5800
start now
test-type jitter
destination-port 6000
tos 46
frequency 3
interval milliseconds 20
timeout 1
datasize 90
start now
return
<S4>display current-configuration
sysname S4
interface Vlanif1
return
Learning Objectives
Topology
Scenario
Tasks
− Disable the firewall and configure a power supply for the terminal.
− Connect the RS-232 serial port of the terminal to the console port of the
firewall through the configuration cable.
− Set parameters for connecting the serial port to the device. Figure 1-2
shows parameter settings.
Figure 4-2 Setting PuTTY parameters for connecting the serial port to the firewall
− Click Open.
3. Press Enter, and enter the default administrator account admin and
password Admin@123.
4. Modify the password of the default administrator account, and enter the
CLI.
To ensure security, the password must meet the minimum complexity requirement.
That is, the password must contain at least three combinations of uppercase letters
(A to Z), lowercase letters (a to z), digits (0 to 9), and special characters (such as !, @,
#, $, and %).
Configure IP addresses and static routes for routers and the firewall, and configure
<Huawei>system-view
[Huawei]sysname R1
[R1-GigabitEthernet0/0/1]quit
[R1]interface loopback 0
<Huawei>system-view
[Huawei]sysname R2
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1]quit
[R2]interface loopback 0
<Huawei>system-view
[Huawei]sysname R3
[R3-GigabitEthernet0/0/1]quit
[R3]interface loopback 0
<USG6300>system-view
[USG6300]sysname FW
[FW-GigabitEthernet0/0/0]undo ip address
[FW-GigabitEthernet0/0/0]quit
[FW-GigabitEthernet1/0/0]quit
[FW-GigabitEthernet1/0/1]quit
[FW-GigabitEthernet1/0/2]quit
[Quidway]sysname S1
[S1]vlan batch 11 to 13
[S1-GigabitEthernet0/0/1]quit
[S1-GigabitEthernet0/0/2]quit
[S1-GigabitEthernet0/0/3]quit
[S1-GigabitEthernet0/0/21]quit
[S1-GigabitEthernet0/0/22]quit
Configure default routes on R1, R2, and R3 and specific static routes on the firewall
to implement connectivity of three network segments that are connected by three
Loopback0 interfaces.
[FW]display ip routing-table
------------------------------------------------------------------------------
Destinations : 11 Routes : 11
The firewall has four zones by default: local zone, trust zone, untrust zone, and DMZ.
Here, the trust zone, untrust zone, and DMZ are used. Add interfaces to zones. To
prevent address conflicts, delete GE0/0/0 because GE0/0/0 is added to the trust zone
by default.
[FW-zone-dmz]quit
[FW-zone-trust]quit
[FW-zone-untrust]quit
local
trust
GigabitEthernet1/0/1
untrust
GigabitEthernet1/0/0
dmz
GigabitEthernet1/0/2
[FW]display zone
local
priority is 100
trust
priority is 85
GigabitEthernet1/0/1
untrust
priority is 5
GigabitEthernet1/0/0
dmz
priority is 50
GigabitEthernet1/0/2
You can see that three interfaces have been added to corresponding zones. By
default, interfaces in different zones cannot communicate with each other. Traffic
between routers cannot pass through zones, so inter-zone security policies are
Configure a security policy to enable devices in the trust zone to access devices in
other zones and prevent access between other zones.
[FW]security-policy
[FW-policy-security-rule-policy_sec_1]source-zone trust
[FW-policy-security-rule-policy_sec_1]destination-zone untrust
[FW-policy-security-rule-policy_sec_1]action permit
[FW-policy-security-rule-policy_sec_1]quit
[FW-policy-security-rule-policy_sec_2]source-zone trust
[FW-policy-security-rule-policy_sec_2]destination-zone dmz
[FW-policy-security-rule-policy_sec_2]action permit
[FW-policy-security-rule-policy_sec_2]quit
[FW-policy-security]quit
Total:3
----------------------------------------------------------------------------
----------------------------------------------------------------------------
(0 times matched)
source-zone trust
destination-zone untrust
action permit
(0 times matched)
source-zone trust
destination-zone dmz
action permit
Check the connectivity from the trust zone to the untrust zone and DMZ.
5 packet(s) transmitted
5 packet(s) received
5 packet(s) transmitted
5 packet(s) received
Check the connectivity from the untrust zone to the trust zone and DMZ.
5 packet(s) transmitted
0 packet(s) received
5 packet(s) transmitted
0 packet(s) received
Check the connectivity from the DMZ to the untrust zone and trust zone.
5 packet(s) transmitted
0 packet(s) received
5 packet(s) transmitted
0 packet(s) received
Through verification, devices in the trust zone can access the untrust zone and the
DMZ, but devices in other zones cannot access each other.
Configure an inter-zone packet filtering policy to allow devices in the untrust zone to
access the specified server in the DMZ.
The Telnet service is enabled for the untrust zone on the server at 10.0.3.3 in the
DMZ. Enable ICMP ping to test network connectivity.
[FW]security-policy
[FW-policy-security-rule-policy_sec_3]source-zone untrust
[FW-policy-security-rule-policy_sec_3]destination-zone dmz
[FW-policy-security-rule-policy_sec_3]service icmp
[FW-policy-security-rule-policy_sec_3]service telnet
[FW-policy-security-rule-policy_sec_3]action permit
[R3]aaa
[R3-aaa]quit
[R3]user-interface vty 0 4
[R3-ui-vty0-4]authentication-mode aaa
<R1>ping 10.0.3.3
5 packet(s) transmitted
5 packet(s) received
<R1>ping 10.0.30.1
5 packet(s) transmitted
0 packet(s) received
<R1>telnet 10.0.3.3
Login authentication
Username:test
Password:
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
IP-Address : 10.0.10.1
-----------------------------------------------------------------------------
<R3>quit
<R1>telnet 10.0.30.1
<R1>
Through verification, only ICMP and Telnet packets with the specified IP address can
pass, and other traffic are denied.
Device Configuration
<S1>display current-configuration
sysname S1
vlan batch 11 to 13
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
interface GigabitEthernet0/0/21
interface GigabitEthernet0/0/22
interface GigabitEthernet0/0/23
return
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
interface GigabitEthernet0/0/1
interface LoopBack0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
interface GigabitEthernet0/0/1
interface LoopBack0
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
aaa
interface GigabitEthernet0/0/1
interface LoopBack0
user-interface vty 0 4
authentication-mode aaa
return
<FW>display current-configuration
sysname FW
interface GigabitEthernet1/0/0
interface GigabitEthernet1/0/1
interface GigabitEthernet1/0/2
set priority 85
set priority 5
set priority 50
security-policy
source-zone trust
destination-zone untrust
action permit
source-zone trust
destination-zone dmz
action permit
source-zone untrust
destination-zone dmz
service icmp
service telnet
action permit
return
Learning Objectives
Topology
Scenario
Tasks
Configure IP addresses and static routes for routers and the firewall, and configure
<Huawei>system-view
[Huawei]sysname R1
[R1-GigabitEthernet0/0/1]quit
[R1]interface loopback 0
<Huawei>system-view
[Huawei]sysname R2
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1]quit
[R2]interface loopback 0
<Huawei>system-view
[Huawei]sysname R3
[R3]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1]quit
[R3]interface loopback 0
<Huawei>system-view
[Huawei]sysname R4
[R4-GigabitEthernet0/0/1]quit
[R4]interface loopback 0
<USG6300>system-view
[USG6300]sysname FW
[FW-GigabitEthernet0/0/0]undo ip address
[FW-GigabitEthernet0/0/0]quit
[FW-GigabitEthernet1/0/0]quit
[FW-GigabitEthernet1/0/1]quit
[FW-GigabitEthernet1/0/2]quit
[Quidway]sysname S1
[S1]vlan batch 11 to 13
[S1-GigabitEthernet0/0/1]quit
[S1-GigabitEthernet0/0/2]quit
[S1-GigabitEthernet0/0/2]quit
[S1-GigabitEthernet0/0/3]quit
[S1-GigabitEthernet0/0/21]quit
[S1-GigabitEthernet0/0/22]quit
Configure default routes on R2, R3, and R4 and specific static routes on the firewall
to implement connectivity of network segments that are connected four Loopback0
interfaces. The default route does not need to be defined on R1 used as an Internet
device because R1 does not need to know any private network information about
the trust zone and DMZ.
[FW]display ip routing-table
06:44:57 2016/09/25
------------------------------------------------------------------------------
Destinations : 12 Routes : 12
The firewall has four zones by default: local zone, trust zone, untrust zone, and DMZ.
Here, the trust zone, untrust zone, and DMZ are used. Add interfaces to zones. To
prevent address conflicts, delete GE0/0/0 because GE0/0/0 is added to the trust zone
by default.
[FW-zone-dmz]quit
[FW-zone-trust]quit
[FW-zone-untrust]quit
local
trust
GigabitEthernet1/0/1
untrust
GigabitEthernet1/0/0
dmz
GigabitEthernet1/0/2
[FW]display zone
local
priority is 100
trust
priority is 85
GigabitEthernet1/0/1
untrust
priority is 5
GigabitEthernet1/0/0
dmz
priority is 50
GigabitEthernet1/0/2
You can see that three interfaces have been added to corresponding zones. By
default, interfaces in different zones cannot communicate with each other. Traffic
between routers cannot pass through zones, so inter-zone security policies are
required to allow traffic to pass.
Configure the firewall to permit data packets sent from network segments 10.0.2.0
and 10.0.3.0 in the trust zone to the untrust zone, and allow Telnet and FTP requests
sent from the untrust zone to the destination server at 10.0.4.4 in the DMZ.
[FW]security-policy
[FW-policy-security-rule-policy_sec_1]source-zone trust
[FW-policy-security-rule-policy_sec_1]destination-zone untrust
[FW-policy-security-rule-policy_sec_1]action permit
[FW-policy-security-rule-policy_sec_1]quit
[FW-policy-security-rule-policy_sec_2]source-zone untrust
[FW-policy-security-rule-policy_sec_2]destination-zone dmz
[FW-policy-security-rule-policy_sec_2]service ftp
[FW-policy-security-rule-policy_sec_2]service telnet
[FW-policy-security-rule-policy_sec_2]action permit
ID :0 name : group1
excludeIP :0 excludePort :0
description : ---
Total 1 address-groups
[FW]nat-policy
[FW-policy-nat-rule-policy_nat_1]source-zone trust
[FW-policy-nat-rule-policy_nat_1]destination-zone untrust
[FW-policy-nat-rule-policy_nat_1]source-address 10.0.2.2 24
[FW-policy-nat-rule-policy_nat_1]source-address 10.0.3.3 24
[R2]ping 11.11.11.11
5 packet(s) transmitted
0 packet(s) received
5 packet(s) transmitted
5 packet(s) received
[R3]ping 11.11.11.11
5 packet(s) transmitted
0 packet(s) received
5 packet(s) transmitted
5 packet(s) received
When you directly test the connectivity between R2 and 11.11.11.11 and between R3
and 11.11.11.11, the connectivity cannot be implemented. Perform the ping
operation with the source IP address specified. The connectivity is implemented.
The cause is that R2 directly sends data packets with the source IP address of
10.0.20.2 to the firewall and this IP address is not within the NAT address range, so
does R3.
Total:2
----------------------------------------------------------------------------
----------------------------------------------------------------------------
(2 times matched)
source-zone trust
destination-zone untrust
Set the public IP address of the NAT server to 1.1.1.254, Telnet port number to 2323,
and FTP port number to 2121.
[FW]nat server policy_natserver_1 protocol tcp global 1.1.1.254 2323 inside 10.0.4.4 telnet no-reverse
[FW]nat server policy_natserver_2 protocol tcp global 1.1.1.254 2121 inside 10.0.4.4 ftp no-reverse
name : policy_natserver_1
zone : ---
interface : ---
insideport : 23(teln)
no-reverse : yes
name : policy_natserver_2
zone : ---
interface : ---
insideport : 21(ftp)
no-reverse : yes
[R4]user-interface vty 0 4
[R4-ui-vty0-4]authentication-mode aaa
[R4-ui-vty0-4]quit
[R4]aaa
[R4-aaa]quit
You need to configure NAT Application Level Gateway (NAT ALG) during address
Configure NAT ALG in the DMZ and the untrust zone to so that the NAT server can
provide FTP services for external users.
[FW-interzone-dmz-untrust]detect ftp
Login authentication
Username:test
Password:
----------------------------------------------------------------------------
----------------------------------------------------------------------------
IP-Address : 1.1.1.1
----------------------------------------------------------------------------
<R4>quit
Connected to 1.1.1.254.
User(1.1.1.254:(none)):test
Enter password:
[R1-ftp]
The untrust zone can access Telnet and FTP services provided by the DMZ.
Device Configuration
<S1>display current-configuration
sysname S1
vlan batch 11 to 13
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/3
interface GigabitEthernet0/0/4
interface GigabitEthernet0/0/21
interface GigabitEthernet0/0/22
interface GigabitEthernet0/0/23
return
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
interface GigabitEthernet0/0/1
interface LoopBack0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
interface GigabitEthernet0/0/1
interface LoopBack0
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
interface GigabitEthernet0/0/1
interface LoopBack0
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
aaa
interface GigabitEthernet0/0/1
interface LoopBack0
user-interface vty 0 4
authentication-mode aaa
return
<FW>display current-configuration
nat server policy_natserver_1 protocol tcp global 1.1.1.254 2323 inside 10.0.4.4 telnet no-reverse
nat server policy_natserver_2 protocol tcp global 1.1.1.254 2121 inside 10.0.4.4 ftp no-reverse
sysname FW
interface GigabitEthernet1/0/0
interface GigabitEthernet1/0/1
interface GigabitEthernet1/0/2
set priority 85
set priority 5
set priority 50
detect ftp
security-policy
source-zone trust
destination-zone untrust
action permit
source-zone untrust
destination-zone dmz
service ftp
service telnet
action permit
nat-policy
source-zone trust
destination-zone untrust
return
Learning Objectives
Topology
Scenario
Tasks
<Huawei>system-view
[Huawei]sysname R1
[R1]interface loopback 0
[R1-LoopBack0]quit
<Huawei>system-view
[Huawei]sysname R2
[R2-GigabitEthernet0/0/0]quit
<Huawei>system-view
[Huawei]sysname R3
[R3-GigabitEthernet0/0/0]quit
<Huawei>system-view
[Huawei]sysname R4
<Huawei>system-view
[Huawei]sysname R5
After the configuration is complete, test the connectivity between R1 and R2 and
between R1 and R3.
[R1]ping 10.0.123.2
5 packet(s) transmitted
5 packet(s) received
[R1]ping 10.0.123.3
5 packet(s) transmitted
5 packet(s) received
Test the connectivity between R2, R3, R4, and R5. R2 is used as an example.
[R2]ping 192.168.1.3
5 packet(s) transmitted
5 packet(s) received
[R2]ping 192.168.1.4
5 packet(s) transmitted
5 packet(s) received
[R2]ping 192.168.1.5
5 packet(s) transmitted
5 packet(s) received
The loopback interface on R1 and connected interfaces on R1, R2, and R3 run in
OSPF area 0. Routes of interfaces on R2 and R3 connecting to S1 are advertised to
OSPF, but no OSPF neighbor relationships. The silent mode is therefore used.
To simulate PCs, R4 and R5 use default static routes pointing to 192.168.1.1 (VRRP
virtual IP address).
[R1]ospf 1
[R1-ospf-1]area 0
[R2]ospf 1
[R2-ospf-1]area 0
[R3]ospf 1
[R3-ospf-1]area 0
After the configuration is complete, check the routing table ofR1, R2, and R4.
[R1]display ip routing-table
------------------------------------------------------------------------------
Destinations : 9 Routes : 10
[R2]display ip routing-table
------------------------------------------------------------------------------
Destinations : 12 Routes : 12
[R4]display ip routing-table
------------------------------------------------------------------------------
Destinations : 9 Routes : 9
The preceding output shows that R1 can learn routes to 192.168.1.0/24, R2 can learn
routes to 1.1.1.1/32, and R4 has a default static route to 192.168.1.1.
Enable VRRP on interfaces of R2 and R3, and configure the VRID and virtual IP
address.
R2 is configured first and becomes the master router if there is no other member in
the VRRP group after a period of time.
After the configuration is complete, check the VRRP status on R2 and R3.
[R2]display vrrp
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
[R3]display vrrp
State : Backup
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
R2 is selected as the master router and R3 as the backup router. The priorities of
master and slave routers are both 100. When R3 is started first, it becomes the
master router, which is not expected.
Configure VRRP priorities on R2 and R3. A greater priority value indicates a higher
priority. Set VRRP priorities of R2 and R3 to 120 and 110, respectively.
[R2]display vrrp
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
[R3]display vrrp
State : Backup
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 110
PriorityConfig : 110
MasterPriority : 120
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
The preceding output shows that priorities of R2 and R3 have been changed
successfully. By default, VRRP preemption is enabled. When the priority of R3 is
changed to be higher, an active/standby switchover will be triggered.
[R4]ping 1.1.1.1
5 packet(s) transmitted
5 packet(s) received
The preceding output shows that the virtual gateway works properly and can
forward data of the LAN where R4 is located to R1. Normally, the master router
forwards data, so traffic passes through R2. To verify the switching status, perform
the ping operation from R4 to R1 for a long time and shut down the interface of R2
connected to S1.
[R2-GigabitEthernet0/0/1]shutdown
R4 discards two data packets during the switchover, and subsequent data is
forwarded normally.
20 packet(s) transmitted
18 packet(s) received
[R3]display vrrp
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.3
PriorityRun : 110
PriorityConfig : 110
MasterPriority : 110
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
If the fault occurs on the uplink link, the active/standby switchover is not performed.
In this case, all Internet access traffic cannot be forwarded after reaching R2. VRRP is
enabled to monitor the uplink. When the uplink fails, R2 automatically reduces its
priority. R3 preempts to be the master router, and traffic is switched to the backup
router and backup uplink.
Before configuring VRRP to monitor the uplink, restore the link that is shut down.
Configure VRRP to monitor the uplink interface and set the value by which the
priority decreases to 30. That is, when the link fails, the priority of R2 becomes 90,
which is lower than the priority of R3 (110).
[R2-GigabitEthernet0/0/1]undo shutdown
[R2]display vrrp
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
IF state : UP
Perform the ping operation on R4 for a long time and shut down the uplink interface
on R2.
[R2-GigabitEthernet0/0/0]shutdown
[R2]display vrrp
State : Backup
Virtual IP : 192.168.1.1
Master IP : 192.168.1.3
PriorityRun : 90
PriorityConfig : 120
MasterPriority : 110
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
IF state : DOWN
[R3]display vrrp
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.3
PriorityRun : 110
PriorityConfig : 110
MasterPriority : 110
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
Restore the uplink and priority of R2. R2 preempts to be the master router again.
During preemption, few packets are discarded on R4. This is because OSPF routes
are not converged rapidly. For details about route convergence acceleration, see the
OSPF experiment.
[R2-GigabitEthernet0/0/0]undo shutdown
[R2]display vrrp
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
IF state : UP
When the interface goes Up, the OSPF neighbor relationship needs to be
reestablished on the uplink interface of R2. If OSPF fast convergence is not
configured, data cannot be forwarded for several seconds. You are advised to set the
preemption delay to be longer than the OSPF convergence time during the
switchback.
Check the VRRP configurations again. You can see that the preemption delay has
been configured successfully.
[R2]display vrrp
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
IF state : UP
Normally, the master device forwards all traffic, and the backup device is idle.
gateways.
<R2>display vrrp
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
IF state : UP
State : Backup
Virtual IP : 192.168.1.254
Master IP : 192.168.1.3
PriorityRun : 110
PriorityConfig : 110
MasterPriority : 120
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
<R3>display vrrp
State : Backup
Virtual IP : 192.168.1.1
Master IP : 192.168.1.2
PriorityRun : 110
PriorityConfig : 110
MasterPriority : 120
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
State : Master
Virtual IP : 192.168.1.254
Master IP : 192.168.1.3
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
IF state : UP
Perform the tracert operation to check the gateways that process data destined for
the two default routes. You can see that data sent by R4 is forwarded by the master
device in VRRP group 1 and data sent by R5 is forwarded by the master device in
VRRP group 2.
<R4>tracert 1.1.1.1
o break
1 192.168.1.2 80 ms 40 ms 40 ms
2 10.0.123.1 100 ms 70 ms 70 ms
<R5>tracert 1.1.1.1
o break
1 192.168.1.3 50 ms 30 ms 50 ms
2 10.0.123.1 60 ms 90 ms 60 ms
[R2-GigabitEthernet0/0/0]shutdown
<R4>tracert 1.1.1.1
o break
1 192.168.1.3 50 ms 40 ms 50 ms
2 10.0.123.1 70 ms 80 ms 50 ms
<R5>tracert 1.1.1.1
o break
1 192.168.1.3 40 ms 50 ms 40 ms
2 10.0.123.1 70 ms 100 ms 90 ms
<R2>display vrrp
State : Backup
Virtual IP : 192.168.1.1
Master IP : 192.168.1.3
PriorityRun : 90
PriorityConfig : 120
MasterPriority : 110
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
IF state : DOWN
State : Backup
Virtual IP : 192.168.1.254
Master IP : 192.168.1.3
PriorityRun : 110
PriorityConfig : 110
MasterPriority : 120
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
<R3>display vrrp
State : Master
Virtual IP : 192.168.1.1
Master IP : 192.168.1.3
PriorityRun : 110
PriorityConfig : 110
MasterPriority : 110
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
State : Master
Virtual IP : 192.168.1.254
Master IP : 192.168.1.3
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
IF state : UP
Normally, R2 and R3 load balance traffic. When R2 is faulty, R3 takes over all traffic
on R2. In this case, load balancing of two VRRP groups is configured.
Device Configuration
<R1>display current-configuration
sysname R1
interface GigabitEthernet0/0/0
interface LoopBack0
ospf 1
area 0.0.0.0
return
<R2>display current-configuration
sysname R2
interface GigabitEthernet0/0/0
shutdown
interface GigabitEthernet0/0/1
ospf 1
silent-interface GigabitEthernet0/0/1
area 0.0.0.0
return
<R3>display current-configuration
sysname R3
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
ospf 1
silent-interface GigabitEthernet0/0/1
area 0.0.0.0
return
<R4>display current-configuration
sysname R4
interface GigabitEthernet0/0/1
return
<R5>display current-configuration
sysname R5
interface GigabitEthernet0/0/1
return
Learning Objectives
Topology
Scenario
R3. R2 is the active next hop, and R3 is the standby next hop. The link is not the
direct one, so the interface status does not affect reachability of the static routes.
BFD is used to detect reachability of the static routes. When detection fails, the
backup static route is used to forward data.
Tasks
<Huawei>system-view
[Huawei]sysname R1
[R1-GigabitEthernet0/0/1]quit
[R1-GigabitEthernet0/0/2]quit
[R1]interface LoopBack 0
^down: standby
(l): loopback
(s): spoofing
GigabitEthernet0/0/1 10.0.12.1/24 up up
GigabitEthernet0/0/2 10.0.13.1/24 up up
Serial1/0/0 unassigned up up
Serial3/0/0 unassigned up up
<Huawei>system-view
[Huawei]sysname R2
[R2-GigabitEthernet0/0/1]quit
[R2]interface LoopBack 0
[R2-LoopBack0]quit
^down: standby
(l): loopback
(s): spoofing
GigabitEthernet0/0/1 10.0.12.2/24 up up
Serial1/0/0 unassigned up up
Serial2/0/0 unassigned up up
<Huawei>system-view
[Huawei]sysname R3
[R3-GigabitEthernet0/0/2]quit
[R3]interface LoopBack 0
[R3-LoopBack0]quit
^down: standby
(l): loopback
(s): spoofing
GigabitEthernet0/0/2 10.0.13.2/24 up up
Serial2/0/0 unassigned up up
Serial3/0/0 unassigned up up
[R1]ping 10.0.12.2
5 packet(s) transmitted
5 packet(s) received
[R1]ping 10.0.13.2
5 packet(s) transmitted
5 packet(s) received
Enable BFD on the active path and check the interface on R1 connected to R2.
[R1]bfd
[R1-bfd]quit
[R1-bfd-session-1]commit
[R1-bfd-session-1]quit
[R2]bfd
[R2-bfd]quit
[R2-bfd-session-1]commit
[R2-bfd-session-1]quit
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
[R2]display ip routing-table
------------------------------------------------------------------------------
Destinations : 9 Routes : 9
[R3]display ip routing-table
------------------------------------------------------------------------------
Destinations : 9 Routes : 9
The route to R3 has the priority of 100 and is lower than the route to R2 (60). The
routing table is as follows.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
----------------------------------------------------------------------------
Summary Count : 2
Destination: 0.0.0.0/0
Preference: 60 Cost: 0
IndirectID: 0x80000001
Destination: 0.0.0.0/0
IndirectID: 0x80000002
5 packet(s) transmitted
5 packet(s) received
Perform the ping operation on R1 for a long time and shut down the interface on R2.
[R2-GigabitEthernet0/0/1]shutdown
35 packet(s) transmitted
33 packet(s) received
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
[R1]display ip routing-table
------------------------------------------------------------------------------
Destinations : 12 Routes : 12
------------------------------------------------------------------------------
Summary Count : 2
Destination: 0.0.0.0/0
Preference: 60 Cost: 0
IndirectID: 0x80000001
Destination: 0.0.0.0/0
IndirectID: 0x80000002
Device Configuration
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
bfd
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface LoopBack0
commit
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
bfd
interface GigabitEthernet0/0/1
interface LoopBack0
commit
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
interface GigabitEthernet0/0/2
interface LoopBack0
return
Learning Objectives
How to rapidly configure BFD in the Open Shortest Path First (OSPF)
environment
Topology
Scenario
R1 connects to R2 through S1. Interfaces on R1 and R2 run in OSPF area 0, and are
not directly connected. When one interfaces goes Down, the other interface cannot
detect the fault immediately and has to wait for four times the Hello time to delete
the neighbor. During this period, data is forwarded abnormally. In this case,
configure BFD to accelerate the OSPF convergence speed.
Tasks
<Huawei>system-view
[Huawei]sysname R1
[R1-GigabitEthernet0/0/1]quit
[R1]interface loopback 0
[R1-LoopBack0]quit
^down: standby
(l): loopback
(s): spoofing
GigabitEthernet0/0/1 10.0.12.1/24 up up
<Huawei>system-view
[Huawei]sysname R2
[R2-GigabitEthernet0/0/1]quit
[R2]interface loopback 0
[R2-LoopBack0]quit
^down: standby
(l): loopback
(s): spoofing
GigabitEthernet0/0/1 10.0.12.2/24 up up
[R1]ping 10.0.12.2
5 packet(s) transmitted
4 packet(s) received
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
Interfaces
Interfaces
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Total Peer(s): 1
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Total Peer(s): 1
When the OSPF neighbor relationship status is full, the OSPF configuration is
complete.
[R1]bfd
[R1-bfd]quit
[R1]ospf 1
[R1-ospf-1]quit
[R2]bfd
[R2-bfd]quit
[R2]ospf 1
[R2-ospf-1]quit
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
[R2-GigabitEthernet0/0/1]shutdown
<R1>
NeighborCurrentState=Down)
<R1>
Other association logs are not displayed here. Focus on the preceding important
logs.
[R2-GigabitEthernet0/0/1]undo shutdown
Check the BFD session status and OSPF neighbor relationship status again.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Device Configuration
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
bfd
interface GigabitEthernet0/0/1
interface LoopBack0
ospf 1
area 0.0.0.0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
bfd
interface GigabitEthernet0/0/1
interface LoopBack0
ospf 1
area 0.0.0.0
return
Learning Objectives
Topology
Scenario
R1 connects to R2 and R3 through S1 and S2. R2 and R3 are configured with VRRP
and function as gateways of R4 and R5 on a LAN. R2 is used as the master device,
and R3 is used as the backup device. When the indirectly connected uplink of R2
goes Down, uplink traffic is still forwarded through R2, causing blackhole routes. To
prevent such a problem, configure association between BFD and VRRP. When
Tasks
<Huawei>system-view
[Huawei]sysname R1
[R1]interface LoopBack 0
[R1-LoopBack0]quit
[R1-GigabitEthernet0/0/1]quit
[R1-GigabitEthernet0/0/2]quit
<Huawei>system-view
[Huawei]sysname R2
[R2]interface LoopBack 0
[R2-LoopBack0]quit
[R2-GigabitEthernet0/0/1]quit
[R2-GigabitEthernet0/0/0]quit
<Huawei>system-view
[Huawei]sysname R3
[R3]interface LoopBack 0
[R3-LoopBack0]quit
[R3-GigabitEthernet0/0/2]quit
[R3-GigabitEthernet0/0/0]quit
<Huawei>system-view
[Huawei]sysname R4
[R4-GigabitEthernet0/0/0]quit
<Huawei>system-view
[Huawei]sysname R5
[R5-GigabitEthernet0/0/0]quit
<Huawei>system-view
[Huawei]sysname SW1
[SW1]vlan 12
[SW1-vlan12]quit
[SW1-GigabitEthernet0/0/1]quit
[SW1-GigabitEthernet0/0/2]quit
<Huawei>system-view
[Huawei]sysname SW2
[SW2]vlan 13
[SW2-vlan13]quit
[SW2-GigabitEthernet0/0/1]quit
[SW2-GigabitEthernet0/0/3]quit
^down: standby
(l): loopback
(s): spoofing
GigabitEthernet0/0/1 10.0.12.1/24 up up
GigabitEthernet0/0/2 10.0.13.1/24 up up
Serial1/0/0 unassigned up up
Serial3/0/0 unassigned up up
^down: standby
(l): loopback
(s): spoofing
GigabitEthernet0/0/0 192.168.45.2/24 up up
GigabitEthernet0/0/1 10.0.12.2/24 up up
Serial1/0/0 unassigned up up
Serial2/0/0 unassigned up up
^down: standby
(l): loopback
(s): spoofing
GigabitEthernet0/0/0 192.168.45.3/24 up up
GigabitEthernet0/0/2 10.0.13.2/24 up up
Serial2/0/0 unassigned up up
Serial3/0/0 unassigned up up
^down: standby
(l): loopback
(s): spoofing
GigabitEthernet0/0/0 192.168.45.4/24 up up
Serial1/0/0 unassigned up up
^down: standby
(l): loopback
(s): spoofing
GigabitEthernet0/0/0 192.168.45.5/24 up up
Serial1/0/0 unassigned up up
[R1]ping 10.0.12.2
5 packet(s) transmitted
4 packet(s) received
[R1]ping 10.0.13.2
5 packet(s) transmitted
4 packet(s) received
Configure OSPF on R1, R2, and R3 according to the topology. Use network
commands to import OSPF routes and enable the silent interface.
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
Modify the OSPF cost on R1 so that downlink traffic is forwarded through R2.
[R1-GigabitEthernet0/0/1]ospf cost 90
[R1-GigabitEthernet0/0/1]quit
[R1-GigabitEthernet0/0/2]quit
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
[R2-GigabitEthernet0/0/1]ospf cost 90
[R2-GigabitEthernet0/0/1]quit
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit
[R3-GigabitEthernet0/0/2]quit
----------------------------------------------------------------------------
Destinations : 3 Routes : 3
Destinations : 3 Routes : 3
Destinations : 0 Routes : 0
----------------------------------------------------------------------------
Destinations : 3 Routes : 3
Destinations : 3 Routes : 3
Destinations : 0 Routes : 0
----------------------------------------------------------------------------
Destinations : 3 Routes : 3
Destinations : 3 Routes : 3
Destinations : 0 Routes : 0
[R2-GigabitEthernet0/0/0]quit
[R3-GigabitEthernet0/0/0]quit
[R2]display vrrp
State : Master
Virtual IP : 192.168.45.1
Master IP : 192.168.45.2
PriorityRun : 150
PriorityConfig : 150
MasterPriority : 150
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
[R3]display vrrp
State : Backup
Virtual IP : 192.168.45.1
Master IP : 192.168.45.2
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 150
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
Enable BFD on R1 and R2, and associate BFD with VRRP. When BFD detects a fault,
the priority of the VRRP group is reduced immediately.
[R1]bfd
[R1-bfd]quit
[R1-bfd-session-1]commit
[R1-bfd-session-1]quit
[R2]bfd
[R2-bfd]quit
[R2-bfd-session-1]commit
[R2-bfd-session-1]quit
[R2]display vrrp
State : Master
Virtual IP : 192.168.45.1
Master IP : 192.168.45.2
PriorityRun : 150
PriorityConfig : 150
MasterPriority : 150
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
BFD-session state : UP
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Test BFD effects. Perform the ping operation for a long time on R4 and shut down
the interface on R1.
[R1-GigabitEthernet0/0/1]shutdown
32 packet(s) transmitted
30 packet(s) received
[R2]display vrrp
State : Backup
Virtual IP : 192.168.45.1
Master IP : 192.168.45.3
PriorityRun : 90
PriorityConfig : 150
MasterPriority : 100
TimerRun : 1 s
TimerConfig : 1 s
Backup-forward : disabled
Association between BFD and VRRP used to detect indirectly connected uplink
detections is successful. The result on R5 is similar to that on R4, and the verification
is not provided.
Device Configuration
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
bfd
interface GigabitEthernet0/0/1
ospf cost 90
interface GigabitEthernet0/0/2
interface LoopBack0
commit
ospf 1
area 0.0.0.0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
bfd
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
ospf cost 90
interface LoopBack0
commit
ospf 1
silent-interface GigabitEthernet0/0/0
area 0.0.0.0
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/2
interface LoopBack0
ospf 1
silent-interface GigabitEthernet0/0/0
area 0.0.0.0
return
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
interface GigabitEthernet0/0/0
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
interface GigabitEthernet0/0/0
return
<SW1>display current-configuration
sysname SW1
vlan batch 12
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
return
<SW2>display current-configuration
sysname SW2
vlan batch 13
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/3
return
Huawei e-Learning
https://ilearningx.huawei.com/portal/#/portal/ebg/51
Huawei Certification
http://support.huawei.com/learning/NavigationAction!createNavi?navId=_31
&lang=en
Find Training
http://support.huawei.com/learning/NavigationAction!createNavi?navId=_trai
ningsearch&lang=en
More Information
Huawei learning APP