NE9000 V800R023C00SPC500 Configuration Guide 17 Security
NE9000 V800R023C00SPC500 Configuration Guide 17 Security
V800R023C00SPC500
Configuration Guide
Issue 01
Date 2023-09-30
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 purchased products, services and features are stipulated by the contract made between Huawei and
the customer. All or part of the products, services and features described in this document may not be
within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,
information, and recommendations in this document are provided "AS IS" without warranties, guarantees
or representations of any kind, either express or implied.
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, express or implied.
Website: https://www.huawei.com
Email: support@huawei.com
Contents
1 Configuration............................................................................................................................1
1.1 Security....................................................................................................................................................................................... 1
1.1.1 About This Document........................................................................................................................................................ 1
1.1.2 AAA and User Management Configuration................................................................................................................7
1.1.2.1 AAA and User Management Overview..................................................................................................................... 7
1.1.2.2 Feature Requirements for AAA and User Management (Administrative User)..........................................8
1.1.2.3 Configuring AAA............................................................................................................................................................... 8
1.1.2.3.1 Configuring AAA Schemes......................................................................................................................................... 9
1.1.2.3.2 (Optional) Configuring Local Users..................................................................................................................... 11
1.1.2.3.3 (Optional) Configuring an HWTACACS Server Template............................................................................. 14
1.1.2.3.4 (Optional) Configuring a RADIUS Server Group............................................................................................. 18
1.1.2.3.5 Configuring AAA Schemes for the Domain....................................................................................................... 18
1.1.2.3.6 Verifying the AAA Configuration........................................................................................................................... 20
1.1.2.4 Configuring a Device as a RADIUS Client.............................................................................................................. 21
1.1.2.4.1 Configuring Basic RADIUS Functions................................................................................................................... 21
1.1.2.4.2 (Optional) Configuring RADIUS Packets and Attributes Carried in the Packets.................................. 28
1.1.2.4.3 (Optional) Configuring RADIUS Server Status Detection.............................................................................36
1.1.2.4.4 (Optional) Configuring Whitelist Session-CAR for RADIUS Sessions....................................................... 38
1.1.2.4.5 Verifying the Configuration.....................................................................................................................................39
1.1.2.5 Configuring Command-Line Authorization...........................................................................................................40
1.1.2.5.1 Configuring Level Authorization........................................................................................................................... 40
1.1.2.5.2 Configuring Task Authorization............................................................................................................................. 41
1.1.2.5.3 Verifying the Command-line Authorization Configuration..........................................................................43
1.1.2.6 Configuring the Command-Line Recording Scheme..........................................................................................43
1.1.2.7 Configuring AAA Security Measures........................................................................................................................44
1.1.2.7.1 Security Hardening for Local User Accounts.....................................................................................................44
1.1.2.7.2 Configuring a Forbidden Password String for Local Users........................................................................... 51
1.1.2.7.3 Configuring the Locking Function for Administrators Who Fail Remote Authentication................. 52
1.1.2.8 Maintaining AAA and User Management............................................................................................................. 52
1.1.2.8.1 Displaying the AAA Operation Information...................................................................................................... 52
1.1.2.8.2 Clearing AAA Statistics............................................................................................................................................. 53
1.1.2.8.3 Logging Out Users..................................................................................................................................................... 54
1.1.2.9 Configuration Examples for AAA and User Management............................................................................... 55
1.1.14.15 Configuring the BMP Device to Report Local-RIB Routes in the BGP-Flow Address Family........ 380
1.1.14.16 Configuring the BMP Device to Report Local-RIB Routes in the BGP-IPv6-Flow Address Family
......................................................................................................................................................................................................... 382
1.1.14.17 Configuration Examples for BGP Flow Specification.................................................................................. 383
1.1.14.17.1 Example for Configuring Dynamic BGP Flow Specification..................................................................383
1.1.14.17.2 Example for Configuring Static BGP Flow Specification........................................................................ 387
1.1.14.17.3 Example for Configuring dynamic BGP Flow Specification with a BGP RR.................................... 392
1.1.14.17.4 Example for Configuring Dynamic BGP IPv6 Flow Specification........................................................ 397
1.1.14.17.5 Example for Configuring Static BGP IPv6 Flow Specification.............................................................. 401
1.1.14.17.6 Example for Configuring dynamic BGP IPv6 Flow Specification with a BGP RR...........................406
1.1.14.17.7 Example for Configuring Dynamic BGP VPN Flow Specification........................................................411
1.1.14.17.8 Example for Configuring Static BGP VPN Flow Specification.............................................................. 415
1.1.14.17.9 Example for Configuring Dynamic BGP IPv6 VPN Flow Specification.............................................. 420
1.1.14.17.10 Example for Configuring Static BGP IPv6 VPN Flow Specification.................................................. 423
1.1.14.17.11 Example for Configuring Dynamic BGP VPNv4 Flow Specification.................................................427
1.1.14.17.12 Example for Configuring Static BGP VPNv4 Flow Specification....................................................... 431
1.1.14.17.13 Example for Configuring Dynamic BGP VPNv6 Flow Specification.................................................435
1.1.14.17.14 Example for Configuring Static BGP VPNv6 Flow Specification....................................................... 439
1.1.15 IPsec Configuration...................................................................................................................................................... 444
1.1.15.1 Overview of IPsec...................................................................................................................................................... 445
1.1.15.2 Feature Requirements for IPsec............................................................................................................................446
1.1.15.3 Configuring an IPsec SA Manually...................................................................................................................... 446
1.1.15.3.1 Configuring a Security Proposal....................................................................................................................... 446
1.1.15.3.2 Configuring an SA................................................................................................................................................. 447
1.1.15.3.3 Applying IPsec......................................................................................................................................................... 448
1.1.15.3.4 Checking the Manual IPsec Configuration....................................................................................................450
1.1.15.4 Configuration Examples for IPsec........................................................................................................................ 450
1.1.15.4.1 Manual IPsec Configuration Scenario.............................................................................................................450
1.1.16 PKI Configuration......................................................................................................................................................... 456
1.1.16.1 Overview of PKI......................................................................................................................................................... 456
1.1.16.2 Feature Requirements for PKI............................................................................................................................... 457
1.1.16.3 Configuring CMP-based Certificate Management......................................................................................... 457
1.1.16.3.1 Creating an RSA Key Pair.................................................................................................................................... 458
1.1.16.3.2 Configuring Entity Information......................................................................................................................... 458
1.1.16.3.3 Configuring CMP Sessions.................................................................................................................................. 460
1.1.16.3.4 Configuring CMP-based Certificate Management..................................................................................... 461
1.1.16.3.5 Verifying the Configuration of CMP-based Certificate Management................................................. 463
1.1.16.4 Configuring PKI Certificate.....................................................................................................................................464
1.1.16.4.1 Creating an RSA Key Pair.................................................................................................................................... 464
1.1.16.4.2 Configuring Entity Information......................................................................................................................... 465
1.1.16.4.3 Obtaining a Certificate.........................................................................................................................................467
1.1.16.4.4 Verifying the PKI Certificate Configuration...................................................................................................468
1.1.16.5 Configuring Certificate Validity Check............................................................................................................... 469
1 Configuration
1.1 Security
Purpose
This document provides the basic concepts, configuration procedures, and
configuration examples in different application scenarios of the security feature.
Licensing Requirements
For details about the License, see the License Guide.
● Enterprise users: License Usage Guide
Related Version
The following table lists the product version related to this document.
Intended Audience
This document is intended for:
Security Declaration
● Notice on Limited Command Permission
The documentation describes commands when you use Huawei devices and
make network deployment and maintenance. The interfaces and commands
for production, manufacturing, repair for returned products are not described
here.
If some advanced commands and compatible commands for engineering or
fault location are incorrectly used, exceptions may occur or services may be
interrupted. It is recommended that the advanced commands be used by
engineers with high rights. If necessary, you can apply to Huawei for the
permissions to use advanced commands.
● Encryption algorithm declaration
The encryption algorithms DES/3DES/RSA (with a key length of less than
3072 bits)/MD5 (in digital signature scenarios and password encryption)/
SHA1 (in digital signature scenarios) have a low security, which may bring
security risks. If protocols allowed, using more secure encryption algorithms,
such as AES/RSA (with a key length of at least 3072 bits)/SHA2/HMAC-SHA2
is recommended.
For security purposes, insecure protocols Telnet, FTP, and TFTP as well as
weak security algorithms in BGP, LDP, PECP, MSDP, DCN, TCP-AO, MSTP, VRRP,
E-Trunk, AAA, IPsec, BFD, QX, port extension, SSH, SNMP, IS-IS, RIP, SSL, NTP,
OSPF, and keychain features are not recommended. To use such weak security
algorithms, run the undo crypto weak-algorithm disable command to enable
the weak security algorithm function. For details, see the Configuration Guide.
● Password configuration declaration
– When the password encryption mode is cipher, avoid setting both the
start and end characters of a password to "%^%#". This causes the
password to be displayed directly in the configuration file.
– To further improve device security, periodically change the password.
● MAC addresses and Public IP addresses Declaration
– For purposes of introducing features and giving configuration examples,
the MAC addresses and public IP addresses of real devices are used in the
product documentation. Unless otherwise specified, these addressees are
used as examples only.
– Open-source and third-party software may contain public addresses
(including public IP addresses, public URLs/domain names, and email
addresses), but this product does not use these public addresses. This
complies with industry practices and open-source software usage
specifications.
– For purposes of implementing functions and features, the device uses the
following public IP addresses:
Special Declaration
● This document package contains information about the NE9000. For details
about hardware, such as devices or boards sold in a specific country/region,
see Hardware Description.
● This document serves only as a guide. The content is written based on device
information gathered under lab conditions. The content provided by this
document is intended to be taken as general guidance, and does not cover all
scenarios. The content provided by this document may be different from the
information on user device interfaces due to factors such as version upgrades
and differences in device models, board restrictions, and configuration files.
The actual user device information takes precedence over the content
provided by this document. The preceding differences are beyond the scope of
this document.
● The maximum values provided in this document are obtained in specific lab
environments (for example, only a certain type of board or protocol is
configured on a tested device). The actually obtained maximum values may
be different from the maximum values provided in this document due to
factors such as differences in hardware configurations and carried services.
● Interface numbers used in this document are examples. Use the existing
interface numbers on devices for configuration.
● The pictures of hardware in this document are for reference only.
● The supported boards are described in the document. Whether a
customization requirement can be met is subject to the information provided
at the pre-sales interface.
● In this document, public IP addresses may be used in feature introduction and
configuration examples and are for reference only unless otherwise specified.
● The configuration precautions described in this document may not accurately
reflect all scenarios.
● Log Reference and Alarm Reference respectively describe the logs and alarms
for which a trigger mechanism is available. The actual logs and alarms that
the product can generate depend on the types of services it supports.
● All device dimensions described in this document are designed dimensions
and do not include dimension tolerances. In the process of component
manufacturing, the actual size is deviated due to factors such as processing or
measurement.
Symbol Conventions
The symbols that may be found in this document are defined as follows.
Symbol Description
Symbol Description
Command Conventions
The command conventions that may be found in this document are defined as
follows.
Convention Description
Change History
Changes between document issues are cumulative. The latest document issue
contains all the changes made in earlier issues.
V800R023C00SPC500 01 2023-09-30
AAA
Authentication, Authorization, and Accounting (AAA) refers to a combination of
security-related technologies used to authenticate and authorize users, as well as
to account for the service provided to the users.
● Authentication: checks whether a user has the rights to access the network.
● Authorization: authorizes a user so that the user can use a specified service.
● Accounting: records the usage of network resources for charging purposes.
AAA uses the client/server model. This model features good extensibility and
facilitates centralized management over user information, as shown in Figure 1-1.
Usage Scenario
● Local authentication and authorization
If user authentication or authorization is required when no RADIUS or
HWTACACS server is deployed on the network, user authentication or
authorization can be implemented in local authentication or authorization
mode. Local authentication and authorization feature fast processing and low
operation cost, whereas the amount of information that can be stored is
limited by the hardware capacity of the device.
Local authentication and authorization are often used for administrators.
Local authentication is a backup of RADIUS authentication and HWTACACS
authentication; local authorization is a backup of HWTACACS authorization.
● HWTACACS authentication, authorization, and accounting: The
authentication, authorization, and accounting in HWTACACS mode can
prevent unauthorized users from attacking the network. In addition, the
HWTACACS mode supports the authorization of command lines. Compared
with RADIUS, HWTACACS is more reliable in transmission and encryption and
is more suitable for security control.
● RADIUS authentication and accounting: The authentication and accounting in
RADIUS mode can prevent unauthorized users from attacking the network.
The RADIUS mode is often used in network environments requiring high
security and remote access control.
Pre-configuration Tasks
Before configuring AAA, complete the following tasks:
● Power on the router or switch and ensuring that the self-test is successful.
● Ensure that the device is accessible.
Configuration Procedures
Context
Configuring AAA schemes include:
● Configure an authentication scheme.
● Configure an authorization scheme.
● Configure an accounting scheme.
Procedure
● Configure an authentication scheme.
a. Run system-view
The system view is displayed.
b. Run aaa
The AAA view is displayed.
c. Run authentication-scheme scheme-name
An authentication scheme is created, and its view is displayed.
A maximum of 32 authentication schemes can be configured.
d. Run authentication-mode { hwtacacs | radius | local }*
An authentication mode is configured.
The radius parameter can be specified only for the admin VS.
NOTE
The next configured authentication mode is used only when the current one does
not take effect (for example, the server does not respond). If the current
authentication succeeds or fails, the next authentication mode is not used.
In the scenario where HWTACACS authentication and then local authentication
are configured, after the authentication-reliability auto-change-next
command is run, a user is automatically switched to local authentication if
HWTACACS remote authentication fails.
e. (Optional) Run authentication-reliability auto-change-next
The device is configured to automatically perform local authentication for
users who fail HWTACACS remote authentication.
f. Run commit
The configuration is committed.
● Configure an authorization scheme.
a. Run system-view
The system view is displayed.
b. Run aaa
The AAA view is displayed.
c. Run authorization-scheme authorization-scheme-name
An authorization scheme is created, and its view is displayed.
A maximum of 32 authorization schemes can be configured.
d. Run authorization-mode authorization-mode1 [ authorization-mode2
[ authorization-mode3 [ authorization-mode4 ] ] ]
An authorization mode is configured.
If multiple authorization modes are configured in an authorization
scheme, the authorization modes are used in the sequence in which they
are configured.
NOTE
The next configured authorization mode is used only when the current one does
not take effect (for example, the server does not respond). If the current
authorization succeeds or fails, the next authorization mode is not used.
e. Run commit
The configuration is committed.
● Configure an accounting scheme.
a. Run system-view
The system view is displayed.
b. Run aaa
The AAA view is displayed.
The radius parameter can be specified only for the admin VS.
e. Run commit
----End
Follow-up Procedure
Perform one of the following operations based on the configured authentication,
authorization, and accounting modes:
Procedure
● Configuring local users in AAA view.
a. Run system-view
▪ If the user name contains the at sign (@), the characters before the
at sign (@) are the user name, and the characters after the at sign
(@) are the domain name
▪ If the user name does not contain the at sign (@), the entire
character string is the user name, and the domain name is
default_admin.
▪ Input in simple text: When the user security policy is configured, the
password cannot be the same as the user name or its reverse. The
password must contain the following characters: upper-case
character, lower-case character, digit, and special character.
NOTE
The function to forcibly change the initial password of the local user is
disabled.
e. (Optional) Run local-user user-name password-force-change disable
NOTE
To ensure device security, a local user must change the initial password upon the
first login. You are not advised to disable forcible modification of the initial
password for a local user.
f. (Optional) Run local-user user-name service-type { { terminal | telnet |
ftp | ssh | qx | snmp | mml | http } * | ppp }
NOTE
If the access type of the local user is set to FTP, the FTP directory of the local user
must be configured and the level of local user cannot be lower than
management level. Otherwise, FTP user login will fail.
h. Configure the level of the local user or the group to which the local user
belongs according to the command-line authorization mode.
The configured level of the local user cannot be higher than that of the login-in
user.
NOTE
If a local user is in the locked state, you need to unlock it. Two ways are available
for you to choose:
● In the AAA view, run the user-block reactive reactive-time command to
configure the interval at which a user will be automatically unlocked. If the
locking time for a user exceeds the time set in the configuration, the user will
be automatically unlocked.
● In the user view, run the activate aaa local-user user-name command to
manually unlock the specified local user.
l. Run quit
Return to the system view.
m. (Optional) Run aaa abnormal-offline-record
The abnormal logout events are recorded.
After this function is enabled, information about abnormal logout events
can be provided for administrators to manage and maintain user
information.
n. Run quit
Return to the user view.
o. (Optional) Run local-user change-password
The password of the local user is changed.
p. Run commit
The configuration is committed.
● Configuring a local user in the local AAA server view.
a. Run system-view
The system view is displayed.
b. Run local-aaa-server
The local AAA server view is displayed.
c. Run user username { password { cipher cipher-password | irreversible-
cipher irreversible-password } | authentication-type type-mask | { active
| block [ fail-times fail-times-value interval interval-value ] } | ftp-
directory ftp-directory | level level | user-group user-group-name } *
A local user account is added.
NOTE
Context
You can configure an HWTACACS server template as follows:
● Configure a shared key for the communication between the device and
HWTACACS server.
● Configure an IP address for the primary and for the secondary
HWTACACS servers using either of the following methods:
– Configure IP addresses for the primary and secondary HWTACACS
common servers.
– Configure IP addresses for the primary and secondary HWTACACS
authentication servers, primary and secondary HWTACACS authorization
servers, and primary and secondary HWTACACS accounting servers.
● Configure a source address for the device to communicate with the
HWTACACS server.
To prevent data transmission risks between the device and HWTACACS server, you are
advised to deploy them in a security domain.
Procedure
Step 1 Run system-view
HWTACACS is enabled.
A default remote address is configured for the communication between the device
(HWTACACS client) and an HWTACACS server.
A shared key is configured for the communication between the device and the
HWTACACS server.
Setting the key improves the security of the communication between the NE9000
and the HWTACACS server.
NOTE
To ensure the validity of both parties, the router and the HWTACACS server must be
configured with the same key.
Step 7 You can use either of the following methods to configure an IP address and shared
key for the primary/secondary HWTACACS server.
NOTE
● When the common server is configured as the primary server, the configurations of the
primary authentication, accounting, and authorization servers are deleted. When
another type of server (authentication, accounting, or authorization server) is
configured as the primary server, the configurations of the common server are deleted.
● When the common server is configured as the primary server and the server is available,
the configurations of other types of servers (authentication, accounting, and
authorization servers) do not take effect.
● The IP addresses and host names of the primary and the secondary servers must be
different; otherwise, the server configuration fails.
● Configure an IP address and a shared key for the primary/secondary
HWTACACS common server.
For an IPv4 server, run the hwtacacs-server ip-address [ port ] [ shared-key
{ key-string | cipher cipher-string } | mux-mode | { vpn-instance vpn-
instance-name | public-net } ] * [ secondary ] command.
For an IPv6 server, run the hwtacacs-server ipv6-address [ port ] [ shared-
key { key-string | cipher cipher-string } | mux-mode | vpn-instance vpn-
instance-name ]* [ secondary ] command.
● Configure IP addresses and shared keys for the primary/secondary HWTACACS
authentication server, HWTACACS authorization server, and HWTACACS
accounting server.
a. Configure an IP address and a shared key for the primary/secondary
HWTACACS authentication server.
A source address is configured for the communication between the device and the
HWTACACS server.
If the device does not receive any response from the HWTACACS server within the
specified response timeout period, the device considers the HWTACACS server
unavailable. In this case, the device attempts to use other methods for
authentication, authorization, and accounting.
A timer value for the primary server to switch to the active state is set.
The device is configured to encapsulate the domain name into the username to be
sent to the HWTACACS server.
If the HWTACACS server does not accept the username containing the domain
name, you can configure the device to delete the domain name and then send the
username without the domain name to the HWTACACS server.
NOTE
----End
Context
Configure the RADIUS authentication server and accounting server. For details, see
Configuring a RADIUS Server Group.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run aaa
The AAA view is displayed.
Step 3 (Optional) Run service-type terminal force-domain domain-name
A forced domain is configured for a console interface.
When users logging in through the console interface and users logging in using
other login methods must be distinguished, run the service-type terminal force-
domain command to specify a forced domain for the console interface. After the
configuration becomes effective, users logging in through the console interface
automatically enter the forced domain and are not allocated any other domain
based on the user names. In this manner, users logging in through the console
interface and users logging using other methods are distinguished and allocated
different rights.
In VS mode, this command is supported only by the admin VS.
Step 4 (Optional) Run default-domain { admin | access } domain-name
The domain name created in the preceding step is configured as the default
domain name.
After you manually create a domain name, for example, first_domain, you must
suffix @first_domain to the user name during authentication, which is
inconvenient. To facilitate user authentication, run the default-domain command
to set the domain name first_domain as the default domain name. With this
configuration, @first_domain is automatically suffixed to user names.
Step 5 (Optional) Run domain-name-delimiter delimiter
The domain name delimiter is configured.
Step 6 (Optional) Run domain-location { after-delimiter | before-delimiter }
The domain name location is configured so that the system can correctly parse
the user name and domain name.
NOTE
The configured default level of the local user cannot be higher than that of the login-in user.
Step 16 (Optional) Run service-type { ftp | ppp | ssh | telnet | terminal | snmp | qx | mml
| http } *
The access type of users in a domain is configured.
The parameters terminal, qx and mml are supported only on the Admin-VS.
The local-user service-type command configures the user access type for a
specific user. When a user attempts to log in, the access type configured in the
domain view and the access type configured using the local-user service-type
command are checked in sequence. The user is allowed to log in only when both
access types are authenticated.
Step 17 Run commit
The configuration is committed.
----End
Prerequisites
Related AAA configurations are complete.
Procedure
● Run display accounting-scheme
The configuration of the accounting scheme is displayed.
● Run display authentication-scheme [authentication-scheme-name ]
The configuration of the authentication scheme is displayed.
● Run display authorization-scheme [authorization-scheme-name ]
The configuration of the authorization scheme is displayed.
● Run display domain domain-name
The configuration of the domain is displayed.
● Run display hwtacacs current-status
The current status information about the HWTACACS is displayed.
----End
Context
NOTE
Context
If remote authentication, authorization, and accounting are performed for users
through a RADIUS server, you need to configure a RADIUS server group.
Procedure
Step 1 Run system-view
A shared key is configured for the communication with the RADIUS server.
NOTE
RADIUS authentication and accounting servers can use the same IP address, indicating that
one server can perform both RADIUS authentication and accounting functions. If a server
performs both RADIUS authentication and accounting functions, it uses a separate interface
for each function.
----End
Context
To determine the route between a device and each RADIUS server to which it
connects, you can configure a source interface (which connects the device to a
RADIUS server) for each RADIUS server in the system view, RADIUS server group
view, or both. If a source interface is configured in the RADIUS server group view,
all RADIUS servers in this group use the configured interface to communicate with
the device. Otherwise, the global source interface configured in the system view is
used.
When the device sends packets to a RADIUS server deployed in a VPN, the device
preferentially uses the IP address of the source interface configured using the
radius-server source interface command as the source address. In scenarios
where no source interface is configured, the device searches for a reachable route
based on the VPN and destination IP address. If a route is found, the device uses
the IP address of the route's outbound interface as the source address; otherwise,
the device selects the IP address of any interface in the VPN as the source address.
Procedure
● Configure a global source interface for RADIUS servers.
a. Run system-view
The system view is displayed.
b. Run radius-server source interface interface-type interface-number
A global source interface is configured for RADIUS servers.
c. Run commit
Context
A device must use the negotiated RADIUS parameters and message format to
communicate with a RADIUS server.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Configure global negotiation parameters between the device and RADIUS server
as required.
Table 1-4 Configuring global negotiation parameters between the device and
RADIUS server
Operation Command Description
Step 4 Configure negotiation parameters between the device and RADIUS server group as
required.
Table 1-5 Configuring negotiation parameters between the device and RADIUS
server group
----End
Context
To ensure that factors such as network faults or delay do not prevent the device
from receiving response packets sent by the RADIUS server, configure the caching
and retransmission mechanisms for request packets to be sent to the RADIUS
server. Perform configurations based on site requirements.
Procedure
Step 1 Run system-view
----End
Context
To prevent RADIUS packets sent by a device from being discarded due to network
congestion, you can configure a DSCP value for the RADIUS packets sent by the
device to the RADIUS server in either the system view or the RADIUS server group
view. The DSCP value configured in the RADIUS server group view takes
precedence over that configured in the system view.
Procedure
● In the system view, configure a DSCP value for RADIUS packets:
a. Run system-view
The system view is displayed.
b. Run radius-server packet dscp dscp-value
A DSCP value is configured for RADIUS packets sent by the device.
c. Run commit
The configuration is committed.
● In the RADIUS server group view, configure a DSCP value for RADIUS packets:
a. Run system-view
The system view is displayed.
b. Run radius-server group group-name
The RADIUS server group view is displayed.
c. Run radius-server packet dscp dscp-value
A DSCP value is configured for RADIUS packets sent by the device.
d. Run commit
The configuration is committed.
----End
Configuring the Device to Use Extended Source Ports to Send and Receive RADIUS
Packets
Context
You can configure the device to use extended source ports instead of the default
ports for sending and receiving RADIUS packets. This configuration also enables
you to increase the number of non-retransmitted packets sent to the RADIUS
server in a certain period of time.
The first half of the extended source ports are used to send and receive RADIUS
authentication packets, whereas the second half of the ports are used to send and
receive RADIUS accounting packets. If an odd number of ports is specified, one
port more is used for sending and receiving authentication packets than for
accounting packets.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run radius-server extended-source-ports [ start-port start-port-number ] port-
number port-number
Extended source ports for sending and receiving RADIUS packets are configured.
NOTE
If you do not specify start-port-number when configuring extended source ports, the system
assigns a configured number of valid extended source ports.
----End
Context
To prevent the RADIUS server from receiving too many attributes that are not
required or recognized, many attributes are not sent to the RADIUS server by
default. These attributes can be carried in RADIUS packets.
Procedure
Step 1 Run system-view
Operation Command
Operation Command
----End
Context
Different vendors define some RADIUS attributes differently and provide RADIUS
servers that support different RADIUS attribute sets. To communicate with
different RADIUS servers, the device provides the RADIUS attribute translation
function.
After this function is configured, the device can encapsulate or parse src-attribute
by using the format of dest-attribute when sending or receiving RADIUS packets,
enabling the device to communicate with different types of RADIUS servers.
This function is applied when one attribute has multiple formats. For example, the
nas-port-id attribute has a new format and an old format. If the device uses the
new format but the RADIUS server uses the old format, you can run the radius-
attribute translate nas-port-id nas-port-identify-old receive send command on
the device.
Procedure
Step 1 Run system-view
Step 4 Perform any of the following operations to configure RADIUS attribute translation:
Operation Command
----End
Prerequisites
You must enable RADIUS attribute translation before disabling RADIUS attributes.
Context
RADIUS attributes need to be disabled in the following scenarios:
● The RADIUS server cannot identify or does not expect some RADIUS
attributes. In this scenario, you can disable the device from encapsulating
some attributes into the packets it sends to the RADIUS server.
● You want the device to ignore some attributes sent by the RADIUS server. In
this scenario, you can disable the device from processing the attributes.
This function takes effect on only the RADIUS servers in the RADIUS server group
within which it is configured. A maximum of 64 attributes can be disabled in a
RADIUS server group.
You can disable RADIUS attributes of both the sent and received packets on the
device.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run radius-server group group-name
The RADIUS server group view is displayed.
Step 3 Run radius-server attribute translate
RADIUS attribute translation is enabled.
Step 4 Run any of the following commands to disable RADIUS attributes:
Operation Command
Operation Command
----End
Context
For details about the RADIUS attributes supported by the device, see Description
of RADIUS Attributes. The content, format, and encapsulation mode of some
RADIUS attributes can be configured.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run radius-server group group-name
The RADIUS server group view is displayed.
Step 3 Configure standard RADIUS attributes in the RADIUS server group view as
required.
Table 1-9 Configuring standard RADIUS attributes in the RADIUS server group
view
----End
Context
The content or format of some Huawei proprietary RADIUS attributes can be
configured.
Procedure
Step 1 Run system-view
Step 3 Configure extended RADIUS attributes in the RADIUS server group view as
required.
Table 1-10 Configuring extended RADIUS attributes in the RADIUS server group
view
----End
Context
RADIUS clients can detect the status of RADIUS servers and, based on the
responses they receive, determine the real-time status of the servers. This helps
identify which servers are in the Up state so that user request packets can be
processed in real time.
The configuration is valid for all RADIUS servers.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run radius-server { dead-count count [ fail-rate fail-rate ] | dead-timedead-time
[ recover-count invalid ] | dead-interval interval }*
Parameters are configured for determining whether the state of a RADIUS server
changes from Up to Down.
If the device consecutively sends the number of RADIUS packets specified by
dead-count to the RADIUS server but receives no response and the interval
between when the device expects to receive the first response and the value
specified by dead-count is longer than the value of dead-interval, the device
considers that the RADIUS server is abnormal. In this case, the device sets the
state of the RADIUS server to Down.
Step 3 Configure a mode for restoring the Up state of the RADIUS server after its state is
set to Down.
Table 1-11 Configuring a mode for restoring the Up state of the RADIUS server
after its state is set to Down
Operation Command Description
----End
Context
When packets sent to the RADIUS server form a traffic burst, RADIUS sessions
may preempt bandwidth. To resolve this problem, you can configure whitelist
session-CAR for RADIUS sessions to isolate bandwidth resources by session. If the
default parameters of whitelist session-CAR for RADIUS do not meet service
requirements, you can adjust them as required.
Procedure
Step 1 Run system-view
Step 2 Run whitelist session-car radius { cir cir-value | pir pir-value | cbs cbs-value | pbs
pbs-value } *
Whitelist session-CAR for RADIUS sessions can be disabled only when this function
is abnormal. Under normal circumstances, enabling whitelist session-CAR for
RADIUS sessions is recommended.
----End
Prerequisites
The server template has been configured.
Context
After configuring a RADIUS server, you can view the server configurations, the
supported RADIUS attributes, and statistics about RADIUS packets.
Procedure
● Run the display radius-server configuration [ group groupname ] command
to check the configuration of the RADIUS server group.
Usage Scenario
Command-line authorization is used to implement the management and
authorization for the command-line rights of users.
NOTE
The priority of level authorization is higher than that of task authorization, that is, if both
the level authorization and task authorization are configured on a local user, the level
authorization takes effect.
Pre-configuration Tasks
Before configuring command-line authorization, configure link layer protocol
parameters and IP addresses for interfaces to ensure that link layer protocols on
each interface are Up.
Context
Configuring level authorization involves the following configurations:
● Configuring the level authorization mode
Level authorization is classified into local authorization and remote
HWTACACS authorization.
● Adjusting the level of the command line
The user can customize the level of the command line.
Procedure
● Configure the level authorization mode.
a. Run system-view
The system view is displayed.
b. Run aaa
The AAA view is displayed.
For how to adjust the command line level, see Configuring Command Levels.
----End
Context
Configuring task authorization involves the following configurations:
Procedure
Step 1 Run system-view
The task group is created, and the task group view is displayed.
The priorities of rules are displayed in descending order of rules configured in the
user group view (including the rules inherited from other user groups using the
include user-group command), rules configured in the task group view (rule
command), and tasks configured in the task group (task).
If the rules configured in a user group conflict with the rules inherited from other
user groups using the include user-group command, the rules configured in the
user group take effect preferentially.
NOTE
The new password is at least eight characters long and contains at least two of the following
types: upper-case letters, lower-case letters, digits, and special characters, except the question
mark (?) and space.
----End
Prerequisites
Related configurations of command-line authorization are complete.
Procedure
● Run display task-group [ task-group-name ]
----End
Procedure
Step 1 Run system-view
The recording scheme is created, and the recording scheme view is displayed.
An outbound recording scheme in which the remote login operations of the device
that functions as the client are recorded.
----End
Context
To prevent security issues such as account theft caused by simple usernames and
passwords and excessive login failures, you can improve password complexity and
limit the number of login failures. This helps enhance system security.
If the login password does not satisfy the security hardening policy, the system
prompts you to change your password. Change your password based on the
prompted message.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run user-security-policy enable
A security policy is configured for local user accounts.
Step 3 Run aaa
The AAA view is displayed.
Step 4 Perform the following configurations in the AAA view to improve user security as
required.
Step 7 Perform the following configurations in the local AAA view to improve user
security as required.
Table 1-13 Configurations to improve user security in the local AAA view
----End
Result
You can run the display current-configuration configuration configuration-type
command to view the configuration.
Context
Simple passwords can be easily compromised. To avoid security problems caused
by simple passwords, you can specify character strings that are not allowed in
passwords.
Procedure
Step 1 Run system-view
The forbidden word command takes effect only with local users' passwords. After
the forbidden word command is executed, a newly configured or modified
password cannot contain any forbidden password string. Otherwise, the
configuration fails. If an existing password contains a forbidden password string,
the system will prompt the user to change the password. The user, however, can
continue to use the password.
----End
1.1.2.7.3 Configuring the Locking Function for Administrators Who Fail Remote
Authentication
To ensure account and password security of administrators, enable the account
locking function for administrators who fail remote authentication.
Context
After the account locking function is enabled for administrators who fail remote
authentication, the account will be locked if the number of consecutive incorrect
account or password attempts reaches the upper limit within the retry interval.
The account will be automatically unlocked after the locking period expires.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run aaa
The AAA view is displayed.
Step 3 Run administrator remote authen-fail retry-interval retry-interval retry-time
retry-time block-time block-time
The account locking function is enabled for administrators who fail remote
authentication.
Step 4 Run commit
The configuration is committed.
Step 5 Run remote-user authen-fail unblock { all | username username }
The remote authentication accounts that fail authentication are unlocked.
----End
Result
Run the display remote-user authen-fail [ blocked | username username ]
command to check the accounts that fail remote AAA authentication.
Context
In routine maintenance, you can run the following commands in any view to view
the AAA operating status.
Procedure
● Run display aaa offline-record
User logout is recorded only after the record user logout function is enabled.
If this function is disabled, you can run the aaa offline-record command to
enable this function again.
● Run display aaa online-fail-record
User login failures are recorded only after the record user login failure
function is enabled.
If this function is disabled, you can run the aaa online-fail-record command
to enable this function again.
● Run display access-user
The information about the users that pass AAA authentication is displayed.
● Run display hwtacacs current-status
----End
Context
NOTICE
Statistics cannot be restored after being cleared. Therefore, confirm the action
before you run the following commands.
Procedure
● Run the reset radius statistics packet command in the system view to clear
statistics about the RADIUS server.
● After confirming that the statistics on the user login failures need to be
cleared, run the following command in the user view.
----End
Procedure
● To log out users, run the following commands in the AAA view.
– Run the cut access-user ip-address ip-address [ end-ip-address ] [ vpn-
instance instance-name ] command to log out online users based on IP
addresses.
– Run the cut access-user ipv6-address ipv6-address [ vpn-instance
instance-name ] command to log out an online user based on an IPv6
address.
– Run the cut access-user username user-name { all | hwtacacs | local |
none | radius | radius-proxy } command to log out an online user based
on a username.
– Run the cut access-user domain domain-name command to log out
online users based on a domain name.
– Run the cut access-user user-id start-num [ end-num ] command to log
out an online user based on a user ID.
NOTE
● If the connection is torn down based on the domain name, all online users in
the domain are logged out.
● When connections are torn down according to usernames or user IDs, if there
are multiple connections satisfying the condition, they are torn down at the
same time.
----End
Networking Requirements
As shown in Figure 1-3, two administrators (adminA and adminB)
simultaneously manage the Device. To normalize the operations, adminA and
adminB are required to manage the route module and MPLS module, respectively.
In addition, they have no permission to operate each other's module.
Precautions
During the configuration, note the following:
● adminA and adminB must belong to different user groups.
● The user groups to which adminA and adminB belong cannot overlap on
routes or MPLS permissions.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure task groups and add task instances of the corresponding modules.
2. Configure user groups and add corresponding task groups.
3. Configure users and specify user groups for them.
Data Preparation
To complete the configuration, you need the following data:
● Task group names
● User group names
● Domain name
● Local authentication for users
Procedure
Step 1 Configure task groups.
# Configure a task group for the routing module.
<Device> system-view
[~Device] aaa
[~Device-aaa] task-group route
[*Device-aaa-task-group-route] task ospf read write
[*Device-aaa-task-group-route] task isis read write
[*Device-aaa-task-group-route] task bgp read write
[*Device-aaa-task-group-route] commit
[~Device-aaa-task-group-route] quit
Task authorization
-----------------------------------------------------------
TaskName Authorization
-----------------------------------------------------------
ospf read write
bgp read write
----End
Configuration Files
#
diffserv domain default
#
admin
#
user-interface con 0
#
aaa
#
authentication-scheme default
#
authorization-scheme default
#
accounting-scheme default
#
task-group route
task ospf read write
task bgp read write
task isis read write
#
task-group mpls
task mpls-base read write
task mpls-ldp read write
task mpls-te read write
#
user-group groupa
task-group route
#
user-group groupb
task-group mpls
#
domain default
local-user admina password cipher %^%#pPgn;|W90$J72.Ak$Y,IQ:gqIfPBTLjqW%,N`M_~%^%#
local-user admina user-group groupa
local-user adminb password cipher %^%#pPgn4@^7&QB*OY_,UMTLjqW%D0PV(YTLjqW%O1!!%^%#
local-user adminb user-group groupb
#
task defaultTask1
#
task defaultTask2
return
Networking Requirements
As shown in Figure 1-4, the administrator admin@aaa logs in to the router
through Telnet, and local authentication and authorization are used. This user can
run all AAA commands and view ACL commands, but cannot configure ACL
commands.
Precautions
None
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a task group and add the task instance of the corresponding
module.
2. Configure a user group, bind the user group to the corresponding task group,
and bind the user group to a domain.
3. Configure a user and specify a user group for the user.
4. Configure authentication and authorization modes.
Data Preparation
To complete the configuration, you need the following data:
● Task group name
● User group name
● Domain name
● Local authentication is performed for users on the device.
Procedure
Step 1 Configure a task group.
# Create a task group.
<HUAWEI> system-view
[~HUAWEI] aaa
[~HUAWEI-aaa] task-group admin
# Add the AAA read and write task and ACL read-only task to the task group.
[*HUAWEI-aaa-task-group-admin] task aaa execute write read
[*HUAWEI-aaa-task-group-admin] task acl read
[*HUAWEI-aaa-task-group-admin] task config read write execute debug
[*HUAWEI-aaa-task-group-admin] commit
[~HUAWEI-aaa-task-group-admin] quit
Step 2 Create a user group, bind the user group to a domain, and bind the task group to
the user group.
# Create a user group.
----End
Configuration Files
#
aaa
local-user admin@aaa password cipher %^%#pPgn;|W90$J72.Ak$Y,IQ:gqIfPBTLjqW%,N`M_~%^%#
local-user admin@aaa user-group admin
#
authentication-scheme default
#
authentication-scheme localtype
#
authorization-scheme default
#
authorization-scheme localtype
#
accounting-scheme default
#
domain default
#
domain aaa
authentication-scheme localtype
authorization-scheme localtype
#
task-group admin
task acl read
task aaa read write execute
task config read write execute debug
#
user-group admin
task-group admin
#
interface GigabitEthernet3/0/0
undo shutdown
ip address 10.137.217.251 255.255.254.0
#
ip route-static 0.0.0.0 0.0.0.0 10.137.216.1
#
user-interface vty 0 4
authentication-mode aaa
return
Networking Requirements
As shown in Figure 1-5:
● Access users are first authenticated locally. If local authentication fails, the
HWTACACS server is used to authenticate the users.
● HWTACACS authentication is required before the level of access users is
upgraded. If HWTACACS authentication fails, local authentication is used.
● HWTACACS authorization is performed for access users.
● All access users need to be charged.
● The HWTACACS server at 192.168.66.66/32 functions as the primary server,
with authentication port 49, authorization port 49, and accounting port 49.
The HWTACACS server at 192.168.66.67/32 functions as the secondary server,
with authentication port 49, authorization port 49, and accounting port 49 by
default.
Precautions
None
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure an HWTACACS server template.
2. Configure authentication, authorization, and accounting schemes.
3. Apply the HWTACACS server template, authentication scheme, authorization
scheme, and accounting scheme to a domain.
Data Preparation
To complete the configuration, you need the following data:
● IP addresses of the primary and secondary HWTACACS authentication servers
● IP addresses of the primary and secondary HWTACACS authorization servers
● IP addresses of the primary and secondary HWTACACS accounting servers
● Local or HWTACACS authentication is performed for users on DeviceB.
Procedure
Step 1 Enable HWTACACS and configure an HWTACACS server template.
# Enable HWTACACS and configure an HWTACACS server template named ht.
<HUAWEI> system-view
[~HUAWEI] hwtacacs enable
[*HUAWEI] hwtacacs-server template ht
# Configure an accounting scheme named scheme3 and set the accounting mode
to HWTACACS.
[~HUAWEI–aaa] accounting-scheme scheme3
[*HUAWEI–aaa-accounting-scheme3] accounting-mode hwtacacs
[*HUAWEI–aaa-accounting-scheme3] commit
[~HUAWEI–aaa-accounting-scheme3] quit
Step 3 Configure a domain named huawei, and apply authentication scheme l-h,
authorization scheme scheme2, accounting scheme scheme3, and HWTACACS
server template ht to the domain.
[~HUAWEI-aaa] domain huawei
[*HUAWEI-aaa-domain-huawei] authentication-scheme l-h
[*HUAWEI-aaa-domain-huawei] authorization-scheme scheme2
[*HUAWEI-aaa-domain-huawei] accounting-scheme scheme3
[*HUAWEI-aaa-domain-huawei] hwtacacs-server ht
[*HUAWEI-aaa-domain-huawei] commit
[~HUAWEI-aaa-domain-huawei] quit
[~HUAWEI-aaa] quit
Run the display domain command on the router. The command output shows
that the domain configurations meet the requirements.
<HUAWEI>display domain huawei
---------------------------------------------------------------
Domain-name : huawei
Domain-state : Active
Authentication-scheme-name : l-h
Authorization-scheme-name : scheme2
Accounting-scheme-name : scheme3
User-access-limit : No
Online-number :0
HWTACACS-server-template : ht
RADIUS-server-template :-
---------------------------------------------------------------
----End
Configuration Files
#
Sysname HUAWEI
#
hwtacacs enable
#
hwtacacs-server template ht
hwtacacs-server authentication 192.168.66.66
hwtacacs-server authentication 192.168.66.67 secondary
hwtacacs-server authorization 192.168.66.66
hwtacacs-server authorization 192.168.66.67 secondary
hwtacacs-server accounting 192.168.66.66
hwtacacs-server accounting 192.168.66.67 secondary
hwtacacs-server shared-key cipher %#%#pbft&Zu2$Z<,,g4=vX~7958dF@U%YGfREMUAQA{:%#%#
#
aaa
#
authentication-scheme default
#
authentication-scheme l-h
Networking Requirements
As shown in Figure 1-6, Administrator is an administrator of the HUAWEI. To
prevent unauthorized administrators from accessing the device, perform
HWTACACS authentication and authorization for administrators.
Precautions
When the type of a user is set to terminal, Telnet, FTP, SNMP, or SSH using the
local-user service-type command, the user becomes an administrator.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Enable HWTACACS and configure an HWTACACS server template.
Step 3 Configure a domain named huawei. Apply the HWTACACS authentication scheme
scheme1, HWTACACS authorization scheme scheme2, and HWTACACS server
template ht to the domain. When a user requests to go online, the username
must carry domain name huawei so that HWTACACS authentication and
authorization can be performed for the user.
[~HUAWEI-aaa] domain huawei
[*HUAWEI-aaa-domain-huawei] authentication-scheme scheme1
[*HUAWEI-aaa-domain-huawei] authorization-scheme scheme2
[*HUAWEI-aaa-domain-huawei] hwtacacs-server ht
[*HUAWEI-aaa-domain-huawei] commit
[~HUAWEI-aaa-domain-huawei] quit
[~HUAWEI-aaa] quit
Run the display domain command on the router. The command output shows
that the domain configurations meet the requirements.
<HUAWEI>display domain
---------------------------------------------------------------
Domain-name : huawei
Domain-state : Active
Authentication-scheme-name : scheme1
Authorization-scheme-name : scheme2
Accounting-scheme-name :-
User-access-limit : No
Online-number :0
HWTACACS-server-template : ht
RADIUS-server-template :-
---------------------------------------------------------------
When users in the domain huawei attempt to access the device, HWTACACS
authentication scheme scheme1 and authorization scheme scheme2 are used to
authenticate and authorize the users.
----End
Configuration Files
# DeviceA configuration file
#
sysname DeviceA
#
hwtacacs enable
#
hwtacacs-server template ht
hwtacacs-server authentication 172.16.1.1
hwtacacs-server authentication 172.16.1.2 secondary
hwtacacs-server authorization 172.16.1.1
hwtacacs-server authorization 172.16.1.2 secondary
hwtacacs-server shared-key cipher %#%#pbft&Zu2$Z<,,g4=vX~7958dF@U%YGfREMUAQA{:%#%
#
aaa
#
authentication-scheme default
#
authentication-scheme scheme1
authentication-mode hwtacacs
#
authorization-scheme default
#
authorization-scheme scheme2
authorization-mode hwtacacs
#
accounting-scheme default
#
domain default
#
domain huawei
authentication-scheme scheme1
authorization-scheme scheme2
hwtacacs-server ht
#
return
If two hosts need to communicate, the sender must know the network-layer IP
address of the receiver. IP datagrams, however, must be encapsulated with MAC
addresses before they can be transmitted over the physical network. Therefore,
ARP is needed to map IP addresses to MAC addresses to ensure the transmission
of datagrams.
1.1.3.3 Configuring a Rate Limit for ARP Packets to Be Sent to the CPU
Before configuring a rate limit for Address Resolution Protocol (ARP) packets to be
sent to the CPU, familiarize yourself with the applicable environment, complete
the pre-configuration tasks for the configuration.
Applicable Environment
You can configure a rate limit for ARP packets to be sent to the CPU in the
following situations:
● The router has many sub-interfaces configured, and therefore may encounter
ARP request packet bursts.
● The router has received a large number of ARP request packets, and valid ARP
packets are affected.
Pre-configuration Tasks
Before configuring a rate limit for ARP packets to be sent to the CPU, complete
the following task:
Context
Configure ARP bidirectional isolation on interfaces of the router.
Procedure
Step 1 Run system-view
NOTE
ARP bidirectional isolation is mutually exclusive to of L2VPN and proxy ARP. Before
configuring ARP bidirectional isolation, delete L2VPN and proxy ARP configurations, if
present.
----End
Context
Configure ARP VLAN CAR on interfaces of the router
Procedure
Step 1 Run system-view
The rate limit of ARP VLAN CAR for ARP packets on an interface is configured.
NOTE
If you configure a rate limit (1024 pps, for example) which is larger than the default rate
limit of CP-CAR, the configured ARP VLAN CAR cannot take effect. CP-CAR can be
configured by running the car arp cir cir-value command. For details, see 1.1.11.8
Configuring the CAR. The configuration of CP-CAR can be checked by running the display
cpu-defend car information command.
Step 8 (Optional) Set the percentage of the bandwidth of level-2 CAR for ARP VLAN CAR
in the bandwidth of CP-CAR for the ARP packets.
1. (Optional) Run slot slot-id
The percentage of the bandwidth of level-2 CAR for ARP VLAN CAR in the
bandwidth of CP-CAR for ARP protocol packets is configured.
3. (Optional) Run quit
----End
Procedure
● Run the display arp-safeguard statistics slot slot-id command to check ARP
bidirectional isolation statistics on an interface board.
● Run the display arp rate-limit interface interface-type interface-number
command to check the ARP packet rate limit on an interface.
● Run the display arp attack interface { interface-type interface-num |
interface-name } [ vlan-id vlan-number | pe-vid pe-vid ce-vid ce-vid ]
[ history ] command to check ARP attack information on an interface.
● Run the display arp attack slot { slot-id | all } [ history ] command to check
ARP attack information on an interface board.
----End
Usage Scenario
Attackers send fake ARP packets to modify ARP entries on gateways or valid hosts.
As a result, valid ARP packets cannot be transmitted. To protect against ARP
spoofing attacks, configure the following anti-ARP spoofing functions.
Pre-configuration Tasks
Before configuring anti-ARP spoofing, complete the following tasks:
● Configure the physical parameters for the interface and ensure that the
physical layer status of the interface is Up.
● Configure the link layer parameters for the interface and ensure that the link
layer protocol status of the interface is Up.
Procedure
Step 1 Run system-view
----End
Context
Perform the following on the router to filter out ARP packets on its interfaces:
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number [sub-interface-number]
The interface view is displayed.
Step 3 Run arp filter { gratuitous | mac-illegal | tha-filled-request }
The interface is configured to filter out invalid ARP packets.
NOTE
You can decide which types of ARP packets are to be filtered out according to actual
situations. The NE9000 can filter out the following ARP packets:
● Invalid ARP packets
● Gratuitous ARP packets
● ARP packets whose destination MAC addresses are not null
----End
Context
Perform the following steps on the router whose ARP entries are to be prevented
from being attacked.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run arp check-destination-ip enable
The check of the destination IP address of ARP packets is enabled.
The arp check-destination-ip enable command is used to protect the CPU. After
the command is run, the system checks whether the destination IP addresses of
the packets on the interface are correct. If the IP addresses are correct, packets are
sent to the CPU; otherwise, packets are discarded.
Step 4 Run commit
The configuration is committed.
----End
Prerequisites
All ARP anti-spoofing functions are configured.
Procedure
● Run the display arp packet statistics command to display statistics about
Address Resolution Protocol (ARP) packets.
● Run the display arp-check { check-destination-ip | check-valid } statistics
slot slot-id command to display statistics about discarded invalid ARP packets
on a specific interface board.
----End
Usage Scenario
Attackers forge and send to a device excessive ARP request messages and
gratuitous ARP messages with IP addresses that cannot be mapped to MAC
addresses. As a result, the device's ARP buffer overflows, and the device is
incapable of caching valid ARP entries. In this case, valid ARP messages cannot be
transmitted.
The ARP anti-flooding function can effectively reduce the CPU load and prevent
ARP entry overflow, ensuring the normal running of network devices.
Pre-configuration Tasks
Before configuring anti-ARP flooding, complete the following tasks:
● Configure the physical parameters for the interface and ensure that the
physical layer status of the interface is Up.
● Configure the link layer parameters for the interface and ensure that the link
layer protocol status of the interface is Up.
Background Information
NOTICE
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run arp learning disable
Dynamic ARP entry learning is disabled on the interface.
Step 4 Run commit
The configuration is committed.
----End
response to the ARP request packets sent by itself. Therefore, this function
prevents attacks caused by sending ARP request packets and ARP reply packets
that are not in response to the request packets that the device itself sends.
Background Information
This function can be configured in the system view or interface view.
● If strict ARP learning is not configured, the device processes ARP entries as
follows:
– After receiving an ARP reply packet in response to the ARP request packet
that the device itself sends, the device check whether the source IP
address in the packet matches an ARP entry.
▪ If a matching entry exists, the device updates the entry based on the
source IP and MAC addresses carried in the packet.
– After receiving an ARP request packet, the device sends an ARP reply
packet and then creates an ARP entry.
● If strict ARP learning is configured, the device processes ARP packets as
follows:
– After receiving an ARP reply packet, the device checks whether the packet
is in response to an ARP request packets sent by itself. If so, the device
creates an ARP entry or updates the existing ARP entry based on the
packet. If not, the device does not create an ARP entry or update the
existing ARP entry.
– After receiving an ARP request packet, the device sends an ARP reply
packet but does not create an ARP entry or update the existing ARP entry.
Procedure
● Enable strict ARP learning globally.
a. Run system-view
The system view is displayed.
b. Run arp learning strict
Strict ARP learning is enabled globally.
c. Run commit
The configuration is committed.
● Enable strict ARP learning for an interface.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run arp learning strict force-enable
Strict ARP learning is enabled for the interface.
d. Run commit
After strict ARP learning is enabled globally, strict ARP learning is enabled on all
interfaces. When strict ARP learning is enabled globally:
● You can run the arp learning strict force-disable command in the interface view
to disable strict ARP learning for the specified interface.
● You can run the arp learning strict trust command to configure the specified
interface to use the global strict ARP learning configuration.
----End
Background Information
If a device receives excessive ARP packets in a short period, the device's buffer will
overflow, interrupting services of authorized users. This problem can be solved by
configuring an ARP entry limit on the device. After ARP entry limit is configured,
the device limits the number of ARP entries that each interface can learn,
preventing ARP entry overflow and improving ARP entry security.
Procedure
● Configure ARP entry limit for a physical interface.
a. Run system-view
a. Run system-view
The system view is displayed.
b. Run interface vlanif interface-number
The VLANIF interface view is displayed.
c. Run arp-limit maximum limitnum
ARP entry limit is configured for a VLANIF interface.
d. Run commit
The configuration is committed.
● Configure ARP entry limit for a sub-interface.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number [.subnumber ]
The sub-interface view is displayed.
c. Run arp-limit vlan vlan-id1 [ to vlan-id2 ] maximum limitnum
ARP entry limit is configured for the physical interface.
d. Run commit
The configuration is committed.
----End
Context
The device has no sufficient CPU resource to process other services when
processing a large number of ARP packets. To protect CPU resources of the device,
limit the rate of ARP packets.
After a rate limit is configured for ARP packets, if the number of ARP packets
received in one second exceeds the limit, the device discards the excess ARP
packets.
Procedure
● Configure ARP packet rate limit based on user addresses.
a. Run system-view
The system view is displayed.
b. Run arp speed-limit { destination-ip | source-ip } maximum maximum
[ slot slot-id ]
ARP packet rate limit based on user addresses is configured.
c. Run commit
----End
Background Information
After the ARP Miss message rate limit is configured, the device counts the number
of received ARP Miss messages. If the number of ARP Miss messages received in a
specified period exceeds a specified limit, the device does not process additional
ARP Miss messages.
Procedure
● Configure ARP Miss message rate limit based on source IP addresses.
a. Run system-view
NOTE
If the aging time of dynamic ARP fake entries is set using the arp-fake expire-
time command, the penalty interval configuration does not take effect.
d. Run commit
----End
1.1.3.5.6 (Optional) Enabling the Device to Record Logs and Generate Alarms
About Potential Attacks
To locate and resolve potential attacks, you can enable the device to record logs
and generate alarms about potential attacks.
Background Information
After Address Resolution Protocol (ARP) Miss message rate limit is configured, the
device counts the number of received ARP Miss messages. If the number of ARP
Miss messages received in a specified period exceeds a specified limit, the device
discards additional ARP Miss messages. The device considers this problem as a
potential attack. The device records logs and generates alarms about potential
attacks.
Procedure
Step 1 Run system-view
The device is enabled to record logs and generate alarms about potential attacks.
----End
Context
If a device has a large number of interfaces and all interfaces are Up and are
allocated IP addresses, the device may keep sending gratuitous ARP packets,
consuming excessive CPU resources. As a result, services are affected. To prevent
CPU overload, you can disable an interface from sending gratuitous ARP packets.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run arp gratuitous-arp send disable
The interface is disabled from sending gratuitous ARP packets.
NOTICE
Using the arp gratuitous-arp send disable command will prevent sending
gratuitous arp packet, and may cause IP collision detection failure and services to
be interrupted. Exercise caution when running this command.
----End
Context
When a device is connected to a network for the first time, the device broadcasts
gratuitous ARP packets to announce its existence and checks whether its IP
address conflicts with any other device IP address in the broadcast domain. Any
device can send gratuitous ARP packets and receive gratuitous ARP packets
without authentication. As a result, a large number of gratuitous ARP packets can
be generated, causing devices to be busy processing these packets. This process
overloads the CPU and affects the processing of other services. To resolve this
problem, you can enable gratuitous ARP packet discarding. After gratuitous ARP
packet discarding is enabled, the device discards all received gratuitous ARP
packets to prevent excessive CPU consumption.
Gratuitous ARP packet discarding can be enabled in the system view or in the
interface view.
● If the arp anti-attack gratuitous-arp drop command is enabled in the
system view, the device discards gratuitous ARP packets received from all
interfaces.
● If the arp anti-attack gratuitous-arp drop command is enabled in the
interface view, the device discards gratuitous ARP packets received from a
specified interface.
Gratuitous ARP request discarding enabled in the system view is independent
upon that enabled in the interface view.
Procedure
● Configure gratuitous ARP packet discarding globally.
a. Run system-view
----End
Prerequisites
All ARP anti-flooding functions have been configured.
Procedure
● Run the display arp learning strict command to check the configuration of
strict ARP learning.
● Run the display arp-limit [ interface interface-type interface-number ]
[ vlan vlan-id ] command to check the configuration of ARP entry limit.
● Run the display arp speed-limit { destination-ip | source-ip } [ slot slot-id ]
command to check the configuration of ARP packet rate limit.
● Run the display arp-miss speed-limit source-ip [ slot slot-id ] command to
check the configuration of ARP Miss message rate limit.
● Run the display arp-safeguard statistics slot slot-id command to check ARP
bidirectional isolation statistics on an interface board.
● Run the display arp rate-limit interface interface-type interface-number
command to check the ARP packet rate limit on an interface.
● Run the display arp attack interface interface-type interface-number
command to check ARP attack information on an interface.
● Run the display arp attack slot { slot-id | all } command to check ARP attack
information on an interface board.
● Run the display arp anti-attack record command to display information
about discarded ARP packets whose rate exceeds the limit.
● Run the display arp miss anti-attack record command to display
information about discarded ARP Miss messages whose rate exceeds the limit.
----End
Background Information
NOTICE
ARP security statistics cannot be restored after they are cleared. Exercise caution
before clearing the statistics.
Procedure
● Run the reset arp packet statistics [ slot slot-id ] command in the user view
to reset ARP statistics of a specified or all boards.
● Run the reset arp packet statistics interface [ interface-type interface-
number ] command in the user view to reset ARP statistics of a specified or
all Layer 3 interfaces.
----End
Context
For routine maintenance, you can run the following commands in any view to
check the operating status of ARP security.
Procedure
● Run the display arp packet statistics [ slot slot-id | interface [ interface-type
interface-number ] ] command in any view to check statistics on ARP packets.
----End
Context
NOTICE
Procedure
● Run the reset arp-safeguard statistics slot slot-id command in the user view
to clear ARP bidirectional isolation statistics on an interface board.
----End
Networking Requirements
ARP is a basic link layer protocol that can be used on the Ethernet. It maps
devices' IP addresses to MAC addresses. ARP is simple to use but does not have
any security guarantee. Attackers may send forged ARP packets to attack
networks, causing normal services to be interrupted and devices to break down.
Therefore, carriers want to enhance backbone network security.
As shown in Figure 1-7, an Internet bar is connected to the Internet through the
Device. ARP security needs to be configured on the Device to protect the Internet
bar against ARP attacks.
Precautions
None.
Configuration Roadmap
The configuration roadmap is as follows:
● Limit the ARP packet processing rate on interface boards. This effectively
prevents devices from continuously processing a large number of invalid ARP
packets (with destination IP addresses unable to be resolved) sent by
attackers. Burdens on the devices' CPUs are relieved and valid packets can be
properly processed on the devices.
Data Preparation
To complete the configuration, you need the following data:
● Interface board slot number: 1; number of ARP packets that the interface
board processes every second: 50
● Maximum number of ARP entries that an interface can learn: 20
Procedure
Step 1 Configure the interface board in slot 1 to process 50 ARP packets to a specific
destination every second.
<HUAWEI> system-view
[~HUAWEI] sysname Device
[*HUAWEI] commit
[~Device] arp speed-limit destination-ip maximum 50 slot 1
[*Device] commit
Step 2 Configure GE 1/0/0 to learn a maximum of 20 ARP entries and enable strict ARP
entry learning on GE 1/0/0.
[~Device] interface gigabitethernet 1/0/0
[~Device-GigabitEthernet1/0/0] arp-limit maximum 20
[*Device-GigabitEthernet1/0/0] arp learning strict force-enable
[*Device-GigabitEthernet1/0/0] commit
[~Device-GigabitEthernet1/0/0] quit
Run the display arp speed-limit command on the Device to view the configured
ARP packet processing rate.
<Device> display arp speed-limit destination-ip slot 1
Slot SuppressType SuppressValue
---------------------------------------------------
1 ARP 50
----End
Configuration Files
#
sysname Device
arp speed-limit destination-ip maximum 50 slot 1
#
interface GigabitEthernet1/0/0
undo shutdown
arp learning strict force-enable
arp-limit maximum 20
#
return
1.1.3.7.2 Example for Configuring ARP Bidirectional Isolation and ARP VLAN CAR
This section provides an example for configuring ARP bidirectional isolation and
ARP VLAN CAR. A configuration networking diagram is provided to help you
understand the configuration procedure. The example provides the networking
requirements, configuration roadmap, configuration procedure, and configuration
files.
Networking Requirements
ARP is an open protocol and sets up IP-address-to-MAC-address mappings. When
being used on an Ethernet network, ARP offers possibilities for malicious attackers
because of its simplicity, openness, and lack of security measures. Attackers forge
and send excessive ARP request and response packets to the router. The ARP
buffer of the router has a limited storage capability, so that it will be incapable of
caching legitimate ARP packets after being overflowed. ARP security enables the
router to process ARP request and reply packets separately, so that the router can
rapidly respond to ARP request packets. In addition, ARP security allows you to set
a rate limit for ARP packets, so that excessive ARP packets will be discarded when
the preset rate limit is reached.
As shown in Figure 1-8, only the user-side interface is connected to the Layer 2
devices. Therefore, configure ARP bidirectional isolation and ARP VLAN CAR on the
user-side interface GE 1/0/0.
● The configurations in this example are performed on Device. NE9000 can function as
Device.
● Interface 1 in this example represents GE 1/0/0.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Configure VLANs on the router. The configuration details are not provided here.
----End
Configuration Files
#
sysname Device
#
vlan 100
vlan 200
#
interface GigabitEthernet1/0/0
undo shutdown
portswitch
port trunk allow-pass vlan 100 200
arp safe-guard enable
arp rate-limit 50
#
return
Applicable Environment
A bogus DHCP server on the network may send a DHCP offer packet to the DHCP
client. The DHCP offer packet contains incorrect information such as the incorrect
gateway address, incorrect Domain Name Server (DNS) server, and incorrect IP
address. As a result, the DHCP client cannot connect to the network or may
connect to an incorrect network.
To prevent a bogus DHCP server attack, configure DHCP snooping on the device,
configure the network-side interface to be trusted and the user-side interface to
be untrusted, and configure the device to discard DHCP reply packets received
from untrusted interfaces.
Enable bogus DHCP server detection on the device. The device obtains relevant
information about the DHCP server and logs the information, which helps you
maintain the network.
Pre-configuration Tasks
Before you configure defense against bogus DHCP server attacks, configure the
DHCP server.
Context
Enable DHCP snooping in the following sequence:
1. Enable DHCP globally.
2. Enable DHCP snooping globally.
3. Enable DHCP snooping in an interface, BD, or VLAN view.
Procedure
● Enable DHCP snooping globally for a VLAN to prevent Layer 2 devices from
bogus DHCP server attacks.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
DHCP is enabled globally.
f. Run quit
Return to the system view.
g. Run commit
The configuration is committed.
● Enable DHCP snooping in the BD view.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
DHCP is enabled globally.
c. Run dhcp snooping enable
DHCP snooping is enabled globally.
d. Run bridge-domain bd-id
The BD view is displayed.
e. Run dhcp snooping enable
DHCP snooping is enabled.
f. Run commit
The configuration is committed.
● Enable DHCP snooping globally for an interface to prevent Layer 3 devices
from bogus DHCP server attacks.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
DHCP is enabled globally.
----End
Context
After DHCP snooping is enabled on a device, you can configure interfaces of the
device as trusted or untrusted.
● After receiving DHCP reply packets from a trusted interface, the device
forwards the packets so that DHCP clients can obtain correct IP addresses.
● After receiving DHCP reply packets from an untrusted interface, the device
discards the packets to prevent DHCP clients from obtaining incorrect IP
addresses.
NOTE
After DHCP snooping is enabled, trusted interfaces must be configured and server-side
interfaces and user-side interfaces must be in the same virtual local area network (VLAN).
DHCP clients cannot go online if server-side interfaces and user-side interfaces are in
different VLANs.
Procedure
● Configure an interface as a trusted interface in a VLAN to prevent Layer 2
devices from bogus DHCP server attacks.
a. Run system-view
NOTE
Before you configure an interface as a trusted interface in the VLAN view, make
sure that the interface is in the VLAN.
d. Run commit
The configuration is committed.
● Configure interfaces as trusted interfaces in the BD view.
a. Run system-view
The system view is displayed.
b. Run bridge-domain bd-id
The BD view is displayed.
c. Run dhcp snooping trusted
Interfaces are configured as trusted interfaces.
d. Run commit
The configuration is committed.
● Configure an interface as a trusted interface in the interface view to prevent
Layer 3 devices from bogus DHCP server attacks.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run dhcp snooping trusted
The interface is configured as a trusted interface.
d. Run commit
The configuration is committed.
● Configure interfaces as trusted interfaces in the BD view.
a. Run system-view
The system view is displayed.
b. Run bridge-domain bd-id
The BD view is displayed.
c. Run dhcp snooping trusted
Interfaces are configured as trusted interfaces.
d. Run commit
The configuration is committed.
----End
Context
Before enabling bogus DHCP server detection, ensure that DHCP snooping is
enabled globally for the interface. Otherwise, the detection function does not take
effect.
Procedure
Step 1 Run system-view
----End
Context
After trusted and untrusted interfaces are configured, the device discards all DHCP
reply packets received from untrusted interfaces. You can set a threshold for the
number of discarded packets. When the number of discarded packets reaches the
threshold, an alarm is generated.
For a Layer 2 device, configure the alarm function for discarded DHCP reply
packets in a VLAN view. For a Layer 3 device, configure the alarm function for
discarded DHCP reply packets in an interface view or in a BD view.
Procedure
● Configure the alarm function for discarded DHCP reply packets in a VLAN
view.
a. Run system-view
The alarm function for discarded DHCP reply packets is enabled for the
interface.
d. Run dhcp snooping alarm dhcp-reply threshold threshold-value
----End
Prerequisites
The configurations of defense against bogus DHCP server attacks are complete.
Procedure
● Run the display dhcp snooping { interface interface-type interface-number |
vlan vlan-id [ interface interface-type interface-number ] | bridge-domain
bd-id } command to check the DHCP snooping configuration.
----End
Applicable Environment
In man-in-the-middle attacks and IP/MAC address spoofing, attackers pretend to
be servers and clients. The servers consider that all packets are sent from and
destined for the clients, and so do the clients. Actually these packets are second-
hand information from man-in-the-middle, and in this manner attackers can
obtain the data on the servers and clients.
To prevent man-in-the-middle attacks and IP/MAC address spoofing, enable the
Dynamic Host Configuration Protocol (DHCP) snooping function on a device so
that the device forwards a packet only if the packet info matches an entry in the
DHCP snooping binding table. If a packet does not match any entry in the DHCP
snooping binding table, the device discards the packet.
Pre-configuration Tasks
Before you configure defense against man-in-the-middle attacks and IP/MAC
address spoofing, configure DHCP snooping.
Context
Enable DHCP snooping in the following sequence:
1. Enable DHCP globally.
2. Enable DHCP snooping globally.
3. Enable DHCP snooping in an interface, BD, or VLAN view.
Procedure
● Enable DHCP snooping for a VLAN.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
DHCP is enabled globally.
c. Run dhcp snooping enable
DHCP snooping is enabled globally.
d. Run vlan vlan-id
The VLAN view is displayed.
e. Run dhcp snooping enable
DHCP snooping is enabled for the VLAN.
f. Run quit
The system view is displayed.
g. Run commit
The configuration is committed.
● Enable DHCP snooping in the BD view.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
DHCP is enabled globally.
c. Run dhcp snooping enable
DHCP snooping is enabled globally.
d. Run bridge-domain bd-id
The BD view is displayed.
e. Run dhcp snooping enable
DHCP snooping is enabled in a BD.
f. Run commit
The configuration is committed.
● Enable DHCP snooping for an interface.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
DHCP is enabled globally.
----End
Context
For DHCP users, the DHCP snooping binding table is automatically generated
when DHCP snooping is enabled. For users using static IP addresses, the DHCP
snooping binding table needs to be manually configured.
Procedure
● Enable DHCP request packet check in a VLAN view.
a. Run system-view
----End
Context
NOTE
The static IP address and the IP address allocated to a user in static mode are the IP
addresses that are manually configured on the client. Static users are those who use static
IP addresses.
If the IP addresses allocated to users are static IP addresses, static binding entries
can be configured for these IP addresses, ensuring static IP address anti-
embezzlement. If there are a large number of static users, static binding entries
must be configured for each static IP address; otherwise, unauthorized users who
attempt to embezzle static IP addresses cannot be isolated.
Dynamic entries in the DHCP snooping binding table do not need to be
configured. They are automatically generated when DHCP snooping is enabled.
However, static entries in the DHCP snooping binding table must be configured by
running commands.
NOTE
● For the IP addresses dynamically allocated to users, devices automatically learn the MAC
addresses of users and create a binding relationship table. The table does not need to
be configured manually.
● For the IP addresses statically allocated to users, devices cannot create a binding
relationship table. The table must be created manually.
If the binding relationship table for static users is not created manually, the
following situations occur:
NOTE
● If the device is configured to forward packets that do not match any entry in the
binding relationship table, the packets of all static users are forwarded. All static users
can access the DHCP server normally. This is the default condition of the devices.
● If the device is configured for discard packets that do not match any entry in the
binding relationship table, the packets of all static users are discarded. All static users
cannot access the DHCP server.
If the created binding table must contain interface information, the Option82
function must be enabled. If the Option82 function is not enabled and DHCP
snooping is enabled on the VLANIF interface, entries in the created DHCP
snooping binding table do not contain interface information. For details, see the
description of how to "configure the Option82 function".
When an interface receives an Address Resolution Protocol (ARP) or IP packet, the
interface matches the source IP address and source MAC address of the ARP or IP
packet with entries in the DHCP snooping binding table. The interface checks the
MAC address, IP address, interface, and virtual local area network (VLAN)
information. Based on this check, the interface performs the following actions:
● The ARP or IP packet is discarded if its source IP address and source MAC
address do not match any entry in the DHCP snooping binding table.
● The ARP or IP packet is forwarded if its source IP address and source MAC
address match an entry in the DHCP snooping binding table.
When an interface receives an ARP or IP packet, the interface matches the source
IP address and source MAC address of the ARP or IP packet with entries in the
DHCP snooping binding table. The ARP or IP packet is forwarded if its source IP
address and source MAC address match an entry in the DHCP snooping binding
table, or is discarded if its source IP address and source MAC address do not match
any entry in the DHCP snooping binding table.
Procedure
● Configure DHCP snooping static entries for a VLAN.
a. Run system-view
The system view is displayed.
b. Run vlan vlan-id
The VLAN view is displayed.
c. Run dhcp snooping bind-table static ip-address ip-address [ mac-
address mac-address ] [ interface interface-type interface-number [ ce-
vlan ce-vlan-id ] ]
The static DHCP snooping entry is configured for the VLAN.
d. Run commit
The configuration is committed.
● Configure static DHCP snooping binding entries.
a. Run system-view
The system view is displayed.
b. Run bridge-domain bd-id
The BD view is displayed.
c. Run dhcp snooping bind-table static ip-address ip-address [ mac-
address mac-address ] [ vlan vlan-id [ ce-vlan ce-vlan-id ] ]
The static DHCP snooping entry is configured.
d. Run commit
The configuration is committed.
● Configure static DHCP snooping binding entries.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run dhcp snooping bind-table static ip-address ip-address [ mac-
address mac-address ] [ vlan vlan-id [ ce-vlan ce-vlan-id ] ]
The static DHCP snooping entry is configured.
d. Run commit
The configuration is committed.
● Configure backup for the DHCP snooping binding table.
a. Run system-view
The system view is displayed.
Context
The Option 82 field contains the location information of Dynamic Host
Configuration Protocol (DHCP) hosts, such as information about the login
interface, virtual local area network (VLAN), and address. After DHCP snooping is
configured, the device can create binding entries with accurate interface
information based on the Option 82 field. In addition, the DHCP server that
supports the Option 82 field can allocate different IP policies to different clients
based on the Option 82 information. This provides more flexible address allocation
modes.
Procedure
● Configure Option 82 field insertion in the VLAN view.
a. Run system-view
The system view is displayed.
b. Run vlan vlan-id
The VLAN view is displayed.
c. Run dhcp option82 insert enable [ interface interface-type interface-
number ] or dhcp option82 rebuild enable [ interface interface-type
interface-number ]
Follow-up Procedure
After Option 82 field insertion is enabled, you can configure the format of the
Option 82 field as required.
Context
After packet check is enabled, if a received Address Resolution Protocol (ARP) or IP
packet of a man-in-the-middle attack or IP/MAC address spoofing does not match
any entry in the Dynamic Host Configuration Protocol (DHCP) snooping binding
table, the device discards the ARP or IP packet. With the function described in this
section configured, when the number of discarded packets reaches a specified
threshold, an alarm is generated.
Configure the alarm function for discarded man-in-the-middle attack and IP/MAC
address spoofing packets in a VLAN, BD, or interface view.
Procedure
● Configure the alarm function for discarded man-in-the-middle attack and
IP/MAC address spoofing packets in a VLAN view.
a. Run system-view
The system view is displayed.
b. Run vlan vlan-id
The VLAN view is displayed.
c. Run dhcp snooping alarm { arp | ip } enable [ interface interface-type
interface-number ]
The alarm function for discarded man-in-the-middle attack and IP/MAC
address spoofing packets is enabled for the VLAN.
d. Run dhcp snooping alarm { arp | ip } threshold threshold [ interface
interface-type interface-number ]
The alarm threshold for the number of discarded packets is configured
for the VLAN.
e. Run commit
The configuration is committed.
● Configure the alarm function for discarded man-in-the-middle attack and
IP/MAC address spoofing packets in a BD view.
a. Run system-view
The system view is displayed.
b. Run bridge-domain bd-id
The BD view is displayed.
c. Run dhcp snooping alarm { arp | ip } enable
The alarm function is enabled for discarded man-in-the-middle attack
and IP/MAC address spoofing packets in the BD view.
d. Run commit
The configuration is committed.
● Configure the alarm function for discarded man-in-the-middle attack and
IP/MAC address spoofing packets in an interface view.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run dhcp snooping alarm { arp | ip } enable
The alarm function for discarded man-in-the-middle attack and IP/MAC
address spoofing packets is enabled for the interface.
d. Run dhcp snooping alarm { arp | ip } threshold threshold-value
The alarm threshold for the number of discarded packets is configured
for the interface.
e. Run commit
----End
Prerequisites
The configuration of defense against man-in-the-middle attacks and IP/MAC
address spoofing is complete.
Procedure
● Run the display dhcp snooping global command to check the global DHCP
snooping information.
● Run the display dhcp snooping bind-table { all | dynamic | interface
interface-type interface-number | ip-address ip-address | mac-address mac-
address | static | vlan vlan-id [interface interface-type interface-number ] |
vsi vsi-name | bridge-domain bd-id } command to check the information
about the Dynamic Host Configuration Protocol (DHCP) snooping binding
table.
● Run the display dhcp snooping { interface interface-type interface-number |
vlan vlan-id [ interface interface-type interface-number ] | bridge-domain
bd-id } command to check the DHCP snooping configuration.
● Run the display dhcp option82 configuration [ interface interface-type
interface-number | vlan vlan-id | bridge-domain bd-id ] command to check
the Option 82 configuration.
----End
Applicable Environment
Attackers may change the CHADDR field carried in DHCP packets to apply for IP
addresses continuously. The device, however, only checks validity of packets based
on the source media access control (MAC) address in the frame header. Attack
packets can still be forwarded and the MAC address limit cannot take effect.
To prevent the attacker from changing the CHADDR field, configure DHCP
snooping to check the CHADDR field carried in DHCP request packets. If the
CHADDR field matches the source MAC address in the frame header, the packet is
forwarded. Otherwise, the packet is discarded.
Pre-configuration Tasks
Before you configure defense against DoS attacks by changing the CHADDR field,
configure DHCP Snooping.
Context
Enable DHCP snooping in the following sequence:
1. Enable DHCP globally.
2. Enable DHCP snooping globally.
3. Enable DHCP snooping in an interface, BD, or VLAN view.
Procedure
● Enable DHCP snooping for a VLAN.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
DHCP is enabled globally.
c. Run dhcp snooping enable
DHCP snooping is enabled globally.
d. Run vlan vlan-id
The VLAN view is displayed.
e. Run dhcp snooping enable
DHCP snooping is enabled for the VLAN.
f. Run quit
The system view is displayed.
g. Run commit
The configuration is committed.
● Enable DHCP snooping in the BD view.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
DHCP is enabled globally.
c. Run dhcp snooping enable
DHCP snooping is enabled globally.
d. Run bridge-domain bd-id
----End
Context
The CHADDR field check function allows the device to check whether the media
access control (MAC) address in the CHADDR field of a received Dynamic Host
Configuration Protocol (DHCP) request packet matches that in the header of the
packet. If they match, the device considers the packet valid and forwards it. If they
do not match, the device considers the packet an attack packet and discards it.
Configure CHADDR field check in a VLAN, BD, or interface view.
Procedure
● Configure CHADDR field check for a virtual local area network (VLAN).
a. Run system-view
The system view is displayed.
b. Run vlan vlan-id
The VLAN view is displayed.
c. Run dhcp check chaddr enable [ interface interface-type interface-
number ]
CHADDR field check is enabled for the VLAN.
d. Run commit
The configuration is committed.
● Enable CHADDR field check in a BD.
a. Run system-view
The system view is displayed.
b. Run bridge-domain bd-id
The BD view is displayed.
c. Run dhcp check chaddr enable
CHADDR field check is enabled.
d. Run commit
The configuration is committed.
● Configure CHADDR field check for an interface.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run dhcp check chaddr enable
CHADDR field check is enabled for the interface.
d. Run commit
----End
Context
After CHADDR field check is enabled, the device checks whether the media access
control (MAC) address in the CHADDR field of a received DHCP packet matches
that in the frame header of the packet. If they match, the device considers the
packet valid and forwards it. If they do not match, the device considers the packet
an attack packet and discards it. The device generates an alarm when the number
of discarded DHCP packets with incorrect CHADDR fields reaches the
predetermined threshold.
Configure the alarm function for discarded DHCP packets with incorrect CHADDR
fields in a VLAN, BD, or interface view.
Procedure
● Configure the alarm function for discarded DHCP packets with incorrect
CHADDR fields in a VLAN view.
a. Run system-view
The alarm threshold for discarded DHCP packets with incorrect CHADDR
fields is configured.
e. Run commit
The alarm threshold for discarded DHCP packets with incorrect CHADDR
fields is configured for the interface.
e. Run commit
----End
Prerequisites
The configuration of defense against denial of service (DoS) attacks by changing
the CHADDR field is complete.
Procedure
● Run the display dhcp snooping { interface interface-type interface-number |
vlan vlan-id [ interface interface-type interface-number ] | bridge-domain
bd-id } command to check the Dynamic Host Configuration Protocol (DHCP)
snooping configuration.
----End
Applicable Environment
Attackers disguise as authorized clients to send DHCP request packets for
extending the IP address lease. As a result, DHCP servers cannot reclaim IP
addresses assigned to clients.
This problem can be resolved by enabling DHCP snooping. After DHCP snooping is
enabled, when receiving a DHCP request packet, the device checks whether the IP
address and VLAN ID carried in the packet match an entry in the DHCP snooping
binding table. If no matching entry exists, the device considers the DHCP request
packet as a new request packet and forwards it. If a matching entry exists, the
device considers the DHCP request packet as a lease renewal packet and checks
whether the MAC address carried in the packet matches any entry in the binding
table. If a matching entry exists, the device forwards the packet. If no matching
entry exists, the device discards the packet.
Pre-configuration Tasks
Before you configure defense against attacks by sending bogus DHCP packets to
extend IP address leases, configure the DHCP server.
Context
Enable DHCP snooping in the following sequence:
1. Enable DHCP globally.
2. Enable DHCP snooping globally.
3. Enable DHCP snooping in an interface, BD, or VLAN view.
Procedure
● Enable DHCP snooping for a VLAN.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
DHCP is enabled globally.
c. Run dhcp snooping enable
DHCP snooping is enabled globally.
d. Run vlan vlan-id
The VLAN view is displayed.
e. Run dhcp snooping enable
DHCP snooping is enabled for the VLAN.
f. Run quit
The system view is displayed.
g. Run commit
The configuration is committed.
● Enable DHCP snooping in the BD view.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
DHCP is enabled globally.
c. Run dhcp snooping enable
DHCP snooping is enabled globally.
d. Run bridge-domain bd-id
The BD view is displayed.
e. Run dhcp snooping enable
DHCP snooping is enabled in a BD.
f. Run commit
The configuration is committed.
● Enable DHCP snooping for an interface.
a. Run system-view
The system view is displayed.
b. Run dhcp enable
DHCP is enabled globally.
----End
Context
In dynamic address assignment mode, the device generates a DHCP snooping
binding table to record DHCP client information. In static address assignment
mode, configure a DHCP static binding table to record DHCP client information.
Procedure
● Enable DHCP request packet check for a VLAN.
a. Run system-view
----End
Context
The Option 82 field contains the location information of Dynamic Host
Configuration Protocol (DHCP) hosts, such as information about the login
interface, virtual local area network (VLAN), and address. After DHCP snooping is
configured, the device can create binding entries with accurate interface
information based on the Option 82 field. In addition, the DHCP server that
supports the Option 82 field can allocate different IP policies to different clients
based on the Option 82 information. This provides more flexible address allocation
modes.
Procedure
● Configure Option 82 field insertion in the VLAN view.
a. Run system-view
The system view is displayed.
b. Run vlan vlan-id
The VLAN view is displayed.
c. Run dhcp option82 insert enable [ interface interface-type interface-
number ] or dhcp option82 rebuild enable [ interface interface-type
interface-number ]
Option 82 field insertion is enabled.
Follow-up Procedure
After Option 82 field insertion is enabled, you can configure the format of the
Option 82 field as required.
● Configure the format of the Option 82 field in the VLAN view.
a. Run system-view
The system view is displayed.
b. Run vlan vlan-id
The VLAN view is displayed.
c. Run dhcp option82 format { user-defined text | type1 | type2 | self-
define self-define | cn-telecom | cn-telecom-inherit } interface
interface-type interface-number
The format of the Option 82 field is configured for the VLAN.
d. Run commit
The configuration is committed.
● Configure the format of the Option 82 field on an interface.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run dhcp option82 format { self-define extendtext | type1 | type2 | cn-
telecom | cn-telecom-inherit } or dhcp option82 { circuit-id | remote-
id } format self-define extendtext or dhcp option82 [ circuit-id |
remote-id ] format user-defined text
The format of the Option 82 field is configured.
d. Run commit
The configuration is committed.
1.1.4.6.4 (Optional) Configuring the Alarm Function forDiscarded DHCP Packets for
Extending the IP Address Lease
By configuring the function described in this chapter, you can have an alarm
generated when a specified number of Dynamic Host Configuration Protocol
(DHCP) packets for extending the IP address lease are discarded.
Context
After DHCP request packet check is enabled, the device checks whether the source
IP address, source MAC address, virtual local area network (VLAN) ID, and
interface information carried in a received DHCP request packet match an entry in
the DHCP snooping binding table. If no matching entry exists, the device considers
the packet an attack packet and discards it. The device generates an alarm when
the number of discarded DHCP packets for extending the IP address lease exceeds
the threshold.
Configure the alarm function for discarded DHCP packets for extending the IP
address lease in a VLAN, BD, or interface view.
Procedure
● Configure the alarm function for discarded DHCP packets for extending the IP
address lease in a VLAN view.
a. Run system-view
The system view is displayed.
b. Run vlan vlan-id
The VLAN view is displayed.
c. Run dhcp snooping alarm dhcp-request enable [ interface interface-
type interface-number ]
DHCP request packet check is enabled for the VLAN.
By default, DHCP request packet check is disabled for a VLAN.
d. Run dhcp snooping alarm dhcp-request threshold threshold [ interface
interface-type interface-number ]
The alarm threshold for the number of discarded DHCP packets for
extending the IP address lease is configured for the VLAN.
e. Run commit
The configuration is committed.
● Configure the alarm function for discarded DHCP packets for extending the IP
address lease in a BD view.
a. Run system-view
The system view is displayed.
b. Run bridge-domain bd-id
The BD view is displayed.
c. Run dhcp snooping alarm dhcp-request enable
Check for DHCP packets for extending the IP address lease is enabled.
Prerequisites
The configurations of defense against the attacker from sending bogus DHCP
packets for extending the IP address leases are complete.
Procedure
● Run the display dhcp snooping { interface interface-type interface-number |
vlan vlan-id [ interface interface-type interface-number ] | bridge-domain
bd-id } command to check the DHCP snooping configuration.
● Run the display dhcp option82 configuration [ interface interface-type
interface-number | vlan vlan-id | bridge-domain bd-id ] command to check
the configuration of the option 82 field insertion function.
----End
Usage Scenario
After the number of login clients reaches the maximum number, no client can
obtain IP address. To prevent malicious IP address application, configure the
maximum number of DHCP clients.
In the VXLAN scenario, the maximum number for the entire system must be
greater than or equal to the sum of maximum number for all BDs.
When the number of login users on a DHCP snooping device reaches the
maximum number, check whether the IP address of DHCP ACK packets exists in
the binding entries and determine whether the login users are new ones. In this
case, you can configure the MAC address strict check function. DHCP snooping can
determine whether the users are new ones by checking the MAC addresses of the
DHCP Discover packets sent by them. If the MAC address of a user does not exist
in DHCP snooping binding entries, the user is not allowed to go online, and
packets are not sent to the DHCP server. In this manner, the DHCP server is not
affected by unauthorized users.
Pre-configuration Tasks
Before you set the maximum number of DHCP clients, configure DHCP snooping
and trusted interfaces.
Procedure
● Configure the maximum number of DHCP clients for a VLAN.
a. Run system-view
The system view is displayed.
b. (Optional) Run dhcp snooping strict-check mac-address
DHCP snooping is enabled to strictly check the MAC addresses of login
users.
c. Run vlan vlan-id
The VLAN view is displayed.
d. Run dhcp snooping max-user-number max-user-number [ interface
interface-type interface-number ]
The maximum number of DHCP clients is configured for the VLAN.
e. (Optional) Run dhcp snooping alarm user-limit enable [ interface
interface-type interface-number ]
The alarm function for discarded DHCP packets because the maximum
number of DHCP clients is reached is enabled for the VLAN.
f. (Optional) Run dhcp snooping alarm user-limit threshold threshold
[ interface interface-type interface-number ]
The maximum number of DHCP clients is configured for the VLAN.
g. Run commit
The configuration is committed.
● Configure the maximum number of DHCP clients for an interface.
a. Run system-view
The system view is displayed.
b. (Optional) Run dhcp snooping strict-check mac-address
DHCP snooping is enabled to strictly check the MAC addresses of login
users.
c. Run interface interface-type interface-number
The interface view is displayed.
d. Run dhcp snooping max-user-number max-user-number
The maximum number of DHCP clients is configured for the interface.
e. (Optional) Run dhcp snooping alarm user-limit enable
The alarm function for discarded DHCP packets because the maximum
number of DHCP clients is reached is enabled for the interface.
f. (Optional) Run dhcp snooping alarm user-limit threshold threshold-
value
The maximum number of DHCP clients is configured for the interface.
g. Run commit
The configuration is committed.
● Configure the maximum number of DHCP clients for a BD.
a. Run system-view
The system view is displayed.
b. Run bridge-domain bd-id
The BD view is displayed.
c. Run dhcp snooping max-user-number max-user-number
The maximum number of DHCP clients is configured for the BD.
d. Run commit
The configuration is committed.
----End
Result
Run the display dhcp snooping { interface interface-type interface-number | vlan
vlan-id [ interface interface-type interface-number ] | bridge-domain bd-id }
command to check the maximum number of DHCP clients.
Usage Scenario
When DHCP snooping unicast packets are forwarded using CPU, the EXP values of
MPLS packets sent to the tunnel side are mapped to the DSCP values (equal to
the EXP values) of IP packets. After CPU forwarding is disabled for DHCP snooping
unicast packets, DHCP snooping unicast packets are forwarded using hardware.
The EXP values of MPLS packets sent to the tunnel side are mapped to the DSCP
values (6 by default) of IP packets based on the DSCP-EXP mappings specified
using the host-packet dscp map command.
Procedure
Step 1 Enable DHCP snooping.
1. Run system-view
The system view is displayed.
2. Run dhcp enable
DHCP is enabled globally.
3. Run dhcp snooping enable
DHCP snooping is enabled.
----End
Usage Scenario
Generally, only the trusted and untrusted functions of DHCP snooping can be used
to control DHCP packets to be sent to the CPU. On the trusted interface, DHCP
request and response packets are sent to the CPU. On the untrusted interface, only
request packets are sent to the CPU, and response packets are dropped. To
accurately control packets to be sent to the CPU on a trusted client or server,
configure the whitelist function for DHCP snooping so that DHCP packets are
filtered based on the whitelist rules. After a whitelist is configured for DHCP
snooping, only DHCP packets matching the whitelist rules are sent to the CPU,
and the DHCP packets that do not match the whitelist rules are simply forwarded.
This protects the device against attacks.
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Enable DHCP snooping.
1. Run system-view
The system view is displayed.
2. Run dhcp snooping enable
DHCP snooping is enabled globally.
Step 2 Create a whitelist.
Run dhcp snooping packet whitelist whitelist-name
A whitelist is configured to filter DHCP packets.
Step 3 Configure whitelist rules.
1. Run dhcp packet-rule ruleid { source-ip source-ip-address { source-ip-mask |
source-ip-mask-length } | destination-ip destination-ip-address { destination-
ip-mask | destination-ip-mask-length } } * [ source-port { bootpc | bootps } ]
[ destination-port { bootpc | bootps } ]
Whitelist rules are configured.
2. Run commit
The configuration is committed.
3. Run quit
Return to the system view.
Step 4 Apply the whitelist.
1. Run dhcp snooping apply packet whitelist whitelist-name
The whitelist is applied to filter DHCP packets.
2. Run commit
The configuration is committed.
----End
Applicable Environment
After DHCP snooping binding table maintenance is enabled, the device can
perform the following operations:
● When a client goes offline, the DHCP snooping binding entry for the client
needs to be updated. The update can be implemented by enabling client
online status or deleting the DHCP snooping binding table manually.
● If a client obtains an IP address and goes online from an interface, the device
creates a DHCP binding entry for the client. After DHCP snooping binding
table transfer is enabled, the DHCP binding entry can be applied on other
interfaces so that the client can go online from another interface.
● You can configure DHCP binding table backup to prevent the DHCP binding
table from being lost after the system is restarted.
Pre-configuration Tasks
Before you configure DHCP snooping binding table maintenance, enable DHCP
snooping and configure trusted interfaces.
Usage Scenario
● If a client obtains an IP address and goes offline abnormally, the client cannot
release the IP address by sending a DHCP release packet. To resolve this
problem, you can configure client online status detection. After client online
status detection is enabled, the system uses Address Resolution Protocol
(ARP) to detect a client periodically. If the system cannot detect the client for
specified times, the system will delete the DHCP snooping binding entry for
the client. The system also sends a release packet to the DHCP server to
release the client's IP address.
NOTE
This function dynamically maintains the DHCP snooping binding table. You can
delete DHCP snooping binding entries based on virtual local area networks
(VLANs), interfaces, BD, or IP addresses.
Procedure
● Configure client online status detection.
a. Run system-view
Using the release parameter, you can configure the client to send a
release packet to the DHCP server to release the client's IP address.
● Configure static DHCP snooping binding entry deletion.
a. Run system-view
----End
Usage Scenario
After the alarm functions are enabled, the system collects statistics on the number
of discarded DHCP packets. You can run the display dhcp snooping command to
view the statistics. To ensure accuracy, you can clear the existing statistics.
NOTICE
Statistics on discarded DHCP packets cannot be restored after you clear them.
Therefore, exercise cautions before you clear the statistics.
Procedure
● Run the reset dhcp snooping statistics { vlan vlan-id [ interface interface-
type interface-number] | interface interface-type interface-number | bridge-
domain bd-id } command in the system view to clear statistics on the number
of discarded DHCP packets.
----End
Usage Scenario
After the DHCP snooping whitelist function is configured, the system collects
statistics about packets matching DHCP snooping whitelists. You can run the
display dhcp snooping white-list [ rule-id rule-id ] [ slot slot-id ] statistics
command to check statistics about packets matching a DHCP snooping whitelist
rule. Before running the display command to check statistics about packets
matching a DHCP snooping whitelist rule, clear existing statistics.
NOTICE
The statistics about packets matching a DHCP snooping whitelist rule cannot be
restored after you clear them. Therefore, excise cautions before you clear the
statistics.
Procedure
Run the reset dhcp snooping white-list [ rule-id rule-id ] [ slot slot-id ]
statistics command in the system view to clear statistics about packets matching
a DHCP snooping whitelist rule.
Networking Requirements
As shown in Figure 1-9, a DHCP client is connected to DeviceA through VLAN 10.
Configure DHCP snooping on the Layer 2 interfaces, GE1/0/0 and GE1/0/1, of
DeviceA. Configure the interfaces connecting to DHCP clients as untrusted
interfaces and the interface connecting to the DHCP relay as a trusted interface.
Configure DHCP snooping on DeviceA to prevent the following attacks:
● Bogus DHCP server attacks
● Man-in-the-middle attacks and IP/MAC address spoofing
● Denial of service (DoS) attacks by changing the CHADDR field value
● Attacks by sending bogus DHCP request packets for extending IP address
lease
DHCP client 1 uses a dynamic IP address, and DHCP client 2 uses a static IP
address.
NOTE
Figure 1-9 Networking diagram for configuring DHCP snooping for a Layer 2
device
Configuration Roadmap
The configuration roadmap is as follows:
1. Enable DHCP snooping in the system view and a virtual local area network
(VLAN) view.
2. Configure trusted and untrusted interfaces to prevent bogus DHCP server
attacks.
3. Configure the DHCP snooping binding table so that the device can check ARP,
IP, and DHCP request packets to prevent man-in-the-middle attacks, IP/MAC
address spoofing, and attacks by sending bogus DHCP request packets for
extending IP address lease.
4. Enable CHADDR field check to prevent attacks that change CHADDR field
values in packets.
5. Configure Option 82 to create a binding table containing accurate interface
information.
6. Configure the device to report alarms to the Network Management System
(NMS).
7. (Optional) Configure the whitelist function for DHCP snooping.
Data Preparation
To complete the configuration, you need the following data:
● ID of the VLAN to which the interface belongs
● Static IP address to which packets can be forwarded
● Threshold of reporting alarms to the NMS
Procedure
Step 1 Enable DHCP snooping.
# Enable DHCP snooping globally.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] dhcp snooping enable
NOTE
Step 3 Enable packet check and configure the DHCP snooping binding table.
# Configure the device to check Address Resolution Protocol (ARP) and IP packets
on the interface on the DHCP client side. This prevents man-in-the-middle attacks
and IP/MAC address spoofing.
[~DeviceA] vlan 10
[*DeviceA-vlan10] dhcp snooping check arp enable interface gigabitethernet 1/0/0
[*DeviceA-vlan10] dhcp snooping check arp enable interface gigabitethernet 1/0/1
[*DeviceA-vlan10] dhcp snooping check ip enable interface gigabitethernet 1/0/0
[*DeviceA-vlan10] dhcp snooping check ip enable interface gigabitethernet 1/0/1
[*DeviceA-vlan10] commit
[~DeviceA-vlan10] quit
# Configure the device to check DHCP request packets on the interface on the
DHCP client side. This prevents attacks in which the attacker sends bogus DHCP
request packets for extending IP address lease.
[~DeviceA] vlan 10
[*DeviceA-vlan10] dhcp snooping check dhcp-request enable interface gigabitethernet 1/0/0
[*DeviceA-vlan10] dhcp snooping check dhcp-request enable interface gigabitethernet 1/0/1
[*DeviceA-vlan10] commit
[~DeviceA-vlan10] quit
# Configure the device to check packets containing the CHADDR field on the
interface on the DHCP client side. This prevents DoS attacks in which the attacker
changes the CHADDR field value.
[~DeviceA] vlan 10
[*DeviceA-vlan10] dhcp check chaddr enable interface gigabitethernet 1/0/0
[*DeviceA-vlan10] dhcp check chaddr enable interface gigabitethernet 1/0/1
[*DeviceA-vlan10] commit
[~DeviceA-vlan10] quit
For users using static IP addresses, static DHCP snooping binding table entries
must be manually configured.
[~DeviceA] vlan 10
[*DeviceA-vlan10] dhcp snooping bind-table static ip-address 10.1.3.1 mac-address 00e0-fc5e-008a
interface gigabitethernet 1/0/1
[*DeviceA-vlan10] commit
[~DeviceA-vlan10] quit
# Enable Option 82 field insertion to set up dynamic binding table entries with
accurate interface information.
[~DeviceA] vlan 10
[*DeviceA-vlan10] dhcp option82 insert enable interface gigabitethernet 1/0/0
[*DeviceA-vlan10] dhcp option82 insert enable interface gigabitethernet 1/0/1
[*DeviceA-vlan10] commit
[~DeviceA-vlan10] quit
NOTE
To configure a Layer 2 device to strip the Option 82 field before sending DHCP Relay
packets to the client, perform either of the following operations:
● Enable Option 82 field insertion on the interfaces connecting to the client and server.
● Enable DHCP snooping for the VLAN to which the interface connecting to the client
belongs, and configure this interface as a trusted interface.
----End
Configuration Files
#
sysname DeviceA
#
vlan batch 10
#
dhcp snooping enable
#
dhcp snooping packet whitelist whitelist1
dhcp packet-rule 1 source-ip 1.1.1.1 255.255.255.0 destination-ip 2.2.2.2 255.255.255.0 source-port bootps
destination-port bootpc
#
dhcp snooping apply packet whitelist whitelist1
#
vlan 10
dhcp snooping alarm dhcp-reply threshold 1000
dhcp check chaddr enable
dhcp snooping alarm dhcp-chaddr enable
dhcp snooping alarm dhcp-chaddr threshold 100
dhcp snooping check dhcp-request enable
dhcp snooping alarm dhcp-request enable
dhcp snooping alarm dhcp-request threshold 100
dhcp snooping enable interface GigabitEthernet1/0/0
dhcp snooping check arp enable interface GigabitEthernet1/0/00
dhcp snooping alarm arp enable interface GigabitEthernet1/0/0
dhcp snooping alarm arp threshold 10 interface GigabitEthernet1/0/0
dhcp snooping check ip enable interface GigabitEthernet1/0/0
dhcp snooping alarm ip enable interface GigabitEthernet1/0/0
dhcp snooping alarm ip threshold 10 interface GigabitEthernet1/0/0
dhcp snooping alarm dhcp-reply enable interface GigabitEthernet1/0/0
dhcp snooping alarm dhcp-reply threshold 10 interface GigabitEthernet1/0/0
dhcp check chaddr enable interface GigabitEthernet1/0/0
dhcp snooping alarm dhcp-chaddr enable interface GigabitEthernet1/0/0
dhcp snooping alarm dhcp-chaddr threshold 10 interface GigabitEthernet1/0/0
dhcp snooping check dhcp-request enable interface GigabitEthernet1/0/0
dhcp snooping alarm dhcp-request enable interface GigabitEthernet1/0/0
dhcp snooping alarm dhcp-request threshold 10 interface GigabitEthernet1/0/0
dhcp snooping enable interface GigabitEthernet1/0/1
dhcp snooping check arp enable interface GigabitEthernet1/0/1
dhcp snooping alarm arp enable interface GigabitEthernet1/0/1
dhcp snooping alarm arp threshold 10 interface GigabitEthernet1/0/1
dhcp snooping check ip enable interface GigabitEthernet1/0/1
dhcp snooping alarm ip enable interface GigabitEthernet1/0/1
dhcp snooping alarm ip threshold 10 interface GigabitEthernet1/0/1
dhcp snooping alarm dhcp-reply enable interface GigabitEthernet1/0/1
dhcp snooping alarm dhcp-reply threshold 10 interface GigabitEthernet1/0/1
dhcp check chaddr enable interface GigabitEthernet1/0/1
dhcp snooping alarm dhcp-chaddr enable interface GigabitEthernet1/0/1
dhcp snooping alarm dhcp-chaddr threshold 10 interface GigabitEthernet1/0/1
dhcp snooping check dhcp-request enable interface GigabitEthernet1/0/1
dhcp snooping alarm dhcp-request enable interface GigabitEthernet1/0/1
dhcp snooping alarm dhcp-request threshold 10 interface GigabitEthernet1/0/1
dhcp snooping enable interface GigabitEthernet1/0/2
dhcp snooping trusted interface GigabitEthernet1/0/2
dhcp check chaddr enable interface GigabitEthernet1/0/2
dhcp snooping bind-table static ip-address 10.1.3.1 mac-address 00e0-fc5e-008a interface gigabitethernet
1/0/1
dhcp option82 insert enable interface GigabitEthernet1/0/0
dhcp option82 insert enable interface GigabitEthernet1/0/1
dhcp option82 insert enable interface GigabitEthernet1/0/2
port gigabitethernet 1/0/0
port gigabitethernet 1/0/1
port gigabitethernet 1/0/2
#
interface GigabitEthernet1/0/0
undo shutdown
portswitch
port default vlan 10
#
interface GigabitEthernet1/0/1
undo shutdown
portswitch
port default vlan 10
#
interface GigabitEthernet1/0/2
undo shutdown
portswitch
port default vlan 10
#
return
Networking Requirements
As shown in Figure 1-10, DHCP clients are connected to DHCP relay through the
switch. Configure DHCP snooping on the Layer 3 interfaces, GE1/0/0 and GE1/0/1,
of the DHCP relay. Configure the interfaces connecting to DHCP clients as
untrusted interfaces and the interface connecting to the DHCP relay as a trusted
interface.
If a user abnormally logs out after obtaining an IP address, the system
automatically detects this fault, deletes the entry in the DHCP binding table, and
instructs the DHCP server to release the IP address.
Configure DHCP snooping on the DHCP relay to prevent the following attacks:
● Bogus DHCP server attacks
● Man-in-the-middle attacks and IP/MAC address spoofing
● Denial of service (DoS) attacks by changing the CHADDR field value
● Attacks by sending bogus DHCP request packets for extending IP lease
● Attacks by sending the DHCP request packets
DHCP client 1 uses a dynamic IP address, and DHCP client 2 uses a static IP
address.
Figure 1-10 Networking diagram for configuring DHCP snooping for a Layer 3
device
NOTE
Configuration Roadmap
The configuration roadmap is as follows:
1. Enable DHCP snooping in the system view and an interface view.
2. Configure trusted and untrusted interfaces to prevent bogus DHCP server
attacks.
3. Configure the DHCP snooping binding table so that the device can check ARP,
IP, and DHCP request packets to prevent man-in-the-middle attacks, IP/MAC
address spoofing, and attacks by sending bogus DHCP request packets for
extending IP address lease.
4. Enable CHADDR field check to prevent attacks that change CHADDR field
values in packets.
5. Configure Option 82 to create a binding table containing accurate interface
information.
6. Configure the device to report alarms to the Network Management System
(NMS).
7. (Optional) Configure the whitelist function for DHCP snooping.
Data Preparation
To complete the configuration, you need the following data:
● ID of the virtual local area network (VLAN) to which the interface belongs
● Threshold of reporting alarms to the NMS
Procedure
Step 1 Enable DHCP snooping.
# Enable DHCP snooping globally and for the interface.
<HUAWEI> system-view
[~HUAWEI] sysname DHCP-relay
[*HUAWEI] commit
[~DHCP-relay] dhcp snooping enable
[~DHCP-relay] interface gigabitethernet 1/0/0
[~DHCP-relay-GigabitEthernet1/0/0] dhcp snooping enable
[*DHCP-relay-GigabitEthernet1/0/0] quit
[*DHCP-relay] interface gigabitethernet 1/0/1
[*DHCP-relay-GigabitEthernet1/0/1] dhcp snooping enable
[*DHCP-relay-GigabitEthernet1/0/1] commit
[~DHCP-relay-GigabitEthernet1/0/1] quit
Step 3 Enable packet check and configure the DHCP snooping binding table.
# Configure the device to check Address Resolution Protocol (ARP) and IP packets
on the interface on the DHCP client side. This prevents man-in-the-middle attacks
and IP/MAC address spoofing.
[~DHCP-relay] interface gigabitethernet 1/0/0
[~DHCP-relay-GigabitEthernet1/0/0] dhcp snooping check arp enable
[*DHCP-relay-GigabitEthernet1/0/0] dhcp snooping check ip enable
[*DHCP-relay-GigabitEthernet1/0/0] commit
[~DHCP-relay-GigabitEthernet1/0/0] quit
# Configure the device to check DHCP request packets on the interface on the
DHCP client side. This prevents attacks in which the attacker sends bogus DHCP
request packets for extending IP address lease.
[~DHCP-relay] interface gigabitethernet 1/0/0
[~DHCP-relay-GigabitEthernet1/0/0] dhcp snooping check dhcp-request enable
[*DHCP-relay-GigabitEthernet1/0/0] commit
[~DHCP-relay-GigabitEthernet1/0/0] quit
# Configure the device to check packets containing the CHADDR field on the
interface on the DHCP client side. This prevents DoS attacks in which the attacker
changes the CHADDR field value.
[~DHCP-relay] interface gigabitethernet 1/0/0
[~DHCP-relay-GigabitEthernet1/0/0] dhcp check chaddr enable
[*DHCP-relay-GigabitEthernet1/0/0] commit
[~DHCP-relay-GigabitEthernet1/0/0] quit
For users using static IP addresses, static DHCP snooping binding table entries
must be manually configured.
[~DHCP-relay] interface gigabitethernet 1/0/0
[~DHCP-relay-GigabitEthernet1/0/0] dhcp snooping bind-table static ip-address 10.1.3.1 mac-address
00e0-fc5e-008a
[*DHCP-relay-GigabitEthernet1/0/0] commit
[~DHCP-relay-GigabitEthernet1/0/0] quit
----End
Configuration Files
#
sysname DHCP-relay
#
dhcp snooping enable
arp dhcp-snooping-detect enable
#
dhcp snooping packet whitelist whitelist1
dhcp packet-rule 1 source-ip 10.1.2.2 255.255.255.0 destination-ip 10.1.1.2 255.255.255.0 source-port
bootpc destination-port bootps
#
dhcp snooping apply packet whitelist whitelist1
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.2.1 255.255.255.0
dhcp select relay
ip relay address 10.1.1.2
dhcp snooping enable
dhcp snooping check arp enable
dhcp snooping alarm arp enable
dhcp snooping alarm arp threshold 10
dhcp snooping check ip enable
dhcp snooping alarm dhcp-reply enable
dhcp snooping alarm dhcp-reply threshold 10
dhcp check chaddr enable
Usage Scenario
When an IPv6/MAC spoofing attack occurs on a network, the attacker forges a
DHCPv6 client, and the DHCPv6 server incorrectly considers that all the packets
are sent to or received from this client. However, these packets actually have been
tampered with. In this way, the attacker can obtain data from the DHCPv6 server.
Pre-configuration Tasks
Before configuring IPv6/MAC spoofing attack defense on a Layer 3 device,
complete the following task:
Context
Enable DHCPv6 snooping in the following sequence:
Procedure
1. Run the system-view command to enter the system view.
2. Run the dhcpv6 snooping enable command to enable DHCPv6 snooping
globally.
3. Run the interface interface-type interface-number command to enter the
interface view.
4. Run the dhcpv6 snooping enable command to enable DHCPv6 snooping on
the interface.
Context
After DHCPv6 snooping is enabled, binding entries are automatically generated
when DHCPv6 users go online. If DHCPv6 users are statically assigned IPv6
addresses, you need to manually configure static binding entries for the users.
Procedure
1. Run the system-view command to enter the system view.
1. Run the interface interface-type interface-number command to enter the
interface view.
2. Run the dhcpv6 snooping check ipv6 enable command to enable the IPv6
packet check function on the interface.
3. Run the commit command to commit the configuration.
Context
NOTE
Both the static IPv6 addresses and the IPv6 addresses statically assigned to users refer to
the IPv6 addresses manually configured on clients. Static users are those who use static
IPv6 addresses.
If the IPv6 addresses assigned to users are static IPv6 addresses, you can configure
static binding entries for these addresses to prevent unauthorized users from
embezzling the static IPv6 addresses. If there are a large number of static IPv6
users, static binding entries must be configured for each static IPv6 address;
otherwise, unauthorized users who attempt to embezzle static IPv6 addresses
cannot be isolated.
● For the IPv6 address dynamically assigned to a user, the device automatically
learns the user's MAC address and generates a binding entry. In this case, no
binding entry needs to be configured.
● For the IPv6 address statically assigned to a user, the device cannot
automatically generate a binding entry. Therefore, you need to manually
configure a binding entry for the user.
If no binding entries are created for static users, the following situations may
occur:
● All static users can access the DHCPv6 server normally. This is the default
setting for the device.
● No static user can access the DHCPv6 server.
If an interface enabled with the packet check function receives an IPv6 packet, the
interface matches the source IPv6 address and source MAC address of the IPv6
packet against the DHCPv6 snooping binding table to check the MAC address,
IPv6 address, interface information, and VLAN ID. If no entry is matched, the
packet is discarded. If an entry is completely matched, the packet is properly
forwarded.
Procedure
● Configure a static DHCPv6 snooping binding entry on an interface.
a. Run the system-view command to enter the system view.
b. Run the interface interface-type interface-number command to enter the
interface view.
c. Run the dhcpv6 snooping bind-table static { ipv6-address ipv6-address
[ mac-address mac-address ] | ipv6-prefix ipv6-prefix-mask } [ vlan
vlan-id [ ce-vlan ce-vlanid ] ] command to configure a static entry for
the mapping between the IPv6 address, MAC address, and VLAN ID.
d. Run the commit command to commit the configuration.
● Back up the DHCPv6 snooping binding table.
a. Run the system-view command to enter the system view.
Context
The policy for checking IPv6 packets based on the DHCPv6 snooping binding table
can be classified as a discard policy or forward policy.
● Discard policy: If no matching entry is found in the DHCPv6 snooping binding
table based on the source IPv6 address, prefix, VLAN ID, and VPN information
in an IPv6 packet, the IPv6 packet is discarded. If a matching entry is found in
the DHCPv6 snooping binding table based on the source IPv6 address, prefix,
VLAN ID, and VPN information in the IPv6 packet but the source MAC address
and interface information in the IPv6 packet do not match this entry, the IPv6
packet is also discarded.
● Forward policy: If no matching entry is found in the DHCPv6 snooping binding
table based on the source IPv6 address, prefix, VLAN ID, and VPN information
in an IPv6 packet, the packet can be properly forwarded. If a matching entry
is found in the DHCPv6 snooping binding table based on the source IPv6
address, prefix, VLAN ID, and VPN information in the IPv6 packet but the
source MAC address and interface information in the IPv6 packet do not
match this entry, the IPv6 packet is discarded.
Procedure
● Configure a policy for checking invalid IPv6 packets in the system view.
a. Run the system-view command to enter the system view.
b. Run the dhcpv6 snooping nomatch-packet ipv6 action forward
command to configure a forward policy for checking IPv6 packets based
on the DHCPv6 snooping binding table.
c. Run the commit command to commit the configuration.
● Configure a policy for checking invalid IPv6 packets in the interface view.
a. Run the system-view command to enter the system view.
b. Run the interface interface-type interface-number command to enter the
interface view.
c. Run the dhcpv6 snooping nomatch-packet ipv6 action forward
command to configure a forward policy for checking IPv6 packets based
on the DHCPv6 snooping binding table on the interface.
Context
After a DHCPv6 snooping binding table is configured, if the information in an IPv6
packet under an IPv6/MAC spoofing attack is inconsistent with that in the binding
table, the IPv6 packet will be discarded. You can also configure an alarm threshold
for discarding packets. An alarm is generated when the number of discarded
packets exceeds the specified threshold.
Procedure
1. Run the system-view command to enter the system view.
2. Run the interface interface-type interface-number command to enter the
interface view.
3. Run the dhcpv6 snooping check ipv6 enable command to enable the IPv6
packet check function on the interface.
4. Run the dhcpv6 snooping alarm ipv6 enable command to enable the alarm
function for IPv6/MAC spoofing attacks on the interface.
5. (Optional) Run the dhcpv6 snooping alarm ipv6 threshold threshold-value
command to set an alarm threshold for discarding IPv6 packets on the
interface.
NOTE
Alternatively, you can run the dhcpv6 snooping alarm threshold threshold-value
command in the system view to set a global alarm threshold for IPv6 packet
discarding.
If the alarm function for discarding IPv6 packets has been enabled on an interface but
no alarm threshold is configured on the interface, the alarm threshold configured in
the system view is used. If an alarm threshold is configured both globally and on the
interface, the alarm threshold configured on the interface is used.
6. Run the commit command to commit the configuration.
Prerequisites
IPv6/MAC spoofing attack defense has been configured.
Procedure
● Run the display dhcpv6 snooping bind-table { interface { interface-type
interface-num | interface-name } | ipv6-address ipv6-address | ipv6-prefix
ipv6-prefix-mask | mac-address mac-address | vpn-instance vpn-name |
static | dynamic | all } command to check information about the DHCPv6
snooping binding table.
● Run the display dhcpv6 snooping interface { interface-name | interface-type
interface-num } command to check the running information about the
DHCPv6 snooping function.
● Run the display dhcpv6 snooping statistics command to check statistics
about the DHCPv6 packets sent and received after the DHCPv6 snooping
function is enabled.
Context
If a user goes offline unexpectedly after obtaining an IPv6 address, the client
cannot send a DHCPv6 Release message to release this IPv6 address, causing a
waste of IPv6 resources. To avoid this, you can enable association between ND
probe and DHCPv6 snooping.
Procedure
1. Run the system-view command to enter the system view.
2. Run the dhcpv6 snooping nd-detect enable command to enable association
between ND probe and DHCPv6 snooping.
3. Run the commit command to commit the configuration.
Context
After the alarm function is configured for DHCPv6 snooping, the system will
collect statistics about the discarded attack packets. You can run the display
dhcpv6 snooping interface { interface-name | interface-type interface-num }
command to check statistics about the discarded packets. To get accurate
statistics, you can clear the existing statistics about discarded packets.
NOTICE
DHCPv6 snooping statistics cannot be restored after they are cleared. Exercise
caution when running the commands.
Procedure
● Run the reset dhcpv6 snooping bind-table [ { interface { interface-type
interface-num | interface-name } | ipv6-address ipv6-address | ipv6-prefix
ipv6-prefix-mask | mac-address mac-address } ] [ release ] command in the
user view to clear entries in a dynamic DHCPv6 snooping binding table.
● Run the reset dhcpv6 snooping interface { interface-name | interface-type
interface-num } command in the user view to clear statistics about discarded
DHCPv6 snooping packets.
● Run the reset dhcpv6 snooping statistics command in the user view to clear
statistics about the packets sent and received after DHCPv6 snooping is
enabled.
Networking Requirements
As shown in Figure 1-11, DHCPv6 snooping needs to be configured on the Layer 3
interface GE 1/0/0 of the DHCPv6 relay agent to allow DHCPv6 client access.
If a user goes offline unexpectedly after obtaining an IPv6 address, the system can
automatically detect the logout, delete the corresponding DHCPv6 binding entry,
and instruct the DHCPv6 server to release this IPv6 address. In addition, DHCPv6
snooping enabled on the DHCPv6 relay can prevent against IPv6/MAC spoofing
attacks.
DHCPv6 client 1 uses a dynamically assigned IPv6 address, and DHCPv6 client 2
uses a statically assigned IPv6 address.
In this example, interface 1 and interface 2 represent GE 1/0/0 and GE 2/0/0, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
1. Configure IPv6 addresses for interfaces.
# Configure IPv6 addresses for GE 1/0/0 and GE 2/0/0.
<HUAWEI> system-view
[~HUAWEI] sysname DHCPv6-relay
[*HUAWEI] commit
[~DHCPv6-relay] interface gigabitethernet 1/0/0
[~DHCPv6-relay-GigabitEthernet1/0/0] ipv6 enable
[*DHCPv6-relay-GigabitEthernet1/0/0] ipv6 address 2001:db8:2::1/64
[*DHCPv6-relay-GigabitEthernet1/0/0] commit
[~DHCPv6-relay-GigabitEthernet1/0/0] quit
[~DHCPv6-relay] interface gigabitethernet 2/0/0
[~DHCPv6-relay-GigabitEthernet2/0/0] ipv6 enable
[*DHCPv6-relay-GigabitEthernet2/0/0] ipv6 address 2001:db8:3::1/64
[*DHCPv6-relay-GigabitEthernet2/0/0] commit
[~DHCPv6-relay-GigabitEthernet2/0/0] quit
3. Configure the IPv6 packet check function and a DHCPv6 snooping binding
entry.
For users who use static IPv6 addresses, you need to configure static DHCPv6
snooping binding entries for them.
[~DHCPv6-relay] interface gigabitethernet 1/0/0
[~DHCPv6-relay-GigabitEthernet1/0/0] dhcpv6 snooping bind-table static ipv6-address
2001:db8:1::1 mac-address 00e0-fc12-3456
[*DHCPv6-relay-GigabitEthernet1/0/0] commit
Configuration Files
#
sysname DHCPv6-relay
#
dhcpv6 snooping enable
dhcpv6 snooping nd-detect enable
#
interface GigabitEthernet1/0/0
undo shutdown
ipv6 enable
ipv6 address 2001:DB8:2::1/64
dhcpv6 snooping enable
dhcpv6 snooping check ipv6 enable
dhcpv6 relay destination 2001:DB8:3::2
The attack of "valid packets" on the network makes the device overloaded and
consumes the device resources, such as the CPU. For example, an attacker keeps
sending packets to the device by simulating BGP packets. After receiving these
packets, the device finds that it is the destination of these packets. Then, the
forwarding plane directly sends the packets to the control plane for BGP
processing without checking the validity of the packets. The device busies itself
with processing these "valid" packets and the its CPU is thus highly occupied.
Th GTSM protects the services above the IP layer against attacks by checking
whether the TTL value in the IP header is within a pre-defined range. In
applications, the GTSM is mainly used to protect the TCP/IP-based control plane
including the routing protocols against attacks of the CPU-utilization type, such as
CPU overload.
● The GTSM supports only unicast addresses; therefore, the GTSM must be
configured on all the routers configured with routing protocols.
● When being configured in the BGP view, the GTSM is also applicable to MP-
BGP VPNv4 extensions because they use the same TCP connection.
● The GTSM and EBGP-MAX-HOP functions both affect the TTL values of sent
BGP packets and they conflict with each other. Thus, for a peer or a peer
group, you can use only either of them.
● GTSM does not support tunnel-based neighbors. For example, an IP packet
that carries a BGP packet is transmitted through a tunnel. When the IP packet
reaches the peer end of the tunnel, the tunnel protocol parses the IP packet.
The TTL value in the IP packet cannot reflect the number of forwarding hops;
therefore, the GTSM cannot be applied.
A device that is enabled with GTSM checks the TTL values in all protocol packets.
As required by the actual networking, packets whose TTL values are not within the
specified range are discarded. If GTSM is not configured, the received protocol
packets are forwarded if the neighbor configuration is matched. Otherwise, the
received protocol packets are discarded. This prevents bogus protocol packets from
consuming CPU resources.
Usage Scenario
The GTSM prevents attacks through TTL detection. If an attacker simulates real
OSPF unicast packets and keeps sending them to the router, an interface board on
the router receives the packets and directly sends them to the control plane for
OSPF processing, without checking the validity of the packets. The control plane of
the router needs to process the "legal" packets. As a result, the system becomes
abnormally busy and the CPU usage is high.
The GTSM protects the router by checking whether the TTL value in an IP header
is within a pre-defined range to enhance the system security.
Pre-configuration Tasks
Before configuring the OSPF GTSM, complete the following task:
Procedure
Step 1 Configure basic OSPF GTSM functions.
To apply the GTSM, you need to enable GTSM on both ends of the OSPF
connection.
Perform the following steps on the GTSM routers at the two ends of the virtual
link or sham link:
1. Run system-view
NOTE
– The ospf valid-ttl-hops command has two functions: enabling the OSPF GTSM
and configuring the TTL value to be detected. The vpn-instance parameter is valid
only for the latter function.
– The valid TTL range of detected packets is [255 - hops + 1, 255].
3. Run commit
Step 2 Set the default action for packets that do not match the GTSM policy.
GTSM only checks the TTL values of packets that match the GTSM policy. Packets
that do not match the GTSM policy can be allowed or dropped.
You can enable the log function to record packet drop for troubleshooting.
Perform the following configurations on the GTSM-enabled router:
1. Run system-view
The system view is displayed.
2. Run gtsm default-action { drop | pass }
The default action for packets that do not match the GTSM policy is
configured.
NOTE
If the default action is configured but no GTSM policy is configured, GTSM does not
take effect.
This command is supported only on the Admin-VS and cannot be configured in other
VSs. This command takes effect on all VSs.
3. Run commit
The configuration is committed.
----End
Pre-configuration Tasks
Before configuring the OSPFv3 GTSM, complete the following task:
● Configuring basic OSPFv3 functions
Procedure
Step 1 Configure basic OSPFv3 GTSM functions.
To apply the GTSM, you need to enable GTSM on both ends of the OSPFv3
connection.
1. Run system-view
NOTE
– The ospfv3 valid-ttl-hops command has two functions: enabling the OSPFv3
GTSM and configuring the TTL value to be detected. The vpn-instance parameter
is valid only for the latter function.
– The valid TTL range of detected packets is [255 - hops + 1, 255].
3. Run commit
The configuration is committed.
Step 2 Set the default action for packets that do not match the GTSM policy.
GTSM only checks the TTL values of packets that match the GTSM policy. Packets
that do not match the GTSM policy can be allowed or dropped.
You can enable the log function to record packet drop for troubleshooting.
Perform the following configurations on the GTSM-enabled router:
1. Run system-view
The system view is displayed.
2. Run gtsm default-action { drop | pass }
The default action for packets that do not match the GTSM policy is
configured.
NOTE
If the default action is configured but no GTSM policy is configured, GTSM does not
take effect.
This command is supported only on the Admin-VS and cannot be configured in other
VSs. This command takes effect on all VSs.
3. Run commit
The configuration is committed.
----End
Usage Scenario
GTSM prevents attacks through TTL detection. An attacker simulates real BGP
packets and sends the packets in a large quantity to the router. After receiving the
packets, an interface board of the router directly sends the packets to the BGP
module of the control plane if the interface board finds that the packets are sent
by the local router, without checking the validity of the packets. The control plane
of the router needs to process the "legal" packets. As a result, the system becomes
abnormally busy and the CPU usage is high.
GTSM protects the router by checking whether the TTL value in an IP packet
header is within a pre-defined range to enhance the system security.
NOTE
● GTSM supports only unicast addresses; therefore, GTSM must be configured on all the
routers configured with routing protocols.
Pre-configuration Tasks
Before configuring the BGP GTSM, complete the following task:
● Configuring Basic BGP Functions
Perform the following steps on both BGP peers:
Procedure
Step 1 Configure the basic BGP GTSM functions.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run peer { group-name | ipv4-address } valid-ttl-hops [ hops ]
The BGP GTSM is configured.
The valid TTL range of detected packets is [255 - hops + 1, 255]. For example,
for an EBGP direct route, the number of hops is 1, that is, the valid TTL value
is 255
NOTE
– When being configured in the BGP view, GTSM is also applicable to MP-BGP VPNv4
extensions because they use the same TCP connection.
– The GTSM and EBGP-MAX-HOP functions both affect the TTL values of sent BGP
messages and they conflict with each other. Thus, for a peer or a peer group, you
can use only either of them.
A BGP router that is enabled with GTSM checks the TTL values in all BGP
packets. As required by the actual networking, packets whose TTL values are
not within the specified range are discarded. If GTSM is not configured on a
BGP router, the received BGP packets are forwarded if the BGP peer
configuration is matched. Otherwise, the received BGP packets are discarded.
This prevents bogus BGP packets from consuming CPU resources.
4. Run commit
The configuration is committed.
Step 2 Set the default action for packets that do not match the GTSM policy.
GTSM only checks the TTL values of packets that match the GTSM policy. Packets
that do not match the GTSM policy can be allowed or dropped. If "drop" is set as
the default GTSM action for packets, you need to configure TTL values for all the
packets sent from valid peers in the GTSM policy. If TTL values are not configured
for the packets sent from a peer, the device will discard the packets sent from the
peer and cannot establish a connection to the peer. Therefore, GTSM enhances
security but reduces the ease of use.
You can enable the log function to record packet drop for troubleshooting.
Perform the following configurations on the GTSM-enabled router:
1. Run system-view
The system view is displayed.
2. Run gtsm default-action { drop | pass }
The default action for packets that do not match the GTSM policy is
configured.
NOTE
If the default action is configured but no GTSM policy is configured, GTSM does not
take effect.
This command is supported only on the Admin-VS and cannot be configured in other
VSs. This command takes effect on all VSs.
3. Run commit
The configuration is committed.
----End
Usage Scenario
The GTSM prevents attacks through TTL detection. An attacker simulates real
BGP4+ packets and sends the packets in a large quantity to the router. After
receiving the packets, an interface board of the router directly sends the packets
to the BGP4+ module of the control plane if the interface board finds that the
packets are sent by the local router, without checking the validity of the packets.
The control plane of the router needs to process the "legal" packets. As a result,
the system becomes abnormally busy and the CPU usage is high.
The GTSM protects the router by checking whether the TTL value in an IP packet
header is within a pre-defined range to enhance the system security.
NOTE
● The GTSM supports only unicast addresses; therefore, the GTSM must be configured on
all the routers configured with routing protocols.
Pre-configuration Tasks
Before configuring the BGP4+ GTSM, complete the following task:
Procedure
Step 1 Configure the basic BGP4+ GTSM functions.
1. Run system-view
The valid TTL range of detected packets is [255 - hops + 1, 255]. For example,
for an EBGP direct route, the number of hops is 1, that is, the valid TTL value
is 255.
NOTE
– When being configured in the BGP view, the GTSM is also applicable to MP-BGP
VPNv4 extensions because they use the same TCP connection.
– The GTSM and EBGP-MAX-HOP functions both affect the TTL values of sent BGP4+
messages and they conflict with each other. Thus, for a peer or a peer group, you
can use only either of them.
A BGP4+ router that is enabled with GTSM checks the TTL values in all BGP4+
packets. As required by the actual networking, packets whose TTL values are
not within the specified range are discarded. If GTSM is not configured on a
BGP4+ router, the received BGP4+ packets are forwarded if the BGP4+ peer
configuration is matched. Otherwise, the received BGP4+ packets are
discarded. This prevents bogus BGP4+ packets from consuming CPU resources.
4. Run commit
Step 2 Set the default action for packets that do not match the GTSM policy.
GTSM only checks the TTL values of packets that match the GTSM policy. Packets
that do not match the GTSM policy can be allowed or dropped. If "drop" is set as
the default GTSM action for packets, you need to configure TTL values for all the
packets sent from valid peers in the GTSM policy. If TTL values are not configured
for the packets sent from a peer, the device will discard the packets sent from the
peer and cannot establish a connection to the peer. Therefore, GTSM enhances
security but reduces the ease of use.
You can enable the log function to record packet drop for troubleshooting.
Perform the following configurations on the GTSM-enabled router:
1. Run system-view
The system view is displayed.
2. Run gtsm default-action { drop | pass }
The default action for packets that do not match the GTSM policy is
configured.
NOTE
If the default action is configured but no GTSM policy is configured, GTSM does not
take effect.
This command is supported only on the Admin-VS and cannot be configured in other
VSs. This command takes effect on all VSs.
3. Run commit
The configuration is committed.
----End
Usage Scenario
The GTSM prevents attacks through TTL detection. An attacker simulates real LDP
unicast packets and keeps sending them to the router. After receiving the packets,
an interface board of the router directly sends the packets to LDP of the control
plane if the interface board finds that the packets are sent to the local router,
without checking the validity of the packets. The control plane of the router needs
to process the "legal" packets; therefore, the system becomes abnormally busy
and the CPU usage is high.
The GTSM protects the router by checking whether the TTL value in the LDP
packet header is within a pre-defined range to improve the system security.
Pre-configuration Tasks
Before configuring the LDP GTSM, complete the following task:
Context
Perform the following steps on the two LDP peers that need to be configured with
the GTSM:
Procedure
Step 1 Run system-view
If the value of hops is set to the maximum number of valid hops permitted by the
GTSM, when the TTL values carried in the packets sent by an LDP peer are within
the range [255 - hops + 1, 255], the packets are accepted; otherwise, the packets
are discarded.
NOTE
The valid TTL range is from 1 to 255 or from 1 to 64, depending on the specific vendor. If a
Huawei device is connected to a non-Huawei device, set hops to a value in a valid range
that both devices support; otherwise, the Huawei device will discard packets sent by the
non-Huawei device, resulting in LDP session interruption.
----End
● Run the display gtsm statistics { slot-id | all } command to view the statistics
about the GTSM.
NOTE
Context
During network attacks, attackers may simulate RIP packets and continuously
send them to a router. If the packets are destined for the router, it directly
forwards them to the control plane for processing without validating them. As a
result, the increased processing workload on the control plane results in high CPU
usage. Generalized TTL Security Mechanism (GTSM) defends against attacks by
checking whether the time to live (TTL) value in each IP packet header is within a
pre-defined range.
Pre-configuration Tasks
Before configuring the RIP GTSM, complete the following task:
Procedure
Step 1 Run system-view
NOTE
The valid TTL range of the detected packets is [ 255 -valid-ttl-hops-value + 1, 255 ].
Step 4 Set the default action for packets that do not match the GTSM policy.
GTSM only checks the TTL values of packets that match the GTSM policy. Packets
that do not match the GTSM policy can be allowed or dropped.
You can enable the log function to record packet drop for troubleshooting.
1. Run system-view
The default action for packets that do not match the GTSM policy is
configured.
NOTE
If the default action is configured but no GTSM policy is configured, GTSM does not
take effect.
This command is supported only on the Admin-VS and cannot be configured in other
VSs. This command takes effect on all VSs.
3. Run commit
----End
● Run the display gtsm statistics { slot-id | all } command to view the statistics
about the GTSM.
NOTE
Context
NOTICE
The statistics about the GTSM cannot be restored after being cleared. Therefore,
use this command with caution.
Procedure
Step 1 After confirming that you need to clear the statistics about the GTSM from a
board, run the reset gtsm statistics { slot-id | all } command in the user view.
----End
Networking Requirements
As shown in Figure 1-12, OSPF runs on the routers and the GTSM is enabled on
Device C.
The valid TTL ranges of the packets sent from each router to Device C are as
follows:
● Device A and Device E are the neighbors of Device C. The valid TTL range of
the packets from Device A and Device E to Device C is 255.
● The valid TTL ranges of the packets sent from Device B, Device D, and Device
F to Device C are [254, 255], [253, 255], and [252, 255] respectively.
Configuration Notes
None.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure basic OSPF functions.
2. Enable the GTSM on each router and specify the valid TTL range of packets.
Data Preparation
To complete the configuration, you need the following data:
● OSPF process ID of each router
● Valid TTL range of the packets transmitted between the routers
Procedure
Step 1 Configure IP addresses for interfaces. The configuration details are not mentioned
here.
Step 2 Configure the basic OSPF functions. The configuration details are not mentioned
here.
Step 3 Configure the OSPF GTSM.
# Configure the valid TTL range of the packet from Device C to other routers as
[252, 255].
[~DeviceC] ospf valid-ttl-hops 4
[*DeviceC] commit
# Configure the valid TTL range of the packets from Device A to Device C as [255,
255].
[~DeviceA] ospf valid-ttl-hops 1
[*DeviceA] commit
# Configure the valid TTL range of the packets from Device B to Device C as [254,
255].
[~DeviceB] ospf valid-ttl-hops 2
[*DeviceB] commit
# Configure the valid TTL range of the packets from Device D to Device C as [253,
255].
[~DeviceD] ospf valid-ttl-hops 3
[*DeviceD] commit
# Configure the valid TTL range of the packets from Device E to Device C as [255,
255].
[~DeviceE] ospf valid-ttl-hops 1
[*DeviceE] commit
# Configure the valid TTL range of the packets from Device F to Device C as [252,
255].
# Run the display gtsm statistics all command on Device C. You can view the
statistics about the GTSM. If the default action that is performed on the packets is
"pass" and all the packets are valid, no packet is dropped.
<DeviceC> display gtsm statistics all
GTSM Statistics Table
----------------------------------------------------------------
SlotId Protocol Total Counters Drop Counters Pass Counters
----------------------------------------------------------------
1 BGP 0 0 0
1 BGPv6 0 0 0
1 OSPF 0 0 0
1 LDP 0 0 0
1 OSPFv3 0 0 0
1 RIP 0 0 0
2 BGP 0 0 0
2 BGPv6 0 0 0
2 OSPF 0 0 0
2 LDP 0 0 0
2 OSPFv3 0 0 0
2 RIP 0 0 0
3 BGP 0 0 0
3 BGPv6 0 0 0
3 OSPF 0 0 0
3 LDP 0 0 0
3 OSPFv3 0 0 0
3 RIP 0 0 0
4 BGP 0 0 0
4 BGPv6 0 0 0
4 OSPF 0 0 0
4 LDP 0 0 0
4 OSPFv3 0 0 0
4 RIP 0 0 0
5 BGP 0 0 0
5 BGPv6 0 0 0
5 OSPF 0 0 0
5 LDP 0 0 0
5 OSPFv3 0 0 0
5 RIP 0 0 0
7 BGP 0 0 0
7 BGPv6 0 0 0
7 OSPF 0 0 0
7 LDP 0 0 0
7 OSPFv3 0 0 0
7 RIP 0 0 0
----------------------------------------------------------------
If the host PC simulates OSPF packets of Device A to attack Device C, the packets
are dropped because the TTL value is not 255 when the packets reach Device C. In
the GTSM statistics on Device C, the number of dropped packets also increases.
----End
Configuration Files
● Device A configuration file
#
sysname DeviceA
#
router id 1.1.1.1
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 192.168.0.1 255.255.255.0
#
interface GigabitEthernet2/0/0
undo shutdown
ip address 192.168.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 192.168.0.0 0.0.0.255
area 0.0.0.1
network 192.168.1.0 0.0.0.255
#
ospf valid-ttl-hops 1
#
return
#
router id 3.3.3.3
#
interface GigabitEthernet2/0/0
undo shutdown
ip address 172.16.1.1 255.255.255.0
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 192.168.1.2 255.255.255.0
#
ospf 1
area 0.0.0.1
network 192.168.1.0 0.0.0.255
network 172.16.1.0 0.0.0.255
#
ospf valid-ttl-hops 4
#
return
● Device configuration file
#
sysname DeviceD
#
router id 4.4.4.4
#
interface GigabitEthernet2/0/0
undo shutdown
ip address 172.17.1.1 255.255.255.0
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 192.168.2.2 255.255.255.0
#
ospf 1
area 0.0.0.2
network 192.168.2.0 0.0.0.255
network 172.17.1.0 0.0.0.255
#
ospf valid-ttl-hops 3
#
return
● Device E configuration file
#
sysname DeviceE
#
router id 5.5.5.5
#
interface GigabitEthernet2/0/0
undo shutdown
ip address 172.16.1.2 255.255.255.0
#
ospf 1
area 0.0.0.1
network 172.16.1.0 0.0.0.255
#
ospf valid-ttl-hops 1
#
return
● Device F configuration file
#
sysname DeviceF
#
router id 6.6.6.6
#
interface GigabitEthernet2/0/0
undo shutdown
ip address 172.17.1.2 255.255.255.0
#
ospf 1
area 0.0.0.2
network 172.17.1.0 0.0.0.255
#
ospf valid-ttl-hops 4
#
return
Networking Requirements
Attacks by bogus packets on networks cause overload and consumption of the
limited resources (such as CPUs) of devices. For example, an attacker sends bogus
BGP packets to a router continuously. When the router determines that the
received packets are destined for the local device, the forwarding plane sends the
packets to the control plane for BGP processing without checking the validity of
the packets. This causes a high CPU usage rate to the router because the router
keeps processing the packets.
As shown in Figure 1-13, DeviceA belongs to AS10; DeviceB, DeviceC, and DeviceD
all belong to AS20. BGP operates on the network as shown in Figure 1-13, and
the BGP GTSM is used to protect DeviceB from CPU-utilization attacks.
Configuration Notes
When configuring BGP GTSM, note the following:
● GTSM must be enabled on both ends of a BGP connection.
● The valid-ttl-hops value set on both ends of a BGP connection must be the
same.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure OSPF on DeviceA, DeviceB, DeviceC, and DeviceD in AS20 for
interworking.
2. Establish an EBGP connection between DeviceA and DeviceB; establish an
IBGP full mesh between DeviceB, DeviceC, and DeviceD through the loopback
interfaces.
3. Configure the GTSM on DeviceA, DeviceB, DeviceC, and DeviceD.
Data Preparation
To complete the configuration, you need the following data:
● Router ID and AS numbers of DeviceA, DeviceB, DeviceC, and DeviceD
● Valid TTL range between DeviceA and DeviceB, DeviceB and DeviceC, DeviceC
and DeviceD, and DeviceB and DeviceD
Procedure
Step 1 Configure IP addresses for interfaces. The configuration details are not mentioned
here.
Step 2 Configure OSPF. The configuration details are not mentioned here.
Step 3 Configure the IBGP full mesh.
# Configure DeviceB.
[~DeviceB] bgp 20
[*DeviceB-bgp] router-id 10.2.2.9
[*DeviceB-bgp] peer 10.3.3.9 as-number 20
[*DeviceB-bgp] peer 10.3.3.9 connect-interface LoopBack0
[*DeviceB-bgp] peer 10.3.3.9 next-hop-local
[*DeviceB-bgp] peer 10.4.4.9 as-number 20
[*DeviceB-bgp] peer 10.4.4.9 connect-interface LoopBack0
[*DeviceB-bgp] peer 10.4.4.9 next-hop-local
[*DeviceB-bgp] commit
# Configure DeviceC.
[~DeviceC] bgp 20
[*DeviceC-bgp] router-id 10.3.3.9
[*DeviceC-bgp] peer 10.2.2.9 as-number 20
[*DeviceC-bgp] peer 10.2.2.9 connect-interface LoopBack0
[*DeviceC-bgp] peer 10.4.4.9 as-number 20
[*DeviceC-bgp] peer 10.4.4.9 connect-interface LoopBack0
[*DeviceC-bgp] commit
# Configure DeviceD.
[~DeviceD] bgp 20
[*DeviceD-bgp] router-id 10.4.4.9
[*DeviceD-bgp] peer 10.2.2.9 as-number 20
[*DeviceD-bgp] peer 10.2.2.9 connect-interface LoopBack0
[*DeviceD-bgp] peer 10.3.3.9 as-number 20
[*DeviceD-bgp] peer 10.3.3.9 connect-interface LoopBack0
[*DeviceD-bgp] commit
# Configure Device B.
[~DeviceB-bgp] peer 10.1.1.1 as-number 10
[*DeviceB-bgp] commit
You can view that the BGP connections between DeviceB and the other routers are
set up.
Step 5 Configure the GTSM between DeviceA and DeviceB. The two routers are directly
connected; therefore, the valid TTL range of the packets between them is [255,
255]. That is, the value of valid-ttl-hops is 1.
# Configure the GTSM on DeviceA.
[~DeviceA] bgp 10
[*DeviceA-bgp] peer 10.1.1.2 valid-ttl-hops 1
[*DeviceA-bgp] commit
Group ID : 2
BGP current state: Established, Up for 00h49m35s
BGP current event: RecvKeepalive
BGP last state: OpenConfirm
BGP Peer Up count: 1
Received total routes: 0
Received active routes total: 0
Advertised total routes: 0
You can view that the GTSM is enabled, the number of valid TTL hops is 1, and the
status of the BGP connection is Established.
Step 6 Configure the GTSM between DeviceB and DeviceC. The two routers are directly
connected; therefore, the valid TTL range of the packets between them is [255,
255]. That is, the value of valid-ttl-hops is 1.
# Configure the GTSM on DeviceB.
[~DeviceB] bgp 20
[*DeviceB-bgp] peer 10.3.3.9 valid-ttl-hops 1
[*DeviceB-bgp] commit
Group ID : 0
BGP current state: Established, Up for 00h54m36s
BGP current event: KATimerExpired
BGP last state: OpenConfirm
BGP Peer Up count: 1
Received total routes: 0
Received active routes total: 0
Advertised total routes: 0
Port: Local - 54998 Remote - 179
Configured: Active Hold Time: 180 sec Keepalive Time:60 sec
Received : Active Hold Time: 180 sec
Negotiated: Active Hold Time: 180 sec Keepalive Time:60 sec
Peer optional capabilities:
You can view that the GTSM is enabled, the number of valid TTL hops is 1, and the
status of the BGP connection is Established.
Step 7 Configure the GTSM between DeviceC and DeviceD. The two routers are directly
connected; therefore, the valid TTL range of the packets between them is [255,
255]. That is, the value of valid-ttl-hops is 1.
# Configure the GTSM for the IBGP connections on DeviceC.
[~DeviceC] bgp 20
[*DeviceC-bgp] peer 10.4.4.9 valid-ttl-hops 1
[*DeviceC-bgp] commit
Group ID : 1
BGP current state: Established, Up for 00h56m06s
BGP current event: KATimerExpired
BGP last state: OpenConfirm
BGP Peer Up count: 1
Received total routes: 0
Received active routes total: 0
Advertised total routes: 0
Port: Local - 179 Remote - 53758
Configured: Active Hold Time: 180 sec Keepalive Time:60 sec
Received : Active Hold Time: 180 sec
Negotiated: Active Hold Time: 180 sec Keepalive Time:60 sec
Peer optional capabilities:
Peer supports bgp multi-protocol extension
Peer supports bgp route refresh capability
You can view that the GTSM is enabled, the number of valid TTL hops is 1, and the
status of the BGP connection is Established.
Step 8 Configure the GTSM between DeviceB and DeviceD. The two routers are
connected through DeviceC. Because of the hop of router C, the valid TTL range of
the packets between the two routers is [254, 255]. That is, the value of valid-ttl-
hops is 2.
# Configure the GTSM for the IBGP connections on DeviceB.
[~DeviceB-bgp] peer 10.4.4.9 valid-ttl-hops 2
[*DeviceB-bgp] commit
Group ID : 0
BGP current state: Established, Up for 00h57m48s
BGP current event: RecvKeepalive
BGP last state: OpenConfirm
BGP Peer Up count: 1
Received total routes: 0
Received active routes total: 0
Advertised total routes: 0
Port: Local - 53714 Remote - 179
Configured: Active Hold Time: 180 sec Keepalive Time:60 sec
Received : Active Hold Time: 180 sec
Negotiated: Active Hold Time: 180 sec Keepalive Time:60 sec
Peer optional capabilities:
Peer supports bgp multi-protocol extension
Peer supports bgp route refresh capability
Peer supports bgp 4-byte-as capability
Address family IPv4 Unicast: advertised and received
Received: Total 72 messages
Update messages 0
Open messages 1
KeepAlive messages 71
Notification messages 0
Refresh messages 0
Sent: Total 82 messages
Update messages 10
Open messages 1
KeepAlive messages 71
Notification messages 0
Refresh messages 0
Last keepalive received: 2009-02-20 14:01:27
Minimum route advertisement interval is 15 seconds
Optional capabilities:
Route refresh capability has been enabled
4-byte-as capability has been enabled
Nexthop self has been configured
Connect-interface has been configured
GTSM has been enabled, valid-ttl-hops: 2
Peer Preferred Value: 0
Routing policy configured:
No routing policy is configured
You can view that the GTSM is enabled, the number of valid TTL hops is 2, and the
status of the BGP connection is Established.
NOTE
# Run the display gtsm statistics all command on DeviceB, and you can view the
statistics about the GTSM on DeviceB. If the default action that is performed on
the packets is "pass" and all the packets are valid, no packet is dropped.
<DeviceB> display gtsm statistics all
GTSM Statistics Table
----------------------------------------------------------------
SlotId Protocol Total Counters Drop Counters Pass Counters
----------------------------------------------------------------
0 BGP 17 0 17
0 BGPv6 0 0 0
0 OSPF 0 0 0
0 LDP 0 0 0
0 OSPFv3 0 0 0
0 RIP 0 0 0
1 BGP 0 0 0
1 BGPv6 0 0 0
1 OSPF 0 0 0
1 LDP 0 0 0
1 OSPFv3 0 0 0
1 RIP 0 0 0
2 BGP 0 0 0
2 BGPv6 0 0 0
2 OSPF 0 0 0
2 LDP 0 0 0
2 OSPFv3 0 0 0
2 RIP 0 0 0
3 BGP 0 0 0
3 BGPv6 0 0 0
3 OSPF 0 0 0
3 LDP 0 0 0
3 OSPFv3 0 0 0
3 RIP 0 0 0
4 BGP 32 0 32
4 BGPv6 0 0 0
4 OSPF 0 0 0
4 LDP 0 0 0
4 OSPFv3 0 0 0
4 RIP 0 0 0
5 BGP 0 0 0
5 BGPv6 0 0 0
5 OSPF 0 0 0
5 LDP 0 0 0
5 OSPFv3 0 0 0
5 RIP 0 0 0
7 BGP 0 0 0
7 BGPv6 0 0 0
7 OSPF 0 0 0
7 LDP 0 0 0
7 OSPFv3 0 0 0
7 RIP 0 0 0
----------------------------------------------------------------
If the host PC simulates BGP packets of DeviceA to attack DeviceB, the packets are
dropped because the TTL value is not 255 when the packets reach DeviceB. In the
GTSM statistics on Device B, the number of dropped packets also increases.
----End
Configuration Files
● Device A configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
bgp 10
router-id 10.1.1.9
peer 10.1.1.2 as-number 20
peer 10.1.1.2 valid-ttl-hops 1
#
ipv4-family unicast
undo synchronization
peer 10.1.1.2 enable
#
return
Networking Requirements
As shown in Figure 1-14, LSRs run MPLS and MPLS LDP. An attacker can send
simulated unicast LDP packets to LSRB, causing LSRB to be busy processing
packets and resulting in high CPU usage. To defend against the attack, LSRB can
be configured with the GTSM to accept packets carrying the TTL values within a
specified range, improving system security.
Configuration Notes
None.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
● LSR ID of the LDP peer
● Maximum number of valid hops permitted by the GTSM
Procedure
Step 1 Configure IP addresses for interfaces. The configuration details are not mentioned
here.
Step 2 Configure OSPF to advertise the network segments connecting to interfaces on
each node and to advertise the routes of the hosts with LSR IDs. The configuration
details are not mentioned here.
Step 3 Configure MPLS and MPLS LDP on each interface and node. The configuration
details are not mentioned here.
After the preceding configurations, you can run the display mpls ldp session
command on each node. The command output shows that the LDP session is set
up. Take the command output on LSR A as an example.
<LSRA> display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
An asterisk (*) before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.9:0 Operational DU Passive 0000:00:02 9/9
------------------------------------------------------------------------------
TOTAL: 1 session(s) Found.
# On LSR B, configure the range of valid TTL values carried in the LDP packets
received from LSR A to be from 252 to 255, and the range of valid TTL values
carried in LDP packets received from LSR C to be from 251 to 255.
<LSRB> system-view
[~LSRB] mpls ldp
[*LSRB-mpls-ldp] gtsm peer 1.1.1.9 valid-ttl-hops 4
[*LSRB-mpls-ldp] gtsm peer 3.3.3.9 valid-ttl-hops 5
[*LSRB-mpls-ldp] commit
# On LSR C, configure the range of valid TTL values carried in LDP packets
received from LSR B to be from 250 to 255.
<LSRC> system-view
[~LSRC] mpls ldp
[*LSRC-mpls-ldp] gtsm peer 2.2.2.9 valid-ttl-hops 6
[*LSRC-mpls-ldp] commit
Then, if the host PC simulates the LDP packets of LSR A to attack LSR B, LSR B
directly discards the packets because the TTL values carried in the LDP packets are
not within the range of 252 to 255. In the GTSM statistics on LSR B, the number of
discarded packets also increases.
----End
Configuration Files
● LSR A configuration file
#
sysname LSRA
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
gtsm peer 2.2.2.9 valid-ttl-hops 3
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.1.1 255.255.255.252
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 10.1.1.0 0.0.0.3
#
return
Definition
The Host-based Intrusion Prevention System (HIPS) monitors a device's system for
intrusions and infections. Unlike the Intrusion Prevention System (IPS) — which
analyzes and processes the traffic passing through a device to protect devices and
users on the internal network — HIPS protects the device's system.
Purpose
The security of network devices, which are important components of ICT
infrastructure, directly affects the security of the entire network. Network devices
are prone to hacker attacks and intrusions because they are usually deployed in
front of servers and terminals. After intruding into a network device, a hacker can
further penetrate the network through the device. To prevent this, HIPS is
introduced to monitor the device's operating system, as shown in Figure 1-15.
Once a suspected intrusion or infection event is detected, HIPS immediately sends
a log to prompt the administrator to isolate and protect the device, preventing
further intrusions and compromising the security of other devices.
Context
After HIPS is enabled, the configuration and enabling status of each detection
module are determined by the HIPS policy file. The policy file content cannot be
modified on the device and all detection modules are enabled by default. You can
configure the policy file on the NMS, which then instructs the device to obtain and
apply the newly configured policy file.
Procedure
Step 1 Run system-view
----End
Follow-up Procedure
Run the display hips state command in any view to check the status of each HIPS
detection module.
When administrator does not configure a key-id for some interval of time,
there can be a chance that there is no active send key-id. During that period,
application will not be able to have authenticated communication. In order to
avoid this situation there should be a default send key-id which will be always
active. Any key-id in a keychain can be marked as the default send key-id.
There can be only one default send key-id in a keychain. When any send key-
id becomes active, the application uses the new active send key-id instead of
the default send key-id. Similarly when active send key-id becomes inactive
and when there is no other active send key-id, then application uses the
default send key-id.
● TCP-kind and TCP algorithm-id configuration
TCP based applications can communicate with other vendor nodes by using
the authenticated TCP connection. For authenticated communication, TCP
uses TCP Enhanced Authentication Option. Currently different vendors use
different kind-value to represent the TCP Enhanced Authentication Option
type. So in order to communicate with other vendors, kind-value should be
made configurable, so that it can be changed based on the type of vendor to
which it is connected. Similarly TCP Enhanced Authentication Option has a
field named algorithm-id which represents the authentication algorithm type.
As algorithm-ids are not defined by IANA. Currently different vendor uses
different algorithm-id to represent the same algorithm. In order to
communicate with the other vendors, user has to configure the TCP
algorithm-id in the keychain for the algorithms depending on the peer node
type.
NOTE
For security purposes, you are not advised to use the weak security algorithm in this
feature. To use the weak security algorithm, run the undo crypto weak-algorithm
disable command to enable the weak security algorithm.
Usage Scenario
Keychain is used to provide authentication support to the applications. A keychain
can have one or more key-ids. Key-id comprises of authentication algorithm and
the key-string (secret shared key). Each key-id is associated with send and accept
lifetime. Based on the send and accept lifetime, a key-id will be send-active or
receive-active or both. When the key-id is send-active or receive-active, it will be
used for authenticated communication. When the key-id is send-active, then it will
be used to send out authenticated packet. On the receiver side that key-id should
be receive-active to process the authenticated packet. The administrator has to
configure the key-ids under the keychain in such a way that both sides can
communicate without any packet loss.
Pre-configuration Tasks
Before configuring the keychain on the peer routers, configure the Network Time
Protocol (NTP) so that the time is consistent on the two routers.
Procedure
Step 1 Run system-view
NOTE
When creating a keychain, timing mode is mandatory. Once a keychain is created, to enter
the keychain view timing mode need not be specified.
----End
Procedure
Step 1 Run system-view
NOTE
----End
Procedure
Step 1 Run system-view
The system view is entered.
Step 2 Run keychain keychain-name
The keychain view is entered.
Step 3 Run key-id key-id
Key-id is created and key-id view is entered.
NOTE
----End
Procedure
Step 1 Run system-view
The system view is entered.
Step 2 Run keychain keychain-name
The keychain view is entered.
Step 3 Run key-id key-id
Key-id is created and key-id view is entered.
Step 4 Run key-string { plain plain-text | [ cipher ] plain-cipher-text }
Key-string is the authentication string used while sending and receiving the
packets.
NOTE
For security purposes, you are advised to configure a password in ciphertext mode. To
further improve device security, periodically change the password.
Key-id will be inactive if the key-string is not configured.
----End
Procedure
Step 1 Run system-view
NOTE
The aes-128-cmac algorithm is used only when the key of the keychain is bound to TCP-AO
authentication. Keychain authentication cannot use the aes-128-cmac algorithm.
Key-id will be inactive if the authentication algorithm is not configured.
To ensure high security, do not use the MD5 or SHA-1 algorithm.
NOTE
The HMAC-SHA1-20 algorithm uses a 20-byte digest for encryption and decryption by
default. You can run the digest-length hmac-sha1-20 16 command to allow for
interconnection with an earlier version. By default, the HMAC-SHA-256 and SHA-256
algorithms use a 32-byte digest for encryption and decryption. You can run the digest-
length hmac-sha-256 16 or digest-length sha-256 16 command to allow for
interconnection with an earlier version.
----End
Procedure
Step 1 Run system-view
The system view is entered.
Step 2 Run keychain keychain-name
The keychain view is entered.
Step 3 Run key-id key-id
Key-id is created and key-id view is entered.
Step 4 Run default send-key-id
The key-id is set as the default send-key-id.
Only one key-id in a keychain can be configured as the default send-key-id.
Step 5 Run commit
The configurations are committed.
----End
Context
The time modes for sending key IDs vary according to keychain configuration
modes.
Procedure
● Absolute Timing Mode
a. Run system-view
The system view is entered.
b. Run keychain keychain-name mode absolute
Context
The time modes for receiving key IDs vary according to keychain configuration
modes.
Procedure
● Absolute Timing Mode
a. Run system-view
The system view is entered.
b. Run keychain keychain-name mode absolute
The keychain is created in absolute timing mode and keychain view is
entered.
c. Run time mode { utc | lmt }
The time mode for keychain is configured.
d. Run key-id key-id
The key-id is created and key-id view is entered.
e. Run receive-time start-time start-date { duration { duration-value |
infinite } | { to end-time end-date } }
The receive-time for the key-id is configured.
f. Run commit
The configurations are committed.
● Daily Periodic Timing Mode
a. Run system-view
The system view is entered.
b. Run keychain keychain-name mode periodic daily
The keychain is created in daily periodic timing mode and keychain view
is entered.
c. Run time mode { utc | lmt }
The time mode for keychain is configured.
d. Run key-id key-id
The key-id is created and key-id view is entered.
e. Run receive-time daily start-time to end-time
The receive-time for the key-id is configured.
f. Run commit
The configurations are committed.
● Weekly Periodic Timing Mode
a. Run system-view
The system view is entered.
b. Run keychain keychain-name mode periodic weekly
The keychain is created in yearly periodic timing mode and keychain view
is entered.
c. Run time mode { utc | lmt }
To re-configure receive time you need to undo the receive time that is
currently configured.
f. Run commit
----End
Prerequisites
The configurations of the keychain are complete.
Procedure
● Run the display keychain keychain-name command to view the current
configuration of a keychain.
● Run the display keychain keychain-name key-id key-id command to view the
current configuration of a key-id inside a keychain.
----End
Usage Scenario
Keychain is used to provide authentication support to all the applications.
Authenticated TCP communication is required between two peers. TCP based
applications can communicate with other vendor nodes by using the
authenticated TCP connection. For authenticated communication, TCP uses TCP
Enhanced Authentication Option. Currently different vendors use different kind
value to represent the TCP Enhanced Authentication Option type. Hence, kind
value should be made configurable based on the type of vendor to which it is
connected. Similarly TCP Enhanced Authentication Option has a field named
algorithm-id which represents the authentication algorithm type. As algorithm-ids
are not defined by IANA, currently different vendor uses different algorithm-id to
represent the same algorithm. In order to communicate with the other vendors,
user has to configure the TCP algorithm-id in the keychain.
Pre-configuration Tasks
Before configuring the keychain feature on the peer routers supporting TCP,
configure the Network Time Protocol (NTP) so that the time is consistent on the
two routers.
Procedure
Step 1 Run system-view
The TCP kind value for the keychain is configured. The range of the kind-value can
be 28 to 255.
----End
Follow-up Procedure
TCP uses TCP Enhanced Authentication Option for authenticated communication.
The kind value used to represent the TCP Enhanced Authentication Option type for
a keychain can be configured.
Procedure
Step 1 Run system-view
----End
Follow-up Procedure
The algorithm-id used to represent authentication algorithm type in TCP Enhanced
Authentication Option for a keychain can be configured.
Prerequisites
The configurations of the keychain are complete.
Procedure
● Run the display keychain keychain-name command to view the current
configuration of a keychain.
● Run the display keychain keychain-name key-id key-id command to view the
current configuration of a key-id inside a keychain.
----End
Networking Requirements
As shown in Figure 1-16, it is required to enable IS-IS and keychain authentication
on all interfaces of Device A and Device B. The routers interconnect with each
other using IS-IS.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure IS-IS basic functions.
2. Configure keychain basic functions.
3. Configure the application IS-IS on both the Device A and Device B to use
keychain and set the key-id authentication algorithm to hmac-sha-256..
Data Preparation
To complete the configuration, you need the following data:
● keychain name
● key-id
● algorithm and key-string
● send and receive time
● receive tolerance
Procedure
Step 1 Configure Device A.
# Configure IS-IS basic functions. The configuration details are not mentioned
here.
# Configuring Keychain.
[~DeviceA] keychain huawei mode absolute
[*DeviceA-keychain-huawei] receive-tolerance 100
[*DeviceA-keychain-huawei] key-id 1
[*DeviceA-keychain-huawei-keyid-1] algorithm hmac-sha-256
[*DeviceA-keychain-huawei-keyid-1] key-string cipher YsHsjx_202206
[*DeviceA-keychain-huawei-keyid-1] send-time 14:40 2017-10-10 to 14:50 2017-10-10
[*DeviceA-keychain-huawei-keyid-1] receive-time 14:30 2017-10-10 to 14:50 2017-10-10
[*DeviceA-keychain-huawei-keyid-1] default send-key-id
[*DeviceA-keychain-huawei-keyid-1] commit
[~DeviceA-keychain-huawei-keyid-1] quit
[~DeviceA-keychain-huawei] quit
# Configure IS-IS basic functions. The configuration details are not mentioned
here.
# Configuring Keychain.
[~DeviceB] keychain huawei mode absolute
[*DeviceB-keychain-huawei] receive-tolerance 100
[*DeviceB-keychain-huawei] key-id 1
[*DeviceB-keychain-huawei-keyid-1] algorithm hmac-sha-256
[*DeviceB-keychain-huawei-keyid-1] key-string cipher YsHsjx_202206
[*DeviceB-keychain-huawei-keyid-1] send-time 14:40 2017-10-10 to 14:50 2017-10-10
[*DeviceB-keychain-huawei-keyid-1] receive-time 14:30 2017-10-10 to 14:50 2017-10-10
[*DeviceB-keychain-huawei-keyid-1] default send-key-id
[*DeviceB-keychain-huawei-keyid-1] commit
[~DeviceB-keychain-huawei-keyid-1] quit
[~DeviceB-keychain-huawei] quit
----End
Configuration File
● Device A configuration file
#
sysname DeviceA
#
keychain huawei mode absolute
receive-tolerance 100
key-id 1
algorithm hmac-sha-256
key-string cipher @%@%b{br9\zi%X+/Y@:Y>Lw(L\v#@%@%
send-time 14:30 2017-10-10 to 14:50 2017-10-10
receive-time 14:40 2017-10-10 to 14:50 2017-10-10
default send-key-id
#
interface gigabitethernet1/0/0
ip address 192.168.1.1 24
isis authentication-mode keychain huawei
#
return
Networking Requirements
As shown in Figure 1-17, it is required to enable BGP and keychain authentication
on all interfaces of DeviceA and DeviceB. The routers interconnect with each other
using BGP.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure keychain basic functions.
2. Configure the application BGP on both the routers to use keychain.
Data Preparation
To complete the configuration, you need the following data:
● keychain name
● key-id
● algorithm and key-string
● send and receive time
● receive tolerance
● tcp-kind value and tcp-algorithm-id of SHA-256 authentication algorithm.
Procedure
Step 1 # Configure DeviceA.
Configuring Keychain
[~DeviceA] keychain huawei mode absolute
[*DeviceA-keychain-huawei] tcp-kind 182
[*DeviceA-keychain-huawei] tcp-algorithm-id sha-256 17
[*DeviceA-keychain-huawei] receive-tolerance 100
[*DeviceA-keychain-huawei] key-id 1
[*DeviceA-keychain-huawei-keyid-1] algorithm sha-256
[*DeviceA-keychain-huawei-keyid-1] key-string cipher YsHsjx_202206
[*DeviceA-keychain-huawei-keyid-1] send-time 14:40 2017-10-10 to 14:50 2017-10-10
[*DeviceA-keychain-huawei-keyid-1] receive-time 14:30 2017-10-10 to 14:50 2017-10-10
[*DeviceA-keychain-huawei-keyid-1] default send-key-id
[*DeviceA-keychain-huawei-keyid-1] commit
[~DeviceA-keychain-huawei-keyid-1] quit
[*DeviceA-keychain-huawei] key-id 2
[*DeviceA-keychain-huawei-keyid-2] algorithm sha-256
[*DeviceA-keychain-huawei-keyid-2] key-string cipher YsHsjx_202207
[*DeviceA-keychain-huawei-keyid-2] send-time 08:30 2017-10-10 to 13:30 2017-10-10
[*DeviceA-keychain-huawei-keyid-2] receive-time 09:30 2017-10-10 to 14:30 2017-10-10
[*DeviceA-keychain-huawei-keyid-2] commit
[~DeviceA-keychain-huawei-keyid-2] quit
[~DeviceA-keychain-huawei] quit
----End
Configuration File
● Device A configuration file
#
sysname DeviceA
#
keychain huawei mode absolute
tcp-kind 182
tcp-algorithm-id sha-256 17
receive-tolerance 100
#
key-id 1
algorithm sha-256
key-string cipher @%@%Hb'c;\@iU'@X,k6.E\Z,*.S#@%@%
send-time 14:40 2017-10-10 to 14:50 2017-10-10
receive-time 14:30 2017-10-10 to 14:50 2017-10-10
default send-key-id
#
key-id 2
algorithm sha-256
key-string cipher %^%#[aqxE3`@U8L*%n."1(<$,]k_QrVTf1X;K+;My)k;%^%#
send-time 08:30 2017-10-10 to 13:30 2017-10-10
receive-time 09:30 2017-10-10 to 14:30 2017-10-10
#
interface gigabitethernet1/0/0
ip address 192.168.1.1 24
#
bgp 1
router-id 1.1.1.1
peer 192.168.1.2 as-number 1
peer 192.168.1.2 keychain huawei
#
return
NOTE
For security purposes, you are advised not to use weak security algorithms in this feature. If
you need to use such an algorithm, run the undo crypto weak-algorithm disable
command to enable the weak security algorithm function first.
Context
To implement TCP-AO on a device, a TCP-AO needs to be associated with the
authentication algorithm, authentication key string, and lifetime of a key in a
Procedure
Step 1 Run the system-view command to enter the system view.
Step 2 Run the keychain keychain-name mode { absolute | periodic { daily | weekly |
monthly | yearly } } command to create a keychain and enter its view.
NOTE
When creating a keychain, a time mode must be specified. However, if the desired keychain
has been created, you can directly run the keychain keychain-name command to enter the
keychain view, without specifying a time mode.
Step 3 Run the receive-tolerance { value | infinite } command to set a tolerance time for
the keychain.
NOTE
Step 4 (Optional) Run the time mode { lmt | utc } command to set a time mode for the
keychain. The default time format of a keychain is LMT.
Step 5 Run the key-id key-id command to create a key and enter the key ID view.
For security purposes, you are not advised to specify md5 or sha-1
For security purposes, you are advised to use the cipher mode. In this mode, the configured
key is displayed in ciphertext in the configuration file.
Step 8 Run any of the following commands to configure a lifetime for the key:
----End
Prerequisites
A keychain has been configured.
Context
To implement TCP-AO on a device, a TCP-AO needs to be associated with the
authentication algorithm, authentication key string, and lifetime of a key in a
keychain. Therefore, during TCP-AO configuration, you need to bind the TCP-AO to
an existing keychain.
Procedure
Step 1 Run the system-view command to enter the system view.
Step 2 Run the tcp ao tcpaoname command to create a TCP-AO and enter the TCP-AO
Policy view.
Step 3 Run the binding keychain kcName command to bind the TCP-AO to an existing
keychain.
NOTE
After being bound to a keychain, a TCP-AO can be associated with the authentication
algorithm, authentication key string, and lifetime of a key in the keychain.
Multiple TCP-AOs can be bound to the same keychain to reduce the configuration workload
and implement centralized management of multiple TCP-AO keys.
Step 4 (Optional) Run the accept-mismatch enable command to configure the local end
to permit received TCP connection setup request packets that do not carry the
TCP-AO option.
Step 5 Run the key-id KeyId command to create a key ID for the TCP-AO and enter the
TCP-AO key ID view.
NOTE
The key ID specified in this step must be the same as a key ID configured in the bound
keychain. Otherwise, the authentication algorithm, authentication key string, and lifetime
of the keychain fail to be associated with the TCP-AO.
Step 6 Run the send-id sndId receive-id rcvId command to configure the send-id and
receive-id for the key ID.
NOTE
send-id and receive-id determine the KeyID (SendKeyID) and RNextKeyID (ReceiveKeyID)
of a TCP-AO to be carried in a TCP packet header. Their combination represents the
currently active key.
For example, Key1 (SendKeyID=1, ReceiveKeyID=2) indicates that the local end uses the
authentication algorithm and key in Key1 for encryption. The peer end selects the
authentication algorithm and key in Key1 (SendKeyID=2, ReceiveKeyID=1) based on
ReceiveKeyID=2 in the received packet to decrypt the packet.
A TCP packet header can contain multiple optional options. TCP-AO (Kind=29) is a type of
option.
You can run this command to include or exclude TCP packet headers' options during the
MAC calculation for a TCP-AO.
Note: The TCP-AO option is excluded during the MAC calculation for a TCP-AO even if the
function to include the options in TCP packet headers is enabled.
----End
Prerequisites
A TCP-AO has been configured.
Context
TCP-AO implements two-way authentication during TCP connection setup.
When TCP is used as the transport layer protocol for an application, such as the
BGP, MSDP, or LDP application, a TCP connection must be created before a session
can be established between two ends.
For details about how to apply a TCP-AO, see the reference configuration sections
listed in Table 1-16.
BGP IP Routing > BGP Configuration > Improving BGP Security >
Configuring TCP-AO Authentication
IP Routing > BGP4+ Configuration > Improving BGP4+
Security > Configuring BGP4+ Authentication
LDP MPLS > MPLS LDP Configuration > Configuring LDP Security
Features > Configuring LDP TCP-AO Authentication
Procedure
Step 1 Run the system-view command to enter the system view.
Step 2 Run the bgp as-number command to enter the BGP view.
Step 3 Run the peer { ipv4-address | group-name } tcp-ao policy tcp-ao-name command
to configure TCP-AO authentication.
NOTE
● The TCP-AO authentication configured in the BGP view also takes effect for the BGP
extended address family view because they use the same TCP connection.
● BGP MD5 authentication, BGP keychain authentication, and BGP TCP-AO authentication
are mutually exclusive.
● A TCP connection cannot be set up if the specified TCP-AO has not been configured or
the TCP-AO does not have an active key.
● After a TCP-AO is applied, the TCP connection does not support NAT traversal.
----End
Networking Requirements
In Figure 1-18, DeviceA and DeviceB communicate through BGP.
To ensure the stability and security of the BGP connection, configure TCP-AO to
provide dynamic security authentication services for BGP.
● Keychain name
● Tolerance time
● ID of the key in the keychain
● Authentication algorithm HMAC-SHA-256 and authentication key (character
string used for encryption) of the key
● Lifetime of the key
● TCP-AO name
● ID of the key in the TCP-AO
● send-id and receive-id in the key
Precautions
● Ensure that NTP and BGP have been configured.
● The keychain names configured on DeviceA and DeviceB must be the same.
● The time modes of the keychains configured on DeviceA and DeviceB must be
the same.
● The key IDs in the keychains configured on DeviceA and DeviceB must be the
same. When multiple keys are configured, the key quantity and IDs must be
the same as those on the other end, respectively.
● The authentication algorithm and key string for the same keys configured on
DeviceA and DeviceB must be the same.
● The TCP-AO names configured on DeviceA and DeviceB must be the same.
● The key IDs in the TCP-AOs configured on DeviceA and DeviceB must be the
same. When multiple keys are configured, the key quantity and IDs must be
the same as those on the other end, respectively.
● For the same key, the send-id and receive-id configured on DeviceA must
match those configured on DeviceB. That is, the receive-id of DeviceA equals
the send-id of DeviceB, and the send-id of DeviceA equals the receive-id of
DeviceB.
Configuration Roadmap
1. Configure a keychain.
2. Configure a TCP-AO and bind it to the keychain.
3. Configure TCP-AO authentication for BGP.
Procedure
Step 1 Configure a keychain.
# Configure DeviceA.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*DeviceA] keychain huawei mode absolute
[*DeviceA-keychain-huawei] receive-tolerance 5
[*DeviceA-keychain-huawei] key-id 1
[*DeviceA-keychain-huawei-keyid-1] algorithm hmac-sha-256
[*DeviceA-keychain-huawei-keyid-1] key-string cipher YsHsjx_202206
[*DeviceA-keychain-huawei-keyid-1] send-time 12:00 2019-12-10 to 15:00 2019-12-10
[*DeviceA-keychain-huawei-keyid-1] quit
[*DeviceA-keychain-huawei] key-id 2
[*DeviceA-keychain-huawei-keyid-2] algorithm hmac-sha-256
[*DeviceA-keychain-huawei-keyid-2] key-string cipher YsHsjx_202207
[*DeviceA-keychain-huawei-keyid-2] send-time 15:01 2019-12-10 to 18:00 2019-12-10
[*DeviceA-keychain-huawei-keyid-2] quit
[*DeviceA-keychain-huawei] quit
[*DeviceA] commit
# Configure DeviceB.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*DeviceB] keychain huawei mode absolute
[*DeviceB-keychain-huawei] receive-tolerance 5
[*DeviceB-keychain-huawei] key-id 1
[*DeviceB-keychain-huawei-keyid-1] algorithm hmac-sha-256
[*DeviceB-keychain-huawei-keyid-1] key-string cipher YsHsjx_202206
[*DeviceB-keychain-huawei-keyid-1] send-time 12:00 2019-12-10 to 15:00 2019-12-10
[*DeviceB-keychain-huawei-keyid-1] quit
[*DeviceB-keychain-huawei] key-id 2
[*DeviceB-keychain-huawei-keyid-2] algorithm hmac-sha-256
[*DeviceB-keychain-huawei-keyid-2] key-string cipher YsHsjx_202207
[*DeviceB-keychain-huawei-keyid-2] send-time 15:01 2019-12-10 to 18:00 2019-12-10
[*DeviceB-keychain-huawei-keyid-2] quit
[*DeviceB-keychain-huawei] quit
[*DeviceB] commit
# Configure DeviceB.
[~DeviceB] tcp ao huawei
[*DeviceB-tcp-ao-huawei] binding keychain huawei
[*DeviceB-tcp-ao-huawei] key-id 1
[*DeviceB-tcp-ao-huawei-keyid-1] send-id 2 receive-id 1
[*DeviceB-tcp-ao-huawei-keyid-1] quit
[*DeviceB-tcp-ao-huawei] key-id 2
[*DeviceB-tcp-ao-huawei-keyid-2] send-id 4 receive-id 3
[*DeviceB-tcp-ao-huawei-keyid-2] quit
[*DeviceB-tcp-ao-huawei] quit
[*DeviceB] commit
# Configure DeviceB.
[~DeviceB] interface gigabitethernet 1/0/0
[~DeviceB-GigabitEthernet1/0/0] ip address 192.168.1.2 24
[*DeviceB-GigabitEthernet1/0/0] quit
[*DeviceB] bgp 1
[*DeviceB-bgp] router-id 2.2.2.2
[*DeviceB-bgp] peer 192.168.1.1 as-number 1
[*DeviceB-bgp] peer 192.168.1.1 tcp-ao policy huawei
[*DeviceB-bgp] quit
[*DeviceB] commit
----End
KeepAlive messages 31
Notification messages 0
Refresh messages 0
Authentication type configured: TCP-AO(huawei)
Last keepalive received: 2019-12-10 10:12:29+00:00
Last keepalive sent : 2019-12-10 10:12:04+00:00
Last update received: 2019-12-10 09:45:14+00:00
Last update sent : 2019-12-10 09:45:14+00:00
No refresh received since peer has been configured
No refresh sent since peer has been configured
Minimum route advertisement interval is 15 seconds
Optional capabilities:
Route refresh capability has been enabled
4-byte-as capability has been enabled
Peer Preferred Value: 0
Routing policy configured:
No routing policy is configured
Configuration Scripts
● DeviceA
#
sysname DeviceA
#
keychain huawei mode absolute
receive-tolerance 5
#
key-id 1
algorithm hmac-sha-256
key-string cipher %^%#1h29-c>>[H,XTu>Q}##;"}JOQOK#c>TD6>~d-BaJ%^%#
send-time 12:00 2019-12-10 to 15:00 2019-12-10
#
key-id 2
algorithm hmac-sha-256
key-string cipher %^%#^<Sn.IK2iK'N%[VnMhv-I)|C4d<K$F$a.6%jEN@K%^%#
send-time 15:01 2019-12-10 to 18:00 2019-12-10
#
tcp ao huawei
binding keychain huawei
#
key-id 1
send-id 1 receive-id 2
key-id 2
send-id 3 receive-id 4
#
interface gigabitethernet1/0/0
ip address 192.168.1.1 255.255.255.0
#
bgp 1
router-id 1.1.1.1
peer 192.168.1.2 as-number 1
peer 192.168.1.2 tcp-ao policy huawei
#
ipv4-family unicast
peer 192.168.1.2 enable
#
return
● DeviceB
#
sysname DeviceB
#
keychain huawei mode absolute
receive-tolerance 5
#
key-id 1
algorithm hmac-sha-256
key-string cipher %^%#p8cb/;OMFES0Wx@PY^"Ka{6q2MB;oG|[ZO-_]u}&%^%#
send-time 12:00 2019-12-10 to 15:00 2019-12-10
#
key-id 2
algorithm hmac-sha-256
key-string cipher %^%#&Yq4=s*P:L<"8iG-|o1ZB*Qi0qCn%N{Y3a&Z-zuD%^%#
send-time 15:01 2019-12-10 to 18:00 2019-12-10
#
tcp ao huawei
binding keychain huawei
#
key-id 1
send-id 2 receive-id 1
key-id 2
send-id 4 receive-id 3
#
interface gigabitethernet1/0/0
ip address 192.168.1.2 255.255.255.0
#
bgp 1
router-id 2.2.2.2
peer 192.168.1.1 as-number 1
peer 192.168.1.1 tcp-ao policy huawei
#
ipv4-family unicast
peer 192.168.1.1 enable
#
return
Generally, upon receiving a packet, a router first obtains the destination IP address
of the packet and then searches the forwarding table for a route to the
destination address. If the router finds such a route, it forwards the packet;
otherwise, it discards the packet. A URPF-enabled router, however, obtains the
source IP address of a received packet and searches for a route to the source
address. If the router fails to find the route, it considers that the source address is
a forged one and discards the packet. In this manner, URPF can effectively protect
against malicious attacks that are launched by changing the source addresses of
packets.
DeviceA generates a packet with a pseudo source IP address 2.1.1.1 and sends the
packet to DeviceB. DeviceB sends a response packet to DeviceC whose IP address
actually is 2.1.1.1. In this manner, DeviceA attacks both DeviceB and DeviceC by
sending illegal packets.
URPF can be applied on the upstream inbound interfaces of the router, including
two application environments: single-homed client and multi-homed client.
● Single-homed client
Figure 1-20 shows the connection between the client and the aggregation
router of the ISP. Enable URPF on interface1 of the ISP router to protect the
router and Internet from source address spoofing attacks from the client
network.
● Multi-homed client
URPF can be applied in the case that multiple connections are set up between
the client and the ISP, as shown in Figure 1-21. For URPF, ensure that the
links between the client router and the ISP router that the packets from the
client to a host on the Internet and the packets from the host to the client
traverse are identical. That is, you need to ensure the route symmetry.
Otherwise, URPF discards certain normal packets because of interface
unmatching.
URPF can be applied in the case that a client is connected to multiple ISPs, as
shown in Figure 1-22. In this case, route symmetry has to be ensured.
URPF applied in the scenario where a client is connected to multiple ISPs has the
following features:
● If route symmetry cannot be ensured, you can use the loose check. That is,
URPF does not check the consistency of the interfaces and as along as a route
contains the source address of the packet, the packet can pass.
● The routers of multiple users may have only one default route to the router of
the ISP. Therefore, matching the default route entry needs to be supported.
● As the security system on the ingress, URPF is better than the conventional
firewall in performance.
Usage Scenario
To prevent source address spoofing attacks, you can configure URPF to check the
source address and inbound interface of packets. If the source address passes the
check, the packets are allowed to pass; otherwise, the source address is considered
forged and the packets are discarded.
Pre-configuration Tasks
Before configuring URPF, complete the following task:
● Configure link layer protocol parameters and IP addresses for interfaces and
ensure that the link layer protocol of each interface is up.
Procedure
Step 1 Run system-view
If loose is configured, URPF performs checks in loose mode. Specifically, the device
searches the forwarding information base (FIB) table for the outbound interface
according to the source IP address of a received packet. If the outbound interface
is found, the packet is forwarded; otherwise, the packet is discarded.
If strict is configured, URPF performs checks in strict mode. Specifically, the device
searches the FIB table for the slot ID, interface number, and VLAN ID (if the packet
is a VLAN packet) according to the source IP address of a received packet. It then
compares them with the slot ID and interface number of the packet's inbound
interface as well as the VLAN ID (if the packet is a VLAN packet) carried in the
packet. If they are the same, the device considers the packet to have passed the
URPF check and forwards it. Otherwise, the packet is discarded.
----End
Usage Scenario
To prevent network attacks based on source address spoofing, you need to
configure URPF and check whether the source address of the packets matches the
inbound interface. If the source IP address matches the inbound interface, the
source IP address is considered as legal and the packet is allowed to pass;
otherwise, the source IP address is considered as a pseudo one and the packet is
discarded.
If you need to prevent flows of certain types from starting source address spoofing
attacks, you need to configure flow-based URPF.
Pre-configuration Tasks
Before configuring flow-based URPF, complete the following task:
● Parameters of the link layer protocol and IP addresses have been configured
for the interfaces and the link layer protocol on the interfaces is Up.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run traffic classifier classifier-name [ operator { and | or } ]
A traffic classifier is defined and its view is displayed.
The traffic classifier specified by classifier-name cannot be a pre-defined one in
the system. You can directly use the pre-defined traffic classifiers when defining
traffic policies. For details about traffic classifiers, see HUAWEI NetEngine9000
Core Router Configuration Guide - QoS.
Step 3 Configure matching rules based on the actual networking.
● To define a matching rule to classify traffic based on the 802.1p priority in a
VLAN packet, run the if-match 8021p 8021p-value command.
● To define ACL rules, run the if-match [ ipv6 ] acl { acl-number | name acl-
name } command.
● To define rules for matching all packets, run the if-match [ ipv6 ] any
command.
● To define a matching rule to classify traffic based on the destination MAC
address of packets, run the if-match destination-mac mac-address
command.
● To define a matching rule to classify traffic based on the destination IPv6
address, run the if-match ipv6 destination-address ipv6-address prefix-
length command.
● To define a rule to match traffic with a specified DSCP value, run the if-
match [ ipv6 ] dscp dscp-value command.
● To define a matching rule to classify traffic based on the MPLS EXP value, run
the if-match mpls-exp exp-value command.
● To define a matching rule to classify traffic based on the IP precedence, run
the if-match ip-precedence ip-precedence command.
● To define a matching rule to classify traffic based on the source MAC address
of packets, run the if-match source-mac mac-address command.
● To define a matching rule to classify traffic based on the IPv4 TCP flag value,
run the if-match tcp syn-flag { tcpflag-value [ mask tcpflag-mask ] | bit-
match { established | fin | syn | rst | psh | ack | urg | ece | cwr | ns } }
command.
● To define a matching rule for MF classification based on the SYN Flag value in
the IPv6 TCP header, run the if-match ipv6 tcp syn-flag { tcpflag-value
[ mask tcpflag-mask ] | bit-match { established | fin | syn | rst | psh | ack |
urg } } command.
----End
Procedure
Step 1 Run system-view
URPF is enabled.
----End
Procedure
Step 1 Run system-view
policy-name defined by users cannot be the one pre-defined by the system. For
details on traffic policies, see HUAWEI NetEngine9000 Core Router Configuration
Guide - QoS.
Step 3 Run classifier classifier-name behavior behavior-name
The traffic behavior is specified for the specified traffic class in the traffic policy.
NOTE
Traffic of the same class cannot match two traffic behaviors at the same time.
----End
Procedure
Step 1 Run system-view
----End
Usage Scenario
To prevent source address spoofing attacks, you can configure peer-based URPF to
enable an interface to check the ID of the peer group bound to the interface and
match the IP address of the BGP peer in the peer group against the IP address of
the packet sender. If the IP addresses match, the interface considers the source IP
address valid and forwards the packet. Otherwise, the interface considers the
source IP address faked and discards the packet.
Prerequisites
Before configuring peer-based URPF, complete the following task:
● Configure data link layer protocol parameters and IP addresses for interfaces
to ensure that the data link layer protocol on each interface is Up.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run route-policy route-policy-name permit node node
A route-policy node is created, and the route-policy view is displayed.
Step 3 Run apply peer-id peerId
A BGP peer group ID is set.
Step 4 Run quit
Return to the system view.
Step 5 Run bgp as-number
The BGP view is displayed.
Step 6 Run ipv4-family unicast
The IPv4 unicast address family view is displayed.
Step 7 Run peer { group-name | ipv4-address | ipv6-address } route-policy route-policy-
name import
The route-policy is applied to the routes received from the specified peer or peer
group to control route acceptance.
Step 8 Run commit
The configuration is committed.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 3 Run ip urpf peer-based peer-id peer-id [ statistics enable ] or ipv6 urpf peer-
based peer-id peer-id [ statistics enable ]
----End
Procedure
Step 1 Run the reset ip urpf discard statistics interface { interface-type interface-
number | all } command to clear statistics on the packets that fail the URPF check
and are discarded on interfaces.
Step 2 Run the reset { ip | ipv6 } urpf discard statistics [ slot slot-id ] command to clear
the statistics on the packets that fail the URPF check and are discarded on an
interface board.
----End
Networking Requirements
This example describes how to enable URPF on the ISP ingress. As shown in
Figure 1-23, DeviceA is directly connected to the ISP's DeviceB. Enable URPF on
DeviceB's GE 1/0/0. Perform URPF check on the packets whose source address
matches ACL 2010. Enable URPF on DeviceA's GE 1/0/0, and enable default route
matching.
● The configurations in this example are performed on DeviceA and DeviceB. The HUAWEI
NetEngine9000 can function as DeviceA and DeviceB.
● interface1 in this example represents GE 1/0/0.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a traffic policy on the ISP router to allow traffic from a specified
network segment to pass the URPF check.
2. Configure an IP address for the interface on the client router and enable
URPF.
Data Preparation
To complete the configuration, you need the following data:
● IP address of each interface
● IP addresses in the network segment that passes the URPF check
Procedure
Step 1 Configure DeviceB to perform URPF check on the packets whose source address
matches ACL 2010.
# Configure ACL 2010.
<DeviceB> system-view
[~DeviceB] acl number 2010
[*DeviceB-acl-basic-2010] rule permit source 10.1.1.0 0.0.0.255
[*DeviceB-acl-basic-2010] commit
[~DeviceB-acl-basic-2010] quit
# Define a traffic policy to associate the traffic classifier with the traffic behavior.
[~DeviceB] traffic policy policy1
----End
Configuration Files
● DeviceA configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 172.19.139.1 255.255.255.252
ip urpf strict allow-default
#
return
● DeviceB configuration file
#
sysname DeviceB
#
acl number 2010
rule 5 permit source 10.1.1.0 0.0.0.255
#
traffic classifier classifier1 operator or
if-match acl 2010
#
traffic behavior behavior1
ip urpf strict
#
traffic policy policy1
classifier classifier1 behavior behavior1
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 172.19.139.2 255.255.255.252
traffic-policy policy1 inbound
#
return
The development and wide application of the network pose higher requirements
for the network and device security. On the network, there are a large number of
packets to be sent to the CPU and malicious packets attempting to attack the
CPU. If the CPU receives excessive packets, the CPU usage is high, lowering the
performance and affecting normal services; if the CPU is congested with malicious
packets, it becomes busy processing these attack packets. Consequently, other
services are interrupted. In extreme cases, the system fails.
You can protect the CPU of the NE9000 against attacks by configuring defense
against TCP/IP attacks, CAR, application layer association, management plane
protection, or attack source tracing.
Usage Scenario
When being attacked, the router enabled with attack source tracing can save
attack packets to its memory for attack analysis and defense. The attack source
tracing module checks whether packet loss occurs at an interval of 1 minute. If
packet loss is detected, the attack source tracing module records information
about the attack packets in the memory.
NOTE
When the size of packets in memory exceeds the upper limit of the storage file, the
previous packets are overridden when more packets are saved. Therefore, you are
recommended to run the save attack-source-trace slot command to save the data in
memory to the flash memory of the main control board. After being exported in SFTP
mode, the data can be exported.
Pre-configuration Tasks
Before configuring attack source tracing, configure the parameters of the link layer
protocol and IP addresses for interfaces and ensure that the link layer protocol on
the interfaces is Up.
Procedure
Step 1 Run system-view
----End
Follow-up Procedure
You must run the cpu-defend-policy command on the interface board to apply
the attack defense policy to the interface board. In this manner, the configured
attack defense policy can take effect.
Procedure
Step 1 Run system-view
Attack defense tracing is enabled for a certain local attack defense feature.
----End
Procedure
Step 1 Run system-view
An attack defense policy is created and the attack defense view is displayed.
The ratio for sampling the packet that records attack source tracing is set.
Step 4 Run save attack-source-trace slot { slot-id | all } [ file filename ] linktype
ethernet
----End
Context
The NE9000 defines a default attack defense policy. This policy cannot be
modified or deleted. When the NE9000 starts, this policy is automatically applied
to the interface board. Configurations in the policy are default configurations of
each feature. To apply a specified attack defense policy to the interface board, you
need to run the cpu-defend-policy policy-number command on the interface
board to bind the policy to be applied to the interface board. If the cpu-defend-
policy policy-number command is not used, the default attack defense policy is
applied to the interface board.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run slot slot-id
The slot view is displayed.
Step 3 Run cpu-defend-policy policy-number
The attack defense policy is applied to the interface board.
You must apply the attack defense policy to the interface board; otherwise, the
policy does not take effect.
The attack defense policy specified by policy-number must be a configured one.
Otherwise, the policy cannot be applied.
Step 4 Run commit
The configuration is committed.
----End
Procedure
Step 1 Run the following commands to view verbose information about attack source
tracing.
● display attack-source-trace slot { slot-id | all } verbose [ { attack-type
{ totalcar | car | application-apperceive | tcpip-defend | ma-defend } } |
{ source-mac source-mac source-mac-mask } | { destination-mac dest-mac
dest-mac-mask } | { vlan vlan-id } | { source source-ip source-ip-mask } |
----End
Context
To view the status of a device that drops too many packets, configure the alarm
function for packet discarding. When the alarm function is enabled, the router
checks the number of the packets dropped within a specified time period. If the
number of dropped packets reaches or exceeds the set alarm threshold, an alarm
is reported.
In VS mode, this feature is supported only by the admin VS.
Procedure
Step 1 Run system-view
The alarm for the discarding of the packets sent to the CPU is enabled.
The alarm threshold of discarding the packets to be sent to the CPU is set.
The configured alarm threshold and intervals still take effect after the undo alarm
drop-rate enable and then alarm drop-rate enable commands are used.
----End
Usage Scenario
When massive packets are to be sent to the CPU on the network, you can apply
URPF to check whether the source IP address is valid. Therefore, packets with
invalid source IP addresses are discarded. This prevents the source IP address
spoofing attacks and flood attacks.
The local URPF function is applied to the packets to be sent to the CPU only. In
this case, the CPU processes only normal packets and therefore its performance is
not affected.
Pre-configuration Tasks
Before configuring local URPF, configure parameters of the link layer protocol and
IP addresses for the interfaces and ensuring that the status of the link layer
protocol on the interfaces is Up.
Procedure
Step 1 Run system-view
----End
Follow-up Procedure
You must run the cpu-defend-policy command on the interface board to apply
the attack defense policy to the interface board. In this manner, the configured
attack defense policy can take effect.
Procedure
Step 1 Run system-view
----End
Context
The NE9000 defines a default attack defense policy. This policy cannot be
modified or deleted. When the NE9000 starts, this policy is automatically applied
to the interface board. Configurations in the policy are default configurations of
each feature. To apply a specified attack defense policy to the interface board, you
need to run the cpu-defend-policy policy-number command on the interface
board to bind the policy to be applied to the interface board. If the cpu-defend-
policy policy-number command is not used, the default attack defense policy is
applied to the interface board.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run slot slot-id
The slot view is displayed.
Step 3 Run cpu-defend-policy policy-number
The attack defense policy is applied to the interface board.
You must apply the attack defense policy to the interface board; otherwise, the
policy does not take effect.
The attack defense policy specified by policy-number must be a configured one.
Otherwise, the policy cannot be applied.
Step 4 Run commit
The configuration is committed.
----End
Procedure
Step 1 Run the display cpu-defend urpf statistics [ slot slot-id ] command to check the
checking information about local URPF.
----End
Usage Scenario
Defense against TCP/IP attacks is applied to the router on the edge of the network
or other routers that are easily to be attacked by illegal TCP/IP packets. Defense
against TCP/IP attacks can protect the CPU of the router against malformed
packets, fragmented packets, TCP SYN packets, and UDP packets, ensuring that
normal services can be processed.
Pre-configuration Tasks
Before configuring TCP/IP attack defense, configure the parameters of the link
layer protocol and IP addresses for interfaces and ensure that the link layer
protocol on the interfaces is Up.
Procedure
Step 1 Run system-view
----End
Follow-up Procedure
You must run the cpu-defend-policy command on the interface board to apply
the attack defense policy to the interface board. In this manner, the configured
attack defense policy can take effect.
Procedure
Step 1 Run system-view
Defense against IPv4 malformed packet attacks can defend against attacks of
various malformed packets, including IP packets with null load, null IGMP packets,
LAND attack packets, Smurf attack packets, and packets with invalid TCP flag bits.
Defense against IPv6 malformed packet attacks can defend against attacks of
various malformed packets, including LAND attack packets, and packets with
invalid TCP flag bits.
----End
Procedure
Step 1 Run system-view
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run cpu-defend policy policy-number
The attack defense policy view is displayed.
Step 3 Perform either of the following operations as required:
● Run the tcpsyn-flood enable command to enable defense against IPv4 TCP
SYN flooding attacks.
● Run the ipv6-tcpsyn-flood enable command to enable defense against IPv6
TCP SYN flooding attacks.
The TCP SYN flooding attack is a denial-of-service attack in which an attacker
sends a flood of TCP SYN packets to the target host, causing the target host to
become too busy to answer legitimate requests. In extreme cases, the target host
is suspended.
Step 4 Run commit
The configuration is committed.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run cpu-defend policy policy-number
The attack defense policy view is displayed.
Step 3 Perform either of the following operations as required:
● Run the udp-packet-defend enable command to enable defense against IPv4
UDP packet attacks.
● Run the ipv6-udp-packet-defend enable command to enable defense
against IPv6 UDP packet attacks.
Defense against UDP packet attacks protects the router against Fraggle attacks
and UDP diagnosis port attacks. UDP packets with the destination port number
----End
Context
The NE9000 defines a default attack defense policy. This policy cannot be
modified or deleted. When the NE9000 starts, this policy is automatically applied
to the interface board. Configurations in the policy are default configurations of
each feature. To apply a specified attack defense policy to the interface board, you
need to run the cpu-defend-policy policy-number command on the interface
board to bind the policy to be applied to the interface board. If the cpu-defend-
policy policy-number command is not used, the default attack defense policy is
applied to the interface board.
Procedure
Step 1 Run system-view
You must apply the attack defense policy to the interface board; otherwise, the
policy does not take effect.
----End
Procedure
Step 1 Run the display cpu-defend tcpip-defend statistics [ slot slot-id ] [ ap-id ap-id ]
command to view information about defense against TCP/IP attacks.
Step 2 Run the display cpu-defend tcpip-defend-v6 statistics [ slot slot-id ] [ ap-id ap-
id ] command to view information about defense against TCP/IPv6 attacks.
----End
Usage Scenario
Invalid ND packet attack defense is implemented by filtering out six types of
invalid ND packets (NS/NA/RS/RA/Redirect/CPS) to protect the CPU.
In VS mode, this feature is supported only by the admin VS.
Prerequisites
None
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run set nd packet filter enable
Invalid ND packet attack defense is enabled.
Step 3 Run commit
The configuration is committed.
----End
Usage Scenario
When a large number of users access the router, a lot of packets need be sent to
the CPU for processing. In such a case, the router is prone to be attacked. To
protect the router from being attacked, you need to configure the CAR on the
router.
Pre-configuration Tasks
Before configuring the CAR, connect interfaces and set the physical parameters of
the interfaces and ensure that their physical layer status is Up.
Procedure
Step 1 Run system-view
----End
Follow-up Procedure
You must run the cpu-defend-policy command on the interface board to apply
the attack defense policy to the interface board. In this manner, the configured
attack defense policy can take effect.
Prerequisites
The ACL bound to the whitelist must be a configured one. You cannot bind a non-
existing ACL to the whitelist. When the ACL is bound to the whitelist, all the
packets that match the ACL rules are added to the whitelist automatically. The
whitelist function must be enabled. Otherwise, the self-defined whitelist does not
take effect although you can configure a self-defined whitelist.
NOTE
In router, the whitelist is needed to configure for monitored network elements to ensure its
service smooth running.
Procedure
Step 1 Run system-view
The packets generated by Active Link Protection (ALP) is dynamically added to the
whitelist.
A self-defined whitelist can be bound to only one ACL. If you bind a self-defined
whitelist to several ACLs, only the latest configuration takes effect. An address or
port pool can be specified in an ACL rule, and the ACL rule can be delivered.
NOTE
● The address pool function can be delivered in the attack defense policy only when the
cp-acl ip-pool enable command is configured.
● By default, the IPv6 address pool function is disabled in an attack defense policy. If this
function is disabled, the device can only deliver source address pool rules of the BGP
IPv6 peer type based on a whitelist. To enable the device to support other types of IPv6
address pool rules, run the cp-acl ipv6-pool enable command.
● The vpn-instance field in an ACL configured in an attack defense policy can be
delivered and takes effect only when the cp-acl vpn-instance enable command is
configured.
● The ports in the port pool specified in a delivered ACL take effect based on the
configuration order instead of the lexicographical order.
● If the ACL rule in which both a port pool and a TTL range are specified is delivered, the
TTL range does not take effect.
● ACL rules with the neq parameter are not supported.
● If the address pool function is not enabled, the ACL rule in which both address and port
pools are specified cannot be delivered.
Some IPv6 packets to be sent to the CPU are matched against the ACL that
contains a blacklist, whitelist, or user-defined flow.
NOTE
Before enabling the address pool function for an attack defense policy, configure an address
pool and bind the address pool to an ACL rule.
NOTE
Before enabling the address pool function for an attack defense policy, configure an address
pool and bind the address pool to an ACL rule.
----End
Prerequisites
The ACL bound to the blacklist must be a configured one. You can bind a non-
existing ACL to the blacklist. When the ACL is bound to the blacklist, all the
packets that match the ACL rules are added to the blacklist automatically. The
blacklist function must be enabled. Otherwise, the self-defined blacklist does not
take effect although you can configure a self-defined blacklist.
Context
If you determine that certain packets cannot be sent to the CPU or are invalid, you
can add them to the blacklist by setting ACL rules. In this manner, you can discard
these packets. All the users in the blacklist need to be manually configured. There
is no default user in the blacklist.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run cpu-defend policy policy-number
The attack defense policy view is displayed.
A self-define blacklist can be bound to only one ACL. If you bind a self-define
blacklist to several ACLs, only the latest configuration takes effect. An address or
port pool can be specified in an ACL rule, and the ACL rule can be delivered.
NOTE
● The address pool function can be delivered in the attack defense policy only when the
cp-acl ip-pool enable command is configured.
● By default, the IPv6 address pool function is disabled in an attack defense policy. If this
function is disabled, the device can only deliver source address pool rules of the BGP
IPv6 peer type based on a blacklist. To enable the device to support other types of IPv6
address pool rules, run the cp-acl ipv6-pool enable command.
● The vpn-instance field in an ACL configured in an attack defense policy can be
delivered and takes effect only when the cp-acl vpn-instance enable command is
configured.
● The ports in the port pool specified in a delivered ACL take effect based on the
configuration order instead of the lexicographical order.
● If the ACL rule in which both a port pool and a TTL range are specified is delivered, the
TTL range does not take effect.
● ACL rules with the neq parameter are not supported.
● If the address pool function is not enabled, the ACL rule in which both address and port
pools are specified cannot be delivered.
Some IPv6 packets to be sent to the CPU are matched against the ACL that
contains a blacklist, whitelist, or user-defined flow.
NOTE
Before enabling the address pool function for an attack defense policy, configure an address
pool and bind the address pool to an ACL rule.
NOTE
Before enabling the address pool function for an attack defense policy, configure an address
pool and bind the address pool to an ACL rule.
The VPN field in the attack defense policy is configured to take effect.
Enable IPv4 MFIB-MISS packets to match against ACLs in the blacklist, whitelist, or
user-defined flow.
Step 10 (Optional) Run acl dhcp-discover enable
Enable DHCP-DISCOVER packets to match against ACLs in the blacklist, whitelist,
or user-defined flow.
Step 11 Run commit
The configuration is committed.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run cpu-defend policy policy-number
The attack defense policy view is displayed.
Step 3 Run user-defined-flow flow-id acl { acl-number | name acl-name } [ prior ] Or
Run user-defined-flow flow-id ipv6 acl { acl-number | name acl-name }
A user-defined flow is configured. An address or port pool can be specified in an
ACL rule, and the ACL rule can be delivered.
NOTE
● The address pool function can be delivered in the attack defense policy only when the
cp-acl ip-pool enable command is configured.
● By default, the IPv6 address pool function is disabled in an attack defense policy. If this
function is disabled, the device can only deliver source address pool rules of the BGP
IPv6 peer type based on the user-defined flow. To enable the device to support other
types of IPv6 address pool rules, run the cp-acl ipv6-pool enable command.
● The vpn-instance field in an ACL configured in an attack defense policy can be
delivered and takes effect only when the cp-acl vpn-instance enable command is
configured.
● The ports in the port pool specified in a delivered ACL take effect based on the
configuration order instead of the lexicographical order.
● If the ACL rule in which both a port pool and a TTL range are specified is delivered, the
TTL range does not take effect.
● ACL rules with the neq parameter are not supported.
● If the address pool function is not enabled, the ACL rule in which both address and port
pools are specified cannot be delivered.
NOTE
Before enabling the address pool function for an attack defense policy, configure an address
pool and bind the address pool to an ACL rule.
NOTE
Before enabling the address pool function for an attack defense policy, configure an address
pool and bind the address pool to an ACL rule.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run cpu-defend policy policy-number
The attack defense policy view is displayed.
Step 3 Run process-sequence { fragment-flood | tcpsyn-flood | dynamic-link-
protection | whitelist | blacklist | user-defined-flow | management-acl }
&<7-7> or process-sequence { blacklist whitelist user-defined-flow | blacklist
The matching sequence of packets to be sent to the CPU is set: TCPSYN packets,
packet fragments, dynamic link protection, management protocol ACL, whitelist,
blacklist, and user-defined flow.
NOTE
The parameters in the command are mandatory. You can specify them as required.
----End
Procedure
Step 1 Run system-view
Step 3 Run car { protocol-name | index index | whitelist [ bgp | ldp | ospf | radius | rsvp
| isis ] | whitelist-v6 [ bgpv6 | ospfv3 ] | blacklist | tcpsyn | fragment | user-
defined-flow flow-id } { cir cir-value | cbs cbs-value | min-packet-length min-
packet-length-value } *
----End
Procedure
Step 1 Run system-view
----End
1.1.11.8.8 Setting Bandwidth Values and Weights for the Protocol Group Whose
Packets Are to Be Sent to the CPU
You can specify the CIR, and weight for a protocol group of packets to be sent to
the CPU according to the actual networking requirements. With the configuration,
if the queues of packets to be sent to the CPU are full, the packets of the specified
protocol group can be processed by the CPU in time.
Procedure
Step 1 Run system-view
The bandwidth and weight are set for a specified protocol group.
Step 4 Set a weight for packets in a specified protocol queue of a protocol group.
Operation Command
Operation Command
Operation Command
Table 1-18 Setting weights for packets of specified priority values in protocol
queues
Operation Command
Operation Command
Context
The NE9000 defines a default attack defense policy. This policy cannot be
modified or deleted. When the NE9000 starts, this policy is automatically applied
to the interface board. Configurations in the policy are default configurations of
each feature. To apply a specified attack defense policy to the interface board, you
need to run the cpu-defend-policy policy-number command on the interface
board to bind the policy to be applied to the interface board. If the cpu-defend-
policy policy-number command is not used, the default attack defense policy is
applied to the interface board.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run slot slot-id
The slot view is displayed.
Step 3 Run cpu-defend-policy policy-number
The attack defense policy is applied to the interface board.
You must apply the attack defense policy to the interface board; otherwise, the
policy does not take effect.
The attack defense policy specified by policy-number must be a configured one.
Otherwise, the policy cannot be applied.
Step 4 Run commit
The configuration is committed.
----End
Procedure
Step 1 Run the display cpu-defend policy policy-number command to check rules for
filtering the packets to be sent to the CPU.
Step 2 Run the display cpu-defend { all | application-apperceive | tcpip-defend | tcpip-
defend-v6 | total-packet | urpf } statistics [ slot slot-id ] [ ap-id ap-id ]
command to check statistics about packets discarded by CAR.
Step 3 Run the display cpu-defend protocol-group { whitelist | user-defined-flow |
management | route-protocol | multicast | arp | mpls | access-user | link-layer |
Table 1-19 Displaying the weights of packets to be sent to the CPU in protocol
queues of the protocol groups
Operation Command
Operation Command
----End
Usage Scenario
When an access device is under attack, you can configure port+VLAN-based CAR
to restrict the rate at which packets are sent to the CPU to protect the CPU
against attacks.
Prerequisites
None
Procedure
Step 1 Run the system-view command to enter the system view.
Step 2 Run the interface interface-type interface-number command to enter the
interface view.
Step 3 Perform one of the following operations as required:
● On an Ethernet interface, Ethernet sub-interface, GE interface, GE sub-
interface, Eth-Trunk interface, or Eth-Trunk sub-interface, POS interface, IP-
Trunk interface, and EVC sub-interface on which packets are encapsulated in
untag or default mode, run the cp-rate-limit { port | { dhcp | dhcpv6 | icmp |
icmpv6 | ldp-hello | rsvp | ospf | rip | pim | isis | vrrp | ospfv3 | ripng | pimv6
| vrrpv6 }* } cir cir-value [ cbs cbs-value ] [ prior ] command to set the rate at
which ICMP/DHCP/DHCPv6/ICMPv6/LDP-HELLO/RSVP/OSPF/RIP/PIM/ISIS/
VRRP/OSPFv3/RIPNG/PIMv6/VRRPv6 packets are sent to the CPU.
● On a sub-interface for dot1q VLAN tag termination, and EVC sub-interface on
which packets are encapsulated in dot1q, untag or default mode, run the cp-
rate-limit { port | { dhcp | dhcpv6 | icmp | icmpv6 | ldp-hello | rsvp | ospf |
rip | pim | isis | vrrp | ospfv3 | ripng | pimv6 | vrrpv6 } } vlan vlan-id-begin
[to vlan-id-end ] cir cir-value [ cbs cbs-value [ prior ] ] command to set the
rate at which ICMP/DHCP/DHCPv6/ICMPv6/LDP-HELLO/RSVP/OSPF/RIP/PIM/
ISIS/VRRP/OSPFv3/RIPNG/PIMv6/VRRPv6 packets are sent to the CPU.
● On a sub-interface for QinQ VLAN tag termination, and EVC sub-interface on
which packets are encapsulated in QinQ, untag or default mode, run the cp-
rate-limit { port | { dhcp | dhcpv6 | icmp | icmpv6 | ldp-hello | rsvp | ospf |
rip | pim | isis | vrrp | ospfv3 | ripng | pimv6 | vrrpv6 } } pe-vid pe-vid ce-vid
ce-vid-begin [ to ce-vid-end ] cir-value [ cbs cbs-value ] [ prior ] command to
set the rate at which ICMP/DHCP/DHCPv6/ICMPv6/LDP-HELLO/RSVP/
OSPF/RIP/PIM/ISIS/VRRP/OSPFv3/RIPNG/PIMv6/VRRPv6 packets are sent to
the CPU.
----End
and services. After the alarm function is enabled for ND VLAN CAR and the
number of ND packets to be sent to the CPU exceeds the threshold configured for
ND VLAN CAR, an alarm is reported.
Context
Configure ND VLAN CAR on interfaces of the router.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run slot slot-id
The slot view is displayed.
Step 3 Run undo alarm ipv6 nd { na | ns-multicast | ns-unicast } attack disable
The alarm function is enabled for ND VLAN CAR.
In VS mode, this feature is supported only by the admin VS.
Step 4 Run quit
Return to the system view.
Step 5 Run interface interface-type interface-number
The interface view is displayed.
Step 6 Run ipv6 nd { na | ns-multicast | ns-unicast } rate-limit rate
The rate limit of ND VLAN CAR for ND packets on an interface is configured.
Step 7 Run quit
Return to the system view.
Step 8 (Optional)
1. Run slot slot-id
The slot view is displayed.
2. Run ipv6 nd { na | ns-multicast | ns-unicast } rate-limit-percent rate-value
The percentage of the bandwidth of level-2 CAR for ND VLAN CAR in the
bandwidth of CP-CAR for ND protocol packets is configured.
In VS mode, this feature is supported only by the admin VS.
3. Run quit
Return to the system view.
----End
Usage Scenario
When an access device is under attack, to protect the CPU against attacks,
configure interface-based CAR to restrict the rate at which all or specific protocol
packets are sent to the CPU.
Prerequisites
None
Procedure
Step 1 Run system-view
Step 3 Run cp-rate-limit enhance { port | { dhcp | dhcpv6 | icmp | icmpv6 } } cir cir-
value [ cbs cbs-value ]
The rate at which all or specific protocol packets are sent to the CPU is restricted.
----End
Usage Scenario
As various network protocol packets exist on a network, protocol packets that
require sessions to be established, such as BGP, IS-IS, and FTP protocol packets,
need sufficient bandwidth for session establishment. In the case of insufficient
bandwidth, packets used to establish sessions are dropped, causing the protocol
sessions not to be established. When the dynamic link protection function is
enabled, after a protocol session is established, sufficient bandwidth can be
allocated to ensure uninterrupted protocol sessions.
In VS mode, this feature is supported only by the admin VS.
Prerequisites
None
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run cpu-defend policy policy-number
The attack defense policy view is displayed.
Step 3 Run undo dynamic-link-protection disable
The dynamic link protection function is enabled.
Step 4 Run commit
The configuration is committed.
----End
Usage Scenario
When there is no need to filter out invalid management protocol packets to be
sent to the CPU using hardware, run the management-acl disable command to
disable the management protocol ACL delivering function. The management-acl
disable command takes effect for FTP, Telnet, SSH, and SNMP. For example, if an
FTP ACL is configured and the management-acl disable command is run, the FTP
ACL does not take effect.
Prerequisites
None
Procedure
Step 1 Run system-view
----End
Usage Scenario
A device drops ICMP echo request packets that carry broadcast addresses
(including subnet broadcast and network broadcast addresses) as destination IP
addresses by default. When the device is required to normally process broadcast
ICMP echo request packets, run the icmp-broadcast-address-echo enable
command to enable the device to receive broadcast ICMP echo request packets.
Prerequisites
None
Procedure
Step 1 Run system-view
----End
Usage Scenario
There are various application protocols on the router, but not all of them are used
in actual networking. To save CPU resources and defend against attacks,
unnecessary application protocol packets are not sent to the CPU for processing.
To save router resources, you can configure application layer association to have
only packets of the enabled protocol be sent to the CPU for processing. The
packets of the disabled protocol are sent to the CPU at a minimum bandwidth by
default.
When application layer association and protocols are enabled, packets are sent to
the CPU at the default bandwidth; when application layer association is enabled
but protocols are disabled, packets are sent to the CPU at a minimum bandwidth
or simply dropped. When application layer association is disabled, protocols are
not associated. In this case, packets are sent to the CPU at the default bandwidth
regardless of whether the protocols are enabled.
Pre-configuration Tasks
Before configuring application layer association, configure parameters of the link
layer protocol and IP addresses for interfaces and ensure that the link layer
protocol on the interfaces is Up.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run cpu-defend policy policy-number
An attack defense policy is created.
Step 3 (Optional) Run description text
The description of the attack defense policy is configured.
Step 4 Run commit
The configuration is committed.
----End
Follow-up Procedure
You must run the cpu-defend-policy command on the interface board to apply
the attack defense policy to the interface board. In this manner, the configured
attack defense policy can take effect.
1.1.11.15.2 Setting the Mode of Processing the Packets Sent to the CPU
This section describes the default mode of handling protocol packets when
association between the application layer and lower layers is enabled whereas no
upper layer protocol is enabled.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run cpu-defend policy policy-number
An attack defense policy is created and the attack defense policy view is displayed.
Step 3 (Optional) Run undo application-apperceive disable
The application layer association is enabled.
To disable application layer association, you need to run the application-
apperceive disable command.
Step 4 Run application-apperceive default-action { drop | min-to-cp }
The default mode of processing the packets to be sent to the CPU through
application layer association is set. The default mode can be drop or min-to-cp.
The advantage of the min-to-cp mode is that when a certain protocol for
application layer association is disabled because of attack, you can gather
information about the attack through attack source tracing. If the default mode is
set to drop, the possibility of being attacked is reduced, but the attack source may
be untraceable. You can select either mode as required.
----End
Context
The NE9000 defines a default attack defense policy. This policy cannot be
modified or deleted. When the NE9000 starts, this policy is automatically applied
to the interface board. Configurations in the policy are default configurations of
each feature. To apply a specified attack defense policy to the interface board, you
need to run the cpu-defend-policy policy-number command on the interface
board to bind the policy to be applied to the interface board. If the cpu-defend-
policy policy-number command is not used, the default attack defense policy is
applied to the interface board.
Procedure
Step 1 Run system-view
You must apply the attack defense policy to the interface board; otherwise, the
policy does not take effect.
----End
Procedure
Step 1 Run the display application-apperceive [ slot slot-id ] [ ap-id ap-id ] command
to view information about application layer association.
----End
Applicable Environment
NOTE
NOTE
FTP, SSH, SNMP, TELNET, and TFTP are usually disabled globally on a device but enabled on
some specified interfaces. If the interfaces enabled with these protocols are all Down, the
global configurations will cease to take effect (that is, these protocols will be automatically
enabled on other interfaces), which ensures connectivity to the device.
NOTE
Pre-configuration Tasks
Before configuring management and service plane protection, complete the
following task:
● Configuring link layer protocol parameters for interfaces to ensure that the
link layer protocol on the interfaces is Up
Context
Perform the following steps on the device.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ma-defend global-policy
A global policy for management and service plane protection is created.
Step 3 Run protocol { { bgp | ftp | isis | ldp | ospf | pimsm | rip | rsvp | snmp | ssh |
telnet | tftp } | ipv6 { bgp4plus | ftp | ospfv3 | ssh | telnet | pimsm } } { permit |
deny }
A rule about whether to send the packets of specified protocols to the CPU is
configured in the global policy.
NOTE
If FTP, SSH, SNMP, TFTP, or TELNET is disabled globally by running the protocol command
and is not enabled on any active interface, connectivity to the device will be interrupted.
(An active interface is an interface that can properly receive and send packets.)
To ensure connectivity to the device, configure additional active interfaces and enable these
protocols on them.
----End
Context
An interface board-based policy takes effect only on the specified interface board.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ma-defend slot-policy slot-policy-id
An interface board-based policy for management and service plane protection is
created.
Step 3 Run protocol { { bgp | ftp | isis | ldp | ospf | pimsm | rip | rsvp | snmp | ssh |
telnet | tftp } | ipv6 { bgp4plus | ftp | ospfv3 | ssh | telnet | pimsm } } { permit |
deny }
The rule about whether to send the packets of specified protocols to the CPU is
configured in the interface board-based policy.
NOTE
If FTP, SSH, SNMP, TFTP, or TELNET is disabled globally by running the protocol command
and is not enabled on any active interface, connectivity to the device will be interrupted.
(An active interface is an interface that can properly receive and send packets.)
To ensure connectivity to the device, configure additional active interfaces and enable these
protocols on them.
----End
Context
An interface-based policy takes effect only on the specified interface.
Procedure
Step 1 Run system-view
Step 3 Run protocol { { bgp | ftp | isis | ldp | ospf | pimsm | rip | rsvp | snmp | ssh |
telnet | tftp } | ipv6 { bgp4plus | ftp | ospfv3 | ssh | telnet | pimsm } } { permit |
deny }
A rule about whether to send the packets of specified protocols to the CPU is
configured in the interface-based policy.
NOTE
If all the active interfaces enabled with FTP, SSH, SNMP, TFTP, or TELNET are Down, connectivity
to the device will be interrupted. (An active interface is an interface that can properly receive
and send packets.) To ensure connectivity to the device, configure additional active interfaces
and enable these protocols on them.
----End
Procedure
● Run the display ma-defend { all | global-policy | interface-policy interface-
policy-id | slot-policy slot-policy-id } command to check information about
policies for management and service plane protection.
----End
Usage Scenario
Networks are prone to loops, and loops may occur due to various reasons, such as
incorrect link connection and loop prevention protocol failure on an attacked or
overloaded ring network. When a Layer 2 loop occurs on an interface, the
interface will receive a large number of broadcast and multicast packets, such as
Address Resolution Protocol (ARP) packets and Open Shortest Path First (OSPF)
packets.
To minimize service loss caused by Layer 2 loops, configure actions in response to
an existing or potential Layer 2 loop. This function allows protocols to work
normally and prevents major network faults.
The CPU determines whether to enable or disable Layer 2 loop detection based on
packet loss caused by the committed access rate (CAR). After Layer 2 loop
detection is enabled, the CPU will take the configured responsive action after
detecting an existing or a potential loop on an interface.
In VS mode, this feature is supported only by the admin VS.
Pre-configuration Tasks
None
Context
The system can be configured to take one of the following actions in response to
an existing or possible Layer 2 loop on an interface:
● Shut down the interface: The system will shut down the interface only after
detecting an existing Layer 2 loop on the interface. This action stops the
interface from sending numerous packets to the CPU.
● Send a trap: The system will send a trap after detecting an existing or a
potential Layer 2 loop. The trap message can help a user locate the interface
where the Layer 2 loop has occurred or may occur.
● Send a trap and shut down the interface: The system will send a trap and shut
down the interface after detecting an existing Layer 2 loop on the interface.
● Ignore Layer 2 loops: The system will stop Layer 2 loop, but not shut down
the interface or send a trap.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run slot slot-id
The slot view is displayed.
Step 3 Run l2-loop-detect action { shutdown [ up-times up-times | up-interval up-
interval ] * | trap disable }
A responsive action for Layer 2 loops is configured.
NOTE
● To enable the system to shut down the interface, run the l2-loop-detect action
shutdown [ up-times up-times | up-interval up-interval ] * command.
● By default, the function of sending a trap is enabled. If the function is disabled, running
the undo l2-loop-detect action trap disable command will enable it.
● To enable the system to send a trap and shut down the interface, run the undo l2-loop-
detect action trap disable command to enable the function of sending a trap, and run
the l2-loop-detect action shutdown [ up-times up-times | up-interval up-interval ] *
command to enable the system to shut down the interface.
● To configure the system to ignore Layer 2 loops, run the undo l2-loop-detect action
shutdown and l2-loop-detect action trap disable commands to disable the function of
shutting down the interface and the function of sending a trap, respectively.
----End
Context
NOTICE
If you need to disable Layer 2 loop detection, contact Huawei technical support
engineers.
Procedure
Step 1 Run system-view
----End
Context
The system calculates the default Layer 2 loop detection threshold based on the
packet loss detection and default algorithm. If the Layer 2 loop detection
threshold is not properly set, Layer 2 loop detection may not be enabled or be
unexpectedly enabled. To resolve this problem, perform the following operations
to modify the Layer 2 loop detection threshold:
NOTICE
It is recommended that you run this command with assistance from Huawei
engineers. Before performing the operation, obtain experience values of packet
loss statistics on the specified board.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run slot slot-id
The slot view is displayed.
Step 3 Run l2-loop-detect packets-drop-threshold packets-drop-threshold
The Layer 2 loop detection threshold is configured.
Step 4 (Optional) Run l2-loop-detect loop-level-threshold main-interface determined
determined-threshold suspect suspect-threshold notification notification-
threshold
The loop level threshold is configured on a detected main interface.
Step 5 (Optional) Run l2-loop-detect loop-level-threshold sub-interface determined
determined-threshold suspect suspect-threshold notification notification-
threshold
The loop level threshold is configured on a detected sub-interface.
The loop level threshold on a main interface must be greater than that on a sub-
interface. If the loop level threshold on a main interface is smaller than that on a
sub-interface and a loop occurs on the sub-interface, the system considers that
the loop occurs on the main interface, and detection on the sub-interface does not
take effect.
Step 6 Run commit
The configuration is committed.
----End
Procedure
Step 1 Run the display l2-loop-detect status-info slot slot-id command to check
information about Layer 2 loop detection on a specified board.
Step 2 Run the display l2-loop-detect packets-info slot slot-id command to check
information about packets that cause Layer 2 loops on a specified board.
----End
Usage Scenario
The Layer 3 loop detection function detects whether a loop exists on a network. If
a routing loop is detected, the device generates reports a trap.
NOTE
To ensure network reliability, exercise caution when running the l3-loop-detect disable
command.
Procedure
Step 1 Run system-view
----End
Context
NOTICE
Attack defense statistics cannot be restored after being cleared. Therefore, exercise
caution when running the following reset anti-attack statistics commands.
Procedure
Step 1 To clear attack defense statistics, run the reset cpu-defend { all | application-
apperceive | tcpip-defend | tcpip-defend-v6 | total-packet | urpf } statistics
[ slot slot-id ] [ ap-id ap-id ] command in the user view.
Step 2 To clear information about attack source tracing stored in the memory of the
interface board, run the reset attack-source-trace slot { slot-id | all }command in
the user view.
Step 3 To clear statistics about packets of a specified protocol group or all protocol
groups, run the reset cpu-defend protocol-group { whitelist | user-defined-flow
| management | route-protocol | multicast | arp | mpls | access-user | link-layer
| network-layer | all } statistics slot slot-id ap-id ap-id or reset cpu-defend
protocol-group { whitelist | user-defined-flow | management | route-protocol |
multicast | arp | mpls | access-user | link-layer | network-layer | system-
message | blacklist | check-failed | fwddata-to-cp | all } statistics slot slot-id
command in the user view.
Step 4 To clear statistics about ND invalid packet attack defense, run the reset nd packet
filter statistics [ slot slot-id ] command in the user view.
Step 5 To clear ND attack statistics, run the reset ipv6 nd { na | ns-multicast | ns-
unicast } attack interface { interface-type interface-num | interface-name } or
reset ipv6 nd { na | ns-multicast | ns-unicast } attack slot { slotid | all }
command in the user view.
----End
Networking Requirements
As shown in Figure 1-24, Device A always receives excessive packets and thus the
volume of the traffic sent to Device A must be restricted.
● The configurations in this example are performed on Device A, Device B, and Device C
can function as Device A, Device B, and Device C.
● Interfaces 1 and 2 in this example represent GE 1/0/0 and GE 2/0/0, respectively.
Configuration Notes
These functions, however, are disabled in this configuration example.
Configuration Roadmap
The configuration roadmap is as follows:
1. On Device A, define a blacklist and limit the rate of sending packets to the
CPU by setting the CAR.
2. On Device B, configure TCP/IP attack defense, application layer association,
and attack source tracing.
3. On Device C, configure management plane protection.
Recommended Configuration
● Collect and classify protocols on the device. The system matches traffic to be
sent to the CPU in sequence and checks the TCP/IP attack packets first. If the
packets match the blacklist, the system discards the packets.
● Add valid protocol packets and the service packet that needs protection to the
whitelist or user-define flow.
● Add the attack, invalid or unknown packets to the blacklist. Minimize the
bandwidth for them or directly drop them.
Data Preparation
To complete the configuration, you need the following data:
● Number of the attack defense policy
● Index of the packet to be sent to the CPU, number of the user-defined flow
● CIR and CBS values of the packet to be sent
● Sampling rate and file name for saving information about attack source
tracing
● Slot number of the interface board where board-level management plane
protection is to be applied
● Type and number of the interface where interface-level management plane
protection is to be applied
● Number of the interface board to which the attack defense policy is to be
applied
Procedure
Step 1 Configure an IP address for each interface. The configuration details are not
mentioned here.
Step 2 Configure the sending rule for the blacklist on Device A.
<DeviceA> system-view
[~DeviceA] acl 2001
[*DeviceA-acl4-basic-2001] rule deny fragment-type fragment
[*DeviceA-acl4-basic-2001] commit
[~DeviceA-acl4-basic-2001] quit
[~DeviceA] cpu-defend policy 4
[*DeviceA-cpu-defend-policy-4] blacklist acl 2001
[*DeviceA-cpu-defend-policy-4] car blacklist cir 1000
[*DeviceA-cpu-defend-policy-4] priority blacklist low
[*DeviceA-cpu-defend-policy-4] car total-packet 5000
[*DeviceA-cpu-defend-policy-4] alarm drop-rate blacklist enable
[*DeviceA-cpu-defend-policy-4] alarm drop-rate blacklist interval 60 threshold 1000
[*DeviceA-cpu-defend-policy-4] commit
Step 3 On Device B, configure the functions such as TCP/IP attack defense and
application layer association to defend against attack packets.
# Configure attack source tracing.
<DeviceB> system-view
[~DeviceB] cpu-defend policy 4
[*DeviceB-cpu-defend-policy-4] attack-source-trace enable
[*DeviceB-cpu-defend-policy-4] attack-source-trace sample-rate 1000
----End
Multicast PIM Medi Add PIM, IGMP, and Use ACL 3335 to
protocol um MSDP packets to filter PIM, IGMP, and
IGMP user-defined list 6. MSDP packets.
MSDP Set the rate limit for
user-defined list 6 to
1 Mbit/s.
NOTICE
This document just introduces a configuration example. The solution and data of
your actual network conditions, such as the running protocols, the IP addresses of
the protocols, may be different from this example. Please check and keep them
consistent with your network.
If your network needs more configurations, such as more BGP peer, OSPF peer,
modify or add the rules in the relative ACL.
If there are new trusted network segments, add them to ACL 3330. For example,
if the network maintenance engineer needs to telnet to the device to
troubleshoot, the source IP address needs to be added to this ACL. It is allowed
to temporally add rule permit ip instead for an urgency case. Delete the
temporal command after the troubleshooting finished.
acl number 3330
rule permit ip source 10.1.1.0 0.0.0.255
...
rule permit ip
TCP session in BGP is established based on peer IP addresses. Therefore, add the
peer IP address to the ACL. The peer IP address can be obtained from the
following commands:
<HUAWEI> display bgp peer
BGP local router ID : 1.1.1.33
Local AS number : 100
Total number of peers : 1 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
10.1.1.31 4 100 3 3 0 00:01:16 Established 0
10.1.1.32 4 100 3 3 0 00:05:20 Established 0
In the preceding information, the device has two BGP peers and the IP addresses
of the BGP peers are 10.1.1.31 and 10.1.1.32. So the ACL rule is configured as
follows.
Precise configuration based on source IP address and port number:
acl number 3331
rule permit tcp source 10.1.1.31 0 destination-port eq bgp
rule permit tcp source 10.1.1.31 0 source-port eq bgp
rule permit tcp source 10.1.1.32 0 destination-port eq bgp
rule permit tcp source 10.1.1.32 0 source-port eq bgp
LDP protocol uses TCP to set up session and UDP to discover peers and maintain
peer relationships. This process involves not only the peer IP address, but also
the IP address of the directly connected interface. These IP addresses need to be
added to ACL.
1. Collect the transport address of LDP Peer.
<HUAWEI> display mpls ldp peer
LDP Peer Information in Public network
A '*' before a peer means the peer is being deleted.
--------------------------------------------------------------------
PeerID TransportAddress DiscoverySource
--------------------------------------------------------------------
10.5.5.9:0 10.5.5.9 Remote Peer : 54
GigabitEthernet1/0/0
---------------------------------------------------------------------
Get the UDP source IP addresses used to discover adjacency peers and
maintain peer relationships.
<HUAWEI> display mpls ldp adjacency peer 5.5.5.9 verbose
LDP Adjacency Information
---------------------------------------------------------------------
LDP Peer ID : 10.5.5.9
VPNInstance name : -
CreateDate : 2010-09-14
CreateTime : 09:19:02
Adjacency Age : 0000:01:24
AdjacencyType : Remote Adjacency
Discovery-Source : -
UDP Source Address : 10.5.5.9
UDP Socket ID : 216
Sequence No. : 0
Configuration Hello Hold Timer(sec) : 45
Hello Message Rcvd : 340
Adjacency Deletion Status : No
---------------------------------------------------------------------
LDP Peer ID : 5.5.5.9
VPNInstance name : -
CreateDate : 2010-09-14
CreateTime : 09:17:55
Adjacency Age : 0000:01:25
AdjacencyType : Local Adjacency
Discovery-Source : GigabitEthernet1/0/0
UDP Source Address : 10.4.5.5
UDP Socket ID : 149
Sequence No. : 0
Configuration Hello Hold Timer(sec) : 256
Hello Message Rcvd : 5129
Adjacency Deletion Status : No
----------------------------------------------------------------------
TransportAddress. The device can be LDP active end or passive end, so both
the source port and destination port need to be added to ACL.
acl number 3332
rule permit tcp source 10.5.5.9 0 destination-port eq 646
rule permit tcp source 10.5.5.9 0 source-port eq 646
Configuration summary:
● Precise configuration based on source IP address and port number:
acl number 3332
rule permit udp source 10.5.5.9 0 destination-port eq 646
rule permit udp source 10.4.5.5 0 destination-port eq 646
rule permit tcp source 10.5.5.9 0 destination-port eq 646
rule permit tcp source 10.5.5.9 0 source-port eq 646
2. The 10.55.1.1 and 10.66.1.1 are the neighbor IP addresses. So, add these IP
addresses to ACL.
Precise configuration based on source IP address:
acl number 3333
rule permit ospf source 10.55.1.1 0
rule permit ospf source 10.66.1.1 0
VRRP is based on IP and its protocol ID is 112. VRRP peer sends packets with the
peer virtual IP address. So, add the peer virtual IP address and the protocol ID to
ACL.
1. Collect information about VRRP peer.
Get the peer virtual IP address from the configuration of the VRRP.
2. Precise configuration based on source IP address:
acl number 3334
rule permit 112 source 10.55.1.100 0
Multicast protocols include PIM (protocol number 103), IGMP (protocol number
2), and MSDP (protocol number 639).
acl number 3335
rule permit 103
rule permit igmp
rule permit udp destination-port eq 639
rule permit udp source-port eq 639
rule permit tcp destination-port eq 639
rule permit tcp source-port eq 639
Telnet and SSH are TCP-based protocols used for normal login or console login.
The two protocols are very important and are therefore added to an
independent ACL for protection. Both source port and destination port need to
be specified. The port number of SSH is 22.
Precise configuration based on source IP address and port number:
acl number 3337
rule permit tcp source 10.97.3.0 0.0.0.255 source-port eq telnet
rule permit tcp source 10.97.3.0 0.0.0.255 destination-port eq telnet
rule permit tcp source 10.97.3.0 0.0.0.255 source-port eq 22
rule permit tcp source 10.97.3.0 0.0.0.255 destination-port eq 22
FTP-DATA is used to transmit data. When the device gets files from remote
endpoint, the data is sent to CPU. The transmission rate must be ensured, that
is, the bandwidth for the FTP-DATA cannot be limit. Therefore, add FTP-DATA to
an independent ACL for protection.
Precise configuration based on source IP address and port number:
acl number 3339
rule permit tcp source 10.97.3.0 0.0.0.255 source-port eq ftp-data
rule permit tcp source 10.97.3.0 0.0.0.255 destination-port eq ftp-data
TACACS and NTP are service-oriented protocols. The NTP port number is 123.
TACACS have two types: Huawei-specific TCP-based TACACS and UDP-based
standard TACACS. It is recommended that you add both types to the ACL.
Configuration example:
Precise configuration based on source IP address and port number:
acl number 3341
rule permit udp source 10.43.0.0 0.0.255.255 source-port eq 123
rule permit udp source 10.43.0.0 0.0.255.255 destination-port eq 123
rule permit tcp source 10.43.53.20 0 source-port eq tacacs
rule permit tcp source 10.43.49.20 0 destination-port eq tacacs
rule permit udp source 10.43.53.20 0 source-port eq tacacs-ds
rule permit udp source 10.43.49.20 0 destination-port eq tacacs-ds
ACL 3330 to ACL 3343 are used to filter normal protocol packets and packets on
the trusted network segment. Other packets are considered invalid or unknown.
Use ACL 3360 to filter invalid or unknown packets. The configuration is as
follows:
acl number 3360
rule permit ip
rule permit igmp
rule permit 103 ///PIM protocol
rule permit ospf
Result:
● IP packets that do not match the user-defined flow match the rule "rule
permit ip".
● IGMP packets that do not match the user-defined flow match the rule "rule
permit igmp".
● PIM packets that do not match the user-defined flow match the rule "rule
permit 103".
● OSPF packets that do not match the user-defined flow match the rule "rule
permit ospf".
The packets to be sent to the CPU comply with the following match sequence
by default: TCPSYN packets, packet fragments, dynamic link protection,
management protocol ACL, whitelist, blacklist, and user-defined flow. In the
preceding example, packets need to match against the user-defined flow before
the blacklist. Therefore, run the command to adjust the match sequence as
required.
#
cpu-defend policy 10
process-sequence tcpsyn-flood fragment-flood dynamic-link-protection management-acl whitelist user-
defined-flow blacklist
#
To ensure system reliability and protect services against attacks, the NE9000
supports security techniques, such as rate limiting by committed access rate (CAR),
attack detection, and attack defense. However, in absence of a global
management center that can summarize and analyze all attack information,
attack detection and defense are not comprehensive for the NE9000.
To address this problem, the SOC has been developed to summarize and analyze
information reported by all security detection modules in the system. Then the
SOC presents attack event reports, attack sources, cause analysis, and solutions in
a centralized and concise manner.
NOTE
The SOC does not display information about minor attack events that affect only a function
in the system. The SOC also does not display information about events that cause system
breakdown by sending constructed malformed packets or a small number of packets to
attack the system. Information about the events that cause system breakdown is displayed
by service modules, the NMS, the log function, and the attack source tracing function.
The SOC displays only information about attack events that cause system risks. These
attack events have the following characteristics:
● CPU usage when the attack event occurs is much higher than that in normal cases.
● The rate of packet loss caused by CPCAR exceeds a normal threshold.
● A protocol module detects a large number of invalid packets or sessions, and the
percentage of the number of invalid packets or sessions to the total number of
packets or sessions exceeds a normal threshold.
Applicable Environment
When an exception occurs, for example, services are interrupted, the system
performance deteriorates, or service flapping occurs, maintenance personnel can
use the SOC to quickly determine if the exception has been caused by a security
attack. Maintenance personnel can also use the SOC to perform routine
maintenance and management to check if any security attack has occurred and
take immediate measures.
Pre-configuration Tasks
None
Context
Attack detection and attack source tracing are key SOC functions. Before using the
SOC, ensure that these functions are enabled. If attack detection and attack
source tracing are left disabled, the SOC can still be triggered by timers to collect
the CPU usage, protocol module's state data, including the number of invalid
packets and sessions, and CPCAR-related packet loss statistics. However, the SOC
neither performs attack detection and attack source tracing nor generates alarms,
and therefore cannot locate attack events.
After attack defense is enabled, the SOC automatically delivers attack defense
policies if the NE9000 is being attacked. This function isolates attacks or protects
the NE9000 against attacks.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run soc
Attack detection and attack source tracing are enabled, and the SOC view is
displayed.
Step 3 (Optional) Run attack-defend enable
Attack defense is enabled.
If the SOC determines that an attack event has occurred, enable attack defense.
Step 4 Run commit
The configuration is committed.
----End
Context
If an exception occurs or an attack event alarm is generated on the NE9000,
perform the following procedures to determine whether an attack event has
occurred:
1. Check attack event reports and identify the attack event to be analyzed.
2. Check the Location and Reasons fields in attack event reports to find out the
slot ID and protocol of the attack event and check the historical statistics.
Historical statistics include the CPCAR statistics and protocol statistics.
Determine whether the attack event is caused by protocol packets sent to the
CPU or invalid packets or sessions on a protocol module.
3. After the attack event is determined, enable attack defense. Then the NE9000
uses the configured attack defense policies to defend against subsequent
attack packets. You can also check packet loss statistics of the interface under
attack.
Perform the following steps in any view.
Procedure
Step 1 Check attack event reports.
1. Run the display soc attack-event command to check a summary of attack
events.
2. Run the display soc attack-event slot slot-id [ verbose ] command to check
information about attack events on the board in a specified slot.
The specified slot is identified by checking the Location field in the attack
event summary. Detailed information about attack events is displayed if
verbose is configured.
3. Run the display soc attack-event event-number event-number [ verbose ]
command to check information about the specified attack event.
The specified attack event is identified by checking the Seq. field in the attack
event summary or information about attack events on the board in a
specified slot.
Step 2 Check historical statistics.
NOTE
In the following commands, slot-id must be the same as the slot-id specified in the display
soc attack-event command, and protocol-name must be the same as the Reasons field
value in the display soc attack-event command output.
CAR is a traffic policing instance. CPCAR functions for packets to be sent to the CPU.
2. Run the display soc attack-detect statistics car slot slot-id protocol
protocol-name [ cpcar-name history { 15-minutes | 60-minutes | 72-
hours } ] command to check the packet loss rate of the protocol packets
identified by cpcar-name within a specified period.
3. Run the display soc attack-detect cpu-usage slot slot-id history { 15-
minutes | 60-minutes | 72-hours } command to check the CPU usage within
a specified period. If the CPU usage and packet loss rate within a specified
period have similar tendencies, the CPU overload is caused by the protocol
packets identified by cpcar-name.
Check protocol statistics.
1. Run the display soc attack-detect statistics application slot slot-id
command to check statistics about the protocol packets and sessions on the
board in a specified slot. Identify the protocol module that has the largest
percentage of the number of invalid packets or sessions to the total number
of packets or sessions. This protocol module can be considered to have the
poorest security.
2. Run the display soc attack-detect statistics application slot slot-id protocol
protocol-name history { 15-minutes | 60-minutes | 72-hours } command to
check statistics about the protocol packets and sessions and the average CPU
usage within the last 15 minutes, 1 hour, or 72 hours. If the CPU usage is high
while the percentage of the number of invalid packets or sessions to the total
number of packets or sessions is high, attacks to the protocol module cause
the CPU overload. If you cannot identify the problem by querying the average
CPU usage, run the following command to check detailed information about
the CPU usage within the specified period.
3. (Optional) Run the display soc attack-detect cpu-usage slot slot-id history
{ 15-minutes | 60-minutes | 72-hours } command to check detailed
information about the CPU usage within a specified period.
Step 3 (Optional) Run the display soc attack-defend statistics slot slot-id port-vlan-car
command to check statistics about the packets that pass through or are discarded
by interfaces being attacked on the board in a specified slot.
After attack defense is enabled and the NE9000 is being attacked, you can run this
command.
----End
Context
If a device works abnormally (for example, a device encounters CPU overloads,
logout, route interruption), you can configure a user-defined group for which
attack defense is enabled to isolate the attack sources.
NOTE
Only when attack events or sources are confirmed, you can run the attack-defend user-
enable-group command to configure a user-defined group for which attack defense is
enabled. After a user-defined group for which attack defense is enabled and specific
protocols are defined in the user-defined group, when a protocol attack is detected, the
system automatically delivers an attack defense policy.
Procedure
Step 1 Check whether the alarm SOC_1.3.6.1.4.1.2011.5.25.165.1.11.12
hwBaseSocAttackTrap is generated. The alarm content includes the attack
position, protocol type, sub-interface, and MAC address information.
Step 2 If the alarm is generated, run the display soc attack-event slot slot-id command
in any view to query more detailed information about the attack event on the
board in a specific slot, such as the attack possibility, physical interface under
attacks, VLAN, and attack cause (protocol flooding or broadcast storm).
Step 3 Locate and isolate the attack source based on the obtained attack position and
cause.
NOTE
If CPU overloads frequently occur due to device attacks, you can check service deployment
on the interface under attack based on the port information of the attack event. If
unexpected protocol packet loss is detected, run the attack-defend user-enable-group
command to configure a user-defined group for which attack defense is enabled and define
the protocol in the group. After that, when the protocol packets are sent to attack the
device again, an attack defense policy is automatically delivered to protect the CPU.
----End
Context
As network configurations and traffic characteristics vary, the default attack source
tracing thresholds may cause incorrect or missing decisions on attack events. You
can adjust the attack source tracing parameters based on actual conditions. If an
object under attack fails to be located, the attack source tracing thresholds are set
high and need to be lowered. If an object not under attack is identified as being
attacked, the attack source tracing threshold is set low and needs to be increased.
NOTE
Each attack source tracing threshold has its default value. Adjust the thresholds based on
your networking environment by referring to the default values and value ranges provided
in the command reference. It is recommended that you adjust attack source tracing
thresholds with assistance from Huawei engineers.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run soc
The SOC view is displayed.
----End
Context
The security Operating Center (SOC) determines whether the system is being
attacked based on the statistics analysis. To correctly obtain these statistics on a
live network, you must set proper alarm thresholds for security attack events. The
traffic models vary with different networkings in different scenarios.
● On small-scale networks where the traffic rate is low, router bandwidth is low,
and the number of users is small, setting a low alarm threshold is
recommended.
● On large-scale networks where the traffic rate is high, router bandwidth is
high, and the number of users is great, setting a high alarm threshold is
recommended.
Additionally, you can also adjust the threshold based on the security attack event
reports. If false alarms are frequently reported, you can increase the alarm
threshold. However, if some security attacks are ignored (the security attacks are
detected by other monitoring systems but not reported by the SOC), you can
lower the alarm threshold.
Procedure
Step 1 Run system-view
----End
Procedure
Step 1 Run the display soc attack-trace threshold configuration command to check
attack source tracing thresholds.
Step 2 Run the display soc attack-detect car threshold configuration command to
check the configured CP-CAR thresholds for attack detection.
----End
Context
After the SOC's attack defense function is enabled, if an interface is attacked, the
SOC separately collects statistics on packets that match ACL rules and statistics on
packets to which CAR is implemented after they match ACL rules. Before collecting
statistics again, clear the existing statistics.
NOTICE
SOC statistics cannot be restored after they are cleared. Exercise caution when
running the reset command.
Procedure
● Run the reset soc attack-defend statistics slot slot-id command in the user
view to clear statistics on packets that match ACL rules and statistics on
packets to which CAR is implemented after they match ACL rules on the
attacked interfaces on the board in a specified slot.
----End
Context
NOTE
Based on your requirements to detect failures in telecom transmission, this feature may
collect or store some communication information about specific customers. Huawei cannot
offer services to collect or store this information unilaterally. Before enabling the function,
ensure that it is performed within the boundaries permitted by applicable laws and
regulations. Effective measures must be taken to ensure that information is securely
protected.
If a device has high central processing unit (CPU) usage or interface traffic is
abnormal, configure packet header obtaining to obtain packets sent to this
device's CPU or packets forwarded by this device. The device saves these obtained
packet headers to a specified file, and you can use the file to locate network
faults. Packet header obtaining does not affect packet transmission.
Usage Scenario
With the expansion of networks and the increasing number of applications, device
CPUs may become overloaded if required to process large numbers of packets. The
high CPU usage deteriorates device performance and affects normal service
processing. To address these issues, specify filter criteria and configure devices to
obtain packet headers sent to their CPUs based on the criteria. You can then
analyze the obtained packet headers and locate network faults accordingly.
Before using an access control list (ACL) as a filter criterion, you must create it.
For details about the ACL configuration, see "ACL Configuration" in NE9000
Configuration Guide - IP Services.
Pre-configuration Tasks
Before configuring a device to obtain packet headers sent to its CPU, complete the
following tasks:
● Configure link layer protocol parameters for interfaces to ensure that the link
layer protocol status of the interfaces is Up.
● Create an ACL.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 (Optional) Configure an ACL rule.
NOTE
After an ACL rule is configured, the headers of packets that match the ACL rule can be obtained.
With the packet header obtaining function, packets are processed as follows:
● If packets match the ACL rule with the permit action, their headers are obtained.
● If packets match the ACL rule with the deny action, they are dropped instead of being
forwarded. This may adversely affect services.
● If packets match no ACL rule, they are properly forwarded, without having their headers
obtained.
● If the referenced ACL does not exist or an existent ACL in which no rule is defined is
referenced, packets are properly forwarded, without having their headers obtained.
● When packets are matched against an ACL rule, the vpn-instance vpn-instance-name
parameter configured in the rule does not take effect.
NOTE
Usage Scenario
To check whether a traffic exception (such as voice quality deterioration and
mosaic) that occurs in network maintenance is caused by packet errors or packet
loss, specify filter criteria and configure devices to obtain forwarded packet
headers based on the criteria. You can then analyze the obtained packet headers
and rectify packet issues accordingly, thereby ensuring proper transmission of
network data.
Before using an access control list (ACL) as a filter criterion, you must create it.
For details about the ACL configuration, see "ACL Configuration" in NE9000
Configuration Guide - IP Services.
Pre-configuration Tasks
Before configuring a device to obtain forwarded packet headers, complete the
following tasks:
● Configure link layer protocol parameters for interfaces to ensure that the link
layer protocol status of the interfaces is Up.
● Create an ACL.
Procedure
Step 1 Run system-view
After an ACL rule is configured, the headers of packets that match the ACL rule can be obtained.
With the packet header obtaining function, packets are processed as follows:
● If packets match the ACL rule with the permit action, their headers are obtained.
● If packets match the ACL rule with the deny action, they are dropped instead of being
forwarded. This may adversely affect services.
● If packets match no ACL rule, they are properly forwarded, without having their headers
obtained.
● If the referenced ACL does not exist or an existent ACL in which no rule is defined is
referenced, packets are properly forwarded, without having their headers obtained.
● When packets are matched against an ACL rule, the vpn-instance vpn-instance-name
parameter configured in the rule does not take effect.
NOTE
NOTICE
----End
Context
NOTICE
Each packet header getting instance is saved as one file. By default, each packet
header getting instance on the main control board has a memory of 2 MB. An
instance is cleared automatically after being saved on the main control board for
10 minutes. If the main control board saves multiple packet header getting
instances within 10 minutes, the memory usage of the main control board may
become very high. This will affect main control board performance. To solve this
problem, clear one or more instances from the main control board's memory.
Procedure
Step 1 Run the capture-packet free { all | instance-id instance-id } command to clear
the information about packet header getting instances saved on the main control
board's memory.
----End
1.1.13.6.1 Example for Configuring a Device to Obtain Packet Headers Sent to its
CPU
This section provides an example for configuring a device to obtain packet headers
sent to its central processing unit (CPU).
Networking Requirements
As shown in Figure 1-25, PC1 accesses the Internet over Device A and Device B.
Device B has high CPU usage. To find out the reason why Device B has high CPU
usage, configure Device B to obtain packet headers sent to its CPU.
Figure 1-25 Configuring Device B to obtain packet headers sent to its CPU
NOTE
Configuration Roadmap
The configuration roadmap is as follows:
● Configure the function of obtaining packet headers sent to Device B's CPU.
Data Preparation
To complete the configuration, you need the following data:
● Interface IP addresses
● Packet header obtaining timeout time and number of obtained packet
headers
Procedure
Step 1 Configure interface IP addresses and routing protocol. The configuration details
are not provided.
Step 2 Configure Device B to obtain packet headers sent to its CPU.
<DeviceB> capture-packet local-host all interface gigabitethernet 1/0/2 packet-len 60 packet-num
1000 time-out 3600
Step 3 View the configuration and the packet header obtaining file.
# View the configuration.
<DeviceB> display capture-packet config-state
Capture-Packet Index 1
Type : local-host
SysID : all
Interface : GigabitEthernet1/0/2
File Name : cfcard:/capture_host_all_GigabitEthernet3.0.2_2012-05-03-10-51-29.cap
Time-out : 3600 seconds
Packet-num : 1000
Packet-len : 60
BufferOnly : disabled
----End
Configuration Files
● Device A configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet1/0/1
undo shutdown
ip address 10.1.2.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.1.2.0 0.0.0.255
#
return
Networking Requirements
As shown in Figure 1-26, PC1 accesses the Internet over Device A and Device B.
Video quality on PC1 deteriorates, which may be caused by a fault that occurred
on Device B. To find out the reason why video quality deteriorates, configure
Device A to obtain packet headers forwarded by Device B to the inbound interface
GE 1/0/0 of Device A.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure an access control list (ACL) rule.
2. Configure Device A to obtain forwarded packet headers.
Data Preparation
To complete the configuration, you need the following data:
● Interface IP addresses
● ACL number
● Packet header obtaining timeout time, number of obtained packet headers,
and packet header obtaining file name
Procedure
Step 1 Configure interface IP addresses and routing protocol. The configuration details
are not provided.
Step 2 Configure an ACL rule.
<DeviceA> system-view
[DeviceA] acl number 2001
[DeviceA-acl4-basic-2001] rule permit source 10.1.1.1 0.0.0.0
[DeviceA-acl4-basic-2001] commit
[DeviceA-acl4-basic-2001] quit
[DeviceA] quit
Step 4 View the configuration and the packet header obtaining file.
# View the configuration.
----End
Configuration Files
● Device A configuration file
#
sysname DeviceA
#
acl number 2001
rule 5 permit source 10.1.1.1 0
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet1/0/1
undo shutdown
ip address 10.1.2.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.1.2.0 0.0.0.255
#
return
Definition
BGP flow specification is used to guard against denial of service (DoS) and
distributed denial of service (DDoS) attacks, improving network security and
availability.
Purpose
DoS and DDoS attacks pose a grave threat to network security. A DoS/DDoS
attacker can control thousands of devices through multiple control ends to launch
traffic attacks on the same destination address, subnet, or server. Such attacks
cause network congestion and may even cause a server to fail to provide services
due to excessive CPU usage.
Traditionally, there are two techniques for preventing DoS/DDoS attacks: traffic
classification and traffic redirection. However, these two techniques have their
own defects, as shown in Table 1-23.
Table 1-23 Comparison between the two traditional techniques for preventing
DoS or DDoS attacks
Traffic Traffic filtering rules and quality The technique has the following
classificati of service (QoS) policies are defects:
on manually configured to reduce ● It fails to guarantee real-time
the impact of DoS and DDoS attack defense. Coordination
attacks on the network. among network service
providers is needed to
identify attack sources.
● Traffic filtering policies need
to be manually modified,
thereby complicating
maintenance.
Traffic The next hop of the route The technique has the following
redirectio destined for the attack target is defects:
n modified based on a routing ● The traffic filtering rule is
policy. simplistic. Only destination
● The next hop of the route is addresses can be used as a
set to a blackhole, and attack basis for traffic filtering.
traffic is then discarded. ● Traffic filtering information
● The next hop of the route is and routing information are
set to a traffic cleaning transmitted together, which
device which cleans the complicates maintenance.
attack traffic to ensure
normal service traffic.
Table 1-24 Comparison between BGP public network Flow Specification, BGP VPN
Flow Specification, BGP VPNv4 Flow Specification, and BGP VPNv6 Flow
Specification
BGP Flow Usage Scenario Address Family
Specification
Classificatio
n
Benefits
BGP flow specification can improve the reliability and security of user networks.
Details are as follows:
● Real-time monitoring: BGP flow specification rapidly responds to attack traffic
through scheduled sampling, keeping attack traffic under control.
● Preemptive defense: Defense policies are configured manually in advance
based on the characteristics of common attack traffic to prevent common
attack traffic from damaging user networks.
● Reduced costs: You do not need to create a traffic control policy on each
device, improving maintainability.
● Minimized attack scope: BGP flow specification routes can be transmitted
across domains so that attack traffic can be filtered out of the device nearest
to the attack source. This significantly reduces the impact of attack traffic on
networks.
Usage Scenario
When deploying dynamic BGP Flow Specification, a BGP Flow Specification peer
relationship needs to be established between the traffic analysis server and each
ingress of the network to transmit BGP Flow Specification routes.
In an AS with multiple ingresses, a BGP Flow route reflector (Flow RR) can be
deployed to reduce the number of BGP Flow Specification peer relationships to be
established and save network resources.
If you want to filter traffic matching a specified address prefix but BGP Flow
Specification routes matching the specified address prefix cannot pass validation,
disable the validation of the BGP Flow Specification routes received from a
specified peer.
Pre-configuration Tasks
Before configuring dynamic BGP Flow Specification, configure a BGP peer.
Procedure
Step 1 Configure a BGP Flow Specification peer relationship.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-family flow
The BGP-Flow address family view is displayed.
4. Run peer ipv4-address enable
A BGP Flow Specification peer relationship is established.
After the BGP Flow Specification peer relationship is established in the BGP-
Flow address family view, BGP Flow Specification routes generated by a traffic
analysis server are automatically imported to the BGP routing table and then
sent to the BGP Flow Specification peer.
5. Run commit
The configuration is committed.
Step 2 (Optional) Configure a Flow RR.
Before configuring a Flow RR, establish a BGP Flow Specification peer relationship
between the Flow RR with the traffic analysis server and every network ingress.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-family flow
The BGP-Flow address family view is displayed.
4. Run peer ipv4-address reflect-client
A Flow RR is configured, and clients are specified for it.
The router on which the peer reflect-client command is run functions as a
Flow RR, and the network ingress and traffic analysis server function as
clients.
5. (Optional) Run undo reflect between-clients
Route reflection between clients through the RR is disabled.
If the clients of a Flow RR are fully meshed, you can run the undo reflect
between-clients command on the Flow RR to disable route reflection
between clients through the RR, which reduces costs.
6. (Optional) Run reflector cluster-id { cluster-id-value | cluster-id-ipv4 }
A cluster ID is configured for the Flow RR.
If a cluster has multiple Flow RRs, run this command to set the same cluster-
id for these RRs.
NOTE
5. Run commit
The device is disabled from validating the BGP Flow Specification routes
received from a specified peer.
5. Run commit
Step 5 (Optional) Disable the device from validating the next hop of each route that
carries the redirection next-hop attribute and is received from a specified EBGP
peer.
1. Run system-view
a. Run system-view
The system view is displayed.
b. Run bgp as-number
The BGP view is displayed.
c. Run ipv4-family flow
The BGP-Flow address family view is displayed.
d. Run peer ipv4-address redirect ip draft-compatible
The redirection next-hop attribute ID of BGP Flow Specification routes is
changed to 0x0800 (defined in a related draft).
e. Run commit
The configuration is committed.
Step 8 (Optional) Configure the interface in the BGP Flow Specification as the traffic-
injection interface of the cleaned traffic to prevent the injected traffic from
matching the Flow Specification rules and being switched back to the cleaning
device.
1. Run system-view
NOTE
NOTE
The device is allowed to recurse received routes with the next-hop IPv6
address, color, and prefix SID attributes to tunnels.
NOTE
To trigger route recursion to SRv6 TE Policies, you must run both the redirect
tunnelv6 tunnel-selector tunnel-selector-name command and the peer ipv4-address
redirect tunnelv6 command.
5. Run commit
Step 13 (Optional) Configure the device to validate the redirection next-hop IPv6 address
attribute carried in the routes that are received from an EBGP peer.
1. Run system-view
Step 14 (Optional) Configure BGP Flow Specification for the packets leaving the public
network based on IP information.
1. Run system-view
BGP Flow Specification is configured for the packets leaving the public
network based on IP information.
3. Run commit
Step 15 (Optional) Enable CAR statistics collection and packet loss statistics collection for
BGP Flow Specification.
1. Run system-view
want the device to send routes that carry the destination community attribute
rule to a specified BGP Flow Specification peer.
5. Run commit
The configuration is committed.
Step 23 (Optional) Enable BGP Flow Specification to match an IPv4 destination
community attribute-based traffic filtering rule.
1. Run system-view
The system view is displayed.
2. Run flowspec match-rule enhance enable
BGP Flow Specification is enabled to match an IPv4 destination community
attribute-based traffic filtering rule.
3. Run commit
The configuration is committed.
----End
Usage Scenario
When static BGP Flow Specification is configured, a BGP Flow Specification route
needs to be generated manually, and a BGP Flow Specification peer relationship
needs to be established between the device that generates the BGP Flow
Specification route and each ingress on the network to advertise BGP Flow
Specification routes.
In an AS with multiple ingresses, a BGP Flow route reflector (Flow RR) can be
deployed to reduce the number of BGP Flow Specification peer relationships to be
established and save network resources.
If you want to filter traffic matching a specified address prefix but BGP Flow
Specification routes matching the specified address prefix cannot pass validation,
disable the validation of the BGP Flow Specification routes received from a
specified peer.
Pre-configuration Tasks
Before configuring static BGP Flow Specification, configure a BGP peer.
Procedure
Step 1 Create a BGP Flow Specification route manually.
1. Run the system-view command to enter the system view.
2. Run the flow-route flowroute-name command to create a static BGP Flow
Specification route and enter the Flow-Route view.
One BGP Flow Specification route can include multiple if-match and apply
clauses. if-match clauses define traffic filtering rules, and apply clauses
define traffic behaviors. The relationships among clauses are as follows:
– The relationship among if-match clauses of different types is "AND."
– If if-match clauses of the same type are configured repeatedly, some
rules override each other, and some other rules are in the OR
relationship. For details, see the precautions for the if-match command.
– The relationship among the traffic behaviors defined by apply clauses is
"AND."
The traffic behaviors defined by apply clauses apply to all traffic matching the
filtering rules of if-match clauses.
The traffic filtering rules for BGP Flow Specification routes configured in the
Flow-Route view take effect only in the system view, not on a specified
interface. To configure the traffic filtering rules for BGP Flow Specification
routes to take effect on a specified interface, perform the following steps:
a. Run the system-view command to enter the system view.
b. Run the flow-interface-group flow-interface-group-id command to
create a BGP Flow Specification interface group and enter the interface
group view.
c. (Optional) Run the description description command to configure a
description for the BGP Flow Specification interface group.
d. Run the interface interface-type interface-number command to add an
interface to the BGP Flow Specification interface group.
e. (Optional) Run the quit command to return to the system view.
f. (Optional) Run the flow-route flowroute-name command to enter the
Flow-Route view.
The filtering rule based on the start AS number of the destination IP address
cannot take effect globally. You must specify a BGP Flow Specification interface
group. That is, if you need to run the if-match destination-origin-as { as-
number-plain | as-number-dot } command to configure the filtering rule based
on the start AS number of the destination IP address, you must perform the
preceding steps.
Steps v, vi, and vii do not need to be configured between the controller and
forwarder. Steps v, vi, and vii must be configured between forwarders.
h. (Optional) Run the quit command to return to the system view.
i. (Optional) Run the reset flowspec statistics reindex [ flow-interface-
group flow-interface-group-id ] command to clear statistics about traffic
matching the BGP Flow Specification route.
j. (Optional) Run the flowspec ipv4 cascading-mode command to enable
the BGP Flow Specification cascading mode. In this way, if interface
group-based route query fails, global route query is performed.
3. According to characteristics of the traffic to be controlled, you can configure
one or more if-match clauses to define traffic filtering rules as needed:
– To set a destination address-based traffic filtering rule, run the if-match
destination ipv4-address { mask | mask-length } command.
NOTE
If you want to control traffic based on an address prefix, run the if-
match destination command to configure a destination address-based
traffic filtering rule. However, if there are a large number of routes of the
same type, configuring destination address-based traffic filtering rules
one by one for traffic control is complex and consumes many resources.
To address this issue, you can configure traffic filtering through
destination community attribute aggregation.
After the configuration is complete, run the display bgp flow routing-
table reIndex destination-community command to check details about
the traffic filtering rule that is based on the community attribute of the
destination IP address in a BGP Flow Specification route.
– To set a source address-based traffic filtering rule, run the if-match
source ipv4-address { mask | mask-length } command.
– To set a port number-based traffic filtering rule, run the if-match port
{ greater-than | less-than | equal } port or if-match port greater-than
port less-than upper-port-value command.
– To set a source port number-based traffic filtering rule, run the if-match
source-port { greater-than | less-than | equal } port or if-match
source-port greater-than source-port less-than upper-source-port-value
command.
– To set a destination port number-based traffic filtering rule, run the if-
match destination-port { greater-than | less-than | equal } port or if-
match destination-port greater-than port less-than upper-port-value
command.
NOTE
– To set an ICMP message type-based traffic filtering rule, run the if-match
icmp-type { greater-than | less-than | equal } icmp-type or if-match
icmp-type greater-than icmp-type less-than upper-icmp-type-value
command.
Echo-reply 0 0
Parameter-problem 12 0
Port-unreachable 3 3
Protocol-unreachable 3 2
Reassembly-timeout 11 1
Source-quench 4 0
Source-route-failed 3 5
Timestamp-reply 14 0
Timestamp-request 13 0
Ttl-exceeded 11 0
Fragmentneed-DFset 3 4
Host-redirect 5 1
Host-tos-redirect 5 3
Host-unreachable 3 1
Information-reply 16 0
Information-request 15 0
Net-redirect 5 0
Net-tos-redirect 5 2
Net-unreachable 3 0
NOTE
After configuring the filtering rules, you need to configure the following:
▪ Run the check-origin-as enable command to allow the received BGP Flow
Specification routes carrying the matching rule that is based on the origin AS
number of the destination IP address to take effect.
▪ Create a BGP Flow Specification interface group and associate it with the BGP
Flow Specification route.
4. Run the following command as required to configure actions for apply
clauses:
– To discard the matched traffic, run the apply deny command. The apply
deny and apply traffic-rate commands cannot be used together.
– To redirect the matched traffic to the traffic cleaning device or blackhole,
run the apply redirect { vpn-target vpn-target-import | ip redirect-ip-rt }
command.
NOTE
The device can process the redirection next hop attribute configured using the
apply redirect ip redirect-ip-rt command received from a peer only after the
peer redirect ip command is run.
The device can process the redirection next hop attribute configured using the
apply redirect ip redirect-ip-rt color colorvalue command received from a peer
only after the peer redirect ip command is run.
The redirection load balancing function can be enabled on the device only after
the redirect load-balancing command is run. A maximum of eight redirection
routes can be used for load balancing.
– To redirect the matched traffic to an SR-MPLS TE Policy, run the apply
redirect ip redirect-ip-rt color colorvalue command.
– To redirect the matched traffic to the IPv6 address of a specified next
hop, run the apply redirect ipv6 redirect-ipv6-rt command.
NOTE
A device can process the redirection next-hop attribute configured using the
apply redirect ipv6 redirect-ipv6-rt command and carried in the routes that are
received from peers only after the peer ipv4-address redirect ipv6 command is
run.
The apply redirect ipv6 redirect-ipv6-rt command must be used together with
the local-route redirect ipv6 command to trigger traffic redirection to a
specified IPv6 next hop.
– To redirect the matched traffic to an SRv6 TE Policy, run the apply
redirect ipv6 redirect-ipv6-rt color colorvalue [ prefix-sid prefix-sid-
value ] command.
– To redirect the matched traffic to SR-MPLS TE Policies for load balancing
(a maximum of eight redirection paths are supported for load balancing),
run the apply redirect multi-ip redirectIP [ color color-value ] [ weight
weight-value ] command.
– To redirect the matched traffic to SRv6 TE Policies for load balancing (a
maximum of eight redirection paths are supported for load balancing),
If the configured BGP Flow Specification route attribute does not need to take effect
locally, run the routing-table rib-only [ route-policy route-policy-name | route-filter
route-filter-name ] command to disable the device from delivering the BGP Flow
Specification route to the FES forwarding table.
5. Run commit
The configuration is committed.
Step 2 Configure BGP Flow Specification peer relationships.
BGP Flow Specification peer relationships must be established between the
network ingress and device on which the BGP Flow Specification route is manually
created.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-family flow
The BGP-Flow address family view is displayed.
4. Run peer ipv4-address enable
The BGP Flow Specification peer relationship is enabled.
After the BGP Flow Specification peer relationship is established in the BGP-
Flow address family view, the manually generated BGP Flow Specification
route is imported to the BGP routing table and then sent to each peer.
5. Run commit
The configuration is committed.
Step 3 (Optional) Configure a Flow RR.
Before configuring a Flow RR, establish a BGP Flow Specification peer relationship
between the Flow RR and the device on which the BGP Flow Specification route is
generated and between the Flow RR and every network ingress.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-family flow
The BGP-Flow address family view is displayed.
4. Run peer ipv4-address reflect-client
A Flow RR is configured, and clients are specified for it.
The router on which the peer reflect-client command is run functions as a
Flow RR, and the specified peers function as clients.
5. (Optional) Run undo reflect between-clients
Route reflection between clients through the RR is disabled.
If the clients of a Flow RR are fully meshed, you can run the undo reflect
between-clients command on the Flow RR to disable route reflection
between clients through the RR, which reduces costs.
6. (Optional) Run reflector cluster-id { cluster-id-value | cluster-id-ipv4 }
A cluster ID is configured for the Flow RR.
If a cluster has multiple Flow RRs, run this command to set the same cluster-
id for these RRs.
The reflector cluster-id command is applicable only to Flow RRs.
7. Run commit
The configuration is committed.
Step 4 (Optional) Configure the device to check the AS_Path attribute during BGP Flow
Specification route validation.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-family flow
The BGP-Flow address family view is displayed.
4. Run route validation-mode include-as
The device is configured to check the AS_Path attribute during BGP Flow
Specification route validation.
BGP Flow Specification route validation is performed in either of the following
modes:
– Validation mode 1: After receiving a BGP Flow Specification route with a
destination address-based filtering rule, the device checks the validity of
the route using the rules described in Figure 1-28. The route is
considered valid only if the validation succeeds.
5. Run commit
The configuration is committed.
Step 5 (Optional) Disable BGP Flow Specification route validation.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-family flow
The BGP-Flow address family view is displayed.
4. Run peer ipv4-address validation-disable
The device is disabled from validating BGP Flow Specification routes received
from a specified peer.
5. Run commit
Step 6 (Optional) Disable the device from validating the next hop of each route that
carries the redirection next-hop attribute and is received from a specified EBGP
peer.
1. Run system-view
The device is disabled from validating the routes that carry a redirection
extended community attribute and are received from a specified EBGP peer.
5. Run commit
Step 7 (Optional) Allow the device to recurse received routes with the next-hop IPv6
address, color attribute, and prefix SID attributes to tunnels.
1. Run system-view
The device is configured to recurse received routes with the redirection next-
hop IPv6 address, color, and prefix SID attributes to tunnels.
5. Run commit
Step 8 (Optional) Configure the redirection next-hop attribute ID for BGP Flow
Specification routes.
a. Run system-view
The system view is displayed.
b. Run bgp as-number
The BGP view is displayed.
c. Run ipv4-family flow
The BGP-Flow address family view is displayed.
d. Run peer ipv4-address redirect ip rfc-compatible
The redirection next-hop attribute ID of the BGP Flow Specification route
is set to 0x010C (defined in a related RFC).
e. Run commit
The configuration is committed.
● Change the redirection next-hop attribute ID of BGP Flow Specification routes
to 0x0800 (defined in a related draft).
a. Run system-view
The system view is displayed.
b. Run bgp as-number
The BGP view is displayed.
c. Run ipv4-family flow
The BGP-Flow address family view is displayed.
d. Run peer ipv4-address redirect ip draft-compatible
The redirection next-hop attribute ID of BGP Flow Specification routes is
changed to 0x0800 (defined in a related draft).
e. Run commit
The configuration is committed.
Step 9 (Optional) Configure the interface in the BGP Flow Specification as the traffic-
injection interface of the cleaned traffic to prevent the injected traffic from
matching the Flow Specification rules and being switched back to the cleaning
device.
1. Run system-view
The system view is displayed.
2. Run interface interface-type interface-number
The interface view is displayed.
3. Run flowspec refluence
The interface in BGP Flow Specification is configured as the traffic-injection
interface for cleaning traffic.
NOTE
NOTE
Step 11 (Optional) Configure BGP Flow Specification for the packets leaving the public
network based on IP information.
1. Run system-view
BGP Flow Specification is configured for the packets leaving the public
network based on IP information.
3. Run commit
Step 12 (Optional) Enable CAR statistics collection and packet loss statistics collection for
BGP Flow Specification.
1. Run system-view
CAR statistics collection and packet loss statistics collection for BGP Flow
Specification are enabled.
3. Run commit
Step 13 (Optional) Configure BGP Flow Specification for packets entering an IPv4 VXLAN
tunnel.
1. Run system-view
3. Run commit
----End
Usage Scenario
Before deploying dynamic BGP IPv6 Flow Specification, you need to establish a
BGP IPv6 Flow Specification peer relationship between the traffic analysis server
and each ingress of the network to transmit BGP IPv6 Flow Specification routes.
In an AS with multiple ingresses, a BGP IPv6 Flow route reflector (Flow RR) can be
deployed to reduce the number of BGP IPv6 Flow Specification peer relationships
and save network resources.
If you want to filter traffic based on the address prefix but the BGP IPv6 Flow
Specification route carrying the filtering rule cannot pass validation, disable the
validation of BGP IPv6 Flow Specification routes received from a specified peer.
Pre-configuration Tasks
Before configuring the dynamic BGP IPv6 Flow Specification function, complete
the following task:
Procedure
Step 1 Establish a BGP IPv6 Flow Specification peer relationship.
1. Run system-view
Before configuring a Flow RR, establish a BGP IPv6 Flow Specification peer
relationship between the Flow RR and traffic analysis server and between the Flow
RR and every network ingress.
1. Run system-view
If the clients of a Flow RR are fully meshed, you can run the undo reflect
between-clients command on the Flow RR to disable route reflection
between clients through the RR, which reduces costs.
If a cluster has multiple flow RRs, run this command to set the same cluster-
id for these RRs.
NOTE
The validation of BGP IPv6 Flow Specification routes received from a specified
peer is disabled.
5. Run commit
Step 4 (Optional) Enable CAR statistics collection and packet loss statistics collection for
BGP flow specification.
1. Run system-view
CAR statistics collection and packet loss statistics collection for BGP Flow
Specification are enabled.
3. Run commit
NOTE
Step 7 (Optional) Configure the device to redirect traffic to a specified IPv6 next hop
after receiving a BGP IPv6 Flow Specification route from a peer.
1. Run system-view
The device is configured to redirect traffic to a specified IPv6 next hop after
receiving a BGP IPv6 Flow Specification route from a peer.
5. Run commit
Step 8 (Optional) Allow the device to recurse the BGP IPv6 Flow Specification routes
received from a peer to a tunnel.
1. Run system-view
The device is allowed to recurse the BGP IPv6 Flow Specification routes
received from a peer to a tunnel.
5. Run commit
The configuration is committed.
Step 9 (Optional) Disable the device from validating the redirection next-hop attribute
carried in the routes that are received from an EBGP peer.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv6-family flow
The BGP-IPv6-Flow address family view is displayed.
4. Run peer { ipv4-address | ipv6-address } redirect ipv6 validation-disable
The device is disabled from validating the redirection next-hop attribute
carried in the routes that are received from an EBGP peer.
5. Run commit
The configuration is committed.
Step 10 (Optional) Enable the route policy distribution (RPD) capability for a BGP peer to
support the BGP Flow Specification routes carrying the RPD attribute and
delivered by the controller to forwarders.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv6-family flow
The BGP-IPv6-Flow address family view is displayed.
4. Run peer peerIPv6Addr capability-advertise route-policy-distribute receive
The RPD capability is enabled for the BGP peer.
5. Run commit
The configuration is committed.
Step 11 (Optional) Enable the DSCP-based BGP IPv6 Flow Specification traffic filtering
rule.
1. Run system-view
The system view is displayed.
2. Run flowspec allow ipv6 dscp
The DSCP-based BGP IPv6 Flow Specification traffic filtering rule is enabled.
3. Run commit
The configuration is committed.
Step 12 (Optional) Enable BGP Flow Specification to match inner packet information
about the packets that leave an SRv6 TE Policy or SRv6 BE egress.
1. Run system-view
Step 13 (Optional) Enable BGP IPv6 Flow Specification to match the internal protocol
number in the header of an IPv6 fragment.
1. Run system-view
BGP IPv6 Flow Specification is enabled to match the internal protocol number
in the header of an IPv6 fragment.
3. Run commit
----End
● Run the display bgp flow ipv6 peer command to check information about
BGP IPv6 Flow Specification peers.
● Run the display bgp flow ipv6 routing-table command to check information
about BGP IPv6 Flow Specification routes.
● Run the display bgp flow ipv6 routing-table statistics command to check
statistics about BGP IPv6 Flow Specification routes.
● Run the display flowspec ipv6 rule reindex-value slot slot-id command to
check information about combined rules in the BGP IPv6 Flow Specification
route rule table.
● Run the display flowspec ipv6 rule statistics slot slot-id command to check
statistics about the rules for BGP IPv6 Flow Specification routes to take effect.
● Run the display flowspec resource rule { ipv4 | ipv6 } [ interface-based ]
[ slot slot-id ] command to check the resource usage information about BGP
Flow Specification route rules.
Usage Scenario
Before deploying static BGP IPv6 Flow Specification, you need to manually create
a BGP IPv6 Flow Specification route and establish a BGP IPv6 Flow Specification
peer relationship between the device on which the BGP Flow Specification route is
created and each ingress on the network to transmit BGP IPv6 Flow Specification
routes.
In an AS with multiple ingresses, a BGP IPv6 Flow route reflector (Flow RR) can be
deployed to reduce the number of BGP IPv6 Flow Specification peer relationships
and save network resources.
If you want to filter traffic based on the address prefix but the BGP IPv6 Flow
Specification route carrying the filtering rule cannot pass validation, disable the
validation of BGP IPv6 Flow Specification routes received from a specified peer.
Pre-configuration Tasks
Before configuring static BGP IPv6 Flow Specification, complete the following task:
● Configure a BGP4+ peer or configure a BGP peer.
Procedure
Step 1 Generate a BGP IPv6 Flow Specification route manually.
1. Run system-view
The system view is displayed.
2. Run the flow-route flowroute-name ipv6 command to create a static BGP
IPv6 Flow Specification route and enter the Flow-Route-IPv6 view.
One BGP IPv6 Flow Specification route can include multiple if-match and
apply clauses. if-match clauses define traffic filtering rules, and apply clauses
define traffic behaviors. The relationships among clauses are as follows:
– The relationship among if-match clauses of different types is "AND."
– If if-match clauses of the same type are configured repeatedly, some
rules override each other, and some other rules are in the OR
relationship. For details, see the precautions for the if-match command.
– The relationship among the traffic behaviors defined by apply clauses is
"AND."
The traffic behaviors defined by apply clauses apply to all traffic matching the
filtering rules of if-match clauses.
The traffic filtering rules for BGP IPv6 Flow Specification routes configured in
the Flow-Route-IPv6 view take effect globally, not on a specified interface. To
configure the traffic filtering rules for BGP IPv6 Flow Specification routes to
take effect on a specified interface, perform the following steps:
a. Run the system-view command to enter the system view.
b. Run the flow-interface-group flow-interface-group-id command to
create a BGP Flow Specification interface group and enter the interface
group view.
c. (Optional) Run the description description command to configure a
description for the BGP Flow Specification interface group.
Steps v, vi, and vii do not need to be performed for configuring traffic filtering
rules between the controller and forwarder but are mandatory for configuring
traffic filtering rules between forwarders.
h. (Optional) Run the quit command to return to the system view.
i. (Optional) Run the reset flowspec ipv6 statistics reindex [ flow-
interface-group ifGrpId ] command to clear traffic matching statistics
about interfaces in the specified BGP Flow Specification interface group
associated with the BGP IPv6 Flow Specification route.
j. (Optional) Run the flowspec ipv6 cascading-mode command to enable
the BGP Flow Specification cascading mode. In this way, if interface
group-based route query fails, global route query is performed.
3. According to characteristics of the traffic to be controlled, you can configure
one or more if-match clauses to define traffic filtering rules as needed:
– To filter traffic based on the destination IPv6 address, run the if-match
destination ipv6-address ipv6-mask-length command.
NOTE
If traffic must be filtered based on a destination IP address but the BGP IPv6
Flow Specification rule carrying the rule defined by the if-match destination
command cannot pass validation, run the peer validation-disable command to
disable the validation of BGP IPv6 Flow Specification routes.
By default, 0::0/0 is used as the prefix of each BGP IPv6 Flow Specification route
that matches the export or import policy of a peer. To enable a device to change
the prefix of each BGP IPv6 Flow Specification route that matches the export or
import policy configured for a peer to the destination IP address specified in the
if-match destination command, run the route match-destination command.
– To set a traffic filtering rule that is based on a source address, run the if-
match source ipv6-address ipv6-mask-length command.
– To set a port number-based traffic filtering rule, run the if-match port
{ greater-than | less-than | equal } port or if-match port greater-than
port less-than upper-port-value command.
– To set a source port number-based traffic filtering rule, run the if-match
source-port { greater-than | less-than | equal } port or if-match
source-port greater-than source-port less-than upper-source-port-value
command.
– To set a destination port number-based traffic filtering rule, run the if-
match destination-port { greater-than | less-than | equal } port or if-
match destination-port greater-than port less-than upper-port-value
command.
NOTE
After the flow-route flowroute-name ipv6 command is run, the if-match dscp
command can be successfully run but does not take effect. To enable it to take
effect in this case, run the flowspec allow ipv6 dscp command to enable the
DSCP-based BGP IPv6 Flow Specification traffic filtering rule.
– To set a TCP-flag value-based traffic filtering rule, run the if-match tcp-
flags { match | not | any-match } tcp-flags command.
Network attackers may send a large number of invalid TCP packets to
attack network devices. To control the unidirectional traffic of TCP
packets to ensure communication security, configure a filtering rule based
on the TCP flag for the BGP IPv6 Flow Specification route using the if-
match tcp-flags command. Traffic matching the TCP flag is controlled
using the actions specified in the apply clauses.
– To set a fragment type-based traffic filtering rule, run the if-match
fragment-type { match | not } fragment-type-name command.
– To set an ICMP message code-based traffic filtering rule, run the if-
match icmp-code { greater-than | less-than | equal } icmp-code or if-
match icmp-code greater-than icmp-code less-than upper-icmp-code-
value command.
– To set an ICMP message type-based traffic filtering rule, run the if-match
icmp-type { greater-than | less-than | equal } icmp-type or if-match
icmp-type greater-than icmp-type less-than upper-icmp-type-value
command.
– To set a filtering rule based on the packet length of a BGP IPv6 Flow
Specification route, run the if-match packet-length { greater-than |
less-than | equal } packet-length-value or if-match packet-length
greater-than packet-length-value less-than upper-packet-length-value
command.
4. Run the following command as required to configure actions for apply
clauses:
– To discard the matched traffic, run the apply deny command.
– To redirect the matched traffic to the traffic cleaning device or blackhole,
run the apply redirect vpn-target vpn-target-import command.
– To redirect the matched traffic to the IPv6 address of a specified next
hop, run the apply redirect ipv6 redirect-ipv6-rt command. This
command must be used together with the local-route redirect ipv6
recursive-lookup ip command to trigger the redirection.
NOTE
A device can process the redirection next hop attribute configured using the
apply redirect ip redirect-ip-rt command received from a peer only after the
peer { ipv4-address | ipv6-address } redirect ipv6 recursive-lookup ip command
is run.
A device can process the redirection next-hop attribute configured using the
apply redirect ip redirect-ip-rt color colorvalue command and carried in routes
that are received from a peer only after the peer { ipv4-address | ipv6-address }
redirect ipv6 recursive-lookup tunnel tunnel-selector tunnel-selector-name
command is run.
The redirection load balancing function can be enabled on the device only after
the redirect load-balancing command is run. A maximum of eight redirection
routes can be used for load balancing.
– To redirect the matched traffic to an SRv6 TE Policy, run the apply
redirect ipv6 redirect-ipv6-rt color colorvalue [ prefix-sid prefix-sid-
value ] command. This command must be used together with the local-
route redirect ipv6 recursive-lookup tunnel tunnel-selector tunnel-
selector-name command so that traffic recursion to the SRv6 TE Policy
can be triggered.
– To redirect the matched traffic to the IPv6 address of the specified next
hop for load balancing (a maximum of eight redirection paths are
supported for load balancing), run the apply redirect multi-ipv6
redirectIPv6 command.
– To redirect the matched traffic to SRv6 TE Policies for load balancing (a
maximum of eight redirection paths are supported for load balancing),
run the apply redirect multi-ipv6 redirectIPv6 [ color color-value ]
[ weight weight-value ] command.
– To re-mark the service class of the matched traffic, run the apply
remark-dscp command.
– To limit the rate of the matched traffic, run the apply traffic-rate
command.
– To implement sampling for the matched traffic, run the apply traffic-
action sample command.
You can run the apply traffic-action sample command for a BGP IPv6
Flow Specification route to sample the traffic that matches the specified
filtering rules. Through sampling, abnormal traffic can be identified and
filtered out, which protects the attacked device and improves network
security.
NOTE
The apply deny and apply traffic-rate commands are mutually exclusive.
If the configured BGP IPv6 Flow Specification route attribute does not need to take
effect locally, run the routing-table rib-only [ route-policy route-policy-name |
route-filter route-filter-name ] command to disable the device from delivering the
BGP IPv6 Flow Specification route to the FES forwarding table.
5. Run commit
BGP IPv6 Flow Specification peer relationships must be established between the
network ingress and device on which the BGP IPv6 Flow Specification route is
manually created.
1. Run system-view
Before configuring a Flow RR, establish a BGP IPv6 Flow Specification peer
relationship between the Flow RR and the device on which the BGP IPv6 Flow
Specification route is generated and between the Flow RR and every network
ingress.
1. Run system-view
If the clients of a Flow RR are fully meshed, you can run the undo reflect
between-clients command on the Flow RR to disable route reflection
between clients through the RR, which reduces costs.
6. (Optional) Run reflector cluster-id { cluster-id-value | cluster-id-ipv4 }
If a cluster has multiple Flow RRs, run this command to set the same cluster-
id for these RRs.
The device is disabled from validating BGP IPv6 Flow Specification routes
received from a specified peer.
5. Run commit
Step 5 (Optional) Enable CAR statistics collection and packet loss statistics collection for
BGP Flow Specification.
1. Run system-view
CAR statistics collection and packet loss statistics collection for BGP Flow
Specification are enabled.
3. Run commit
NOTE
Step 8 (Optional) Configure the device to redirect traffic to a specified IPv6 next hop
based on a static BGP IPv6 Flow Specification route.
1. Run system-view
The device is configured to redirect traffic to a specified IPv6 next hop based
on a static BGP IPv6 Flow Specification route.
5. Run commit
Step 9 (Optional) Allow the device to recurse static BGP IPv6 Flow Specification routes to
tunnels.
1. Run system-view
The device is allowed to recurse static BGP IPv6 Flow Specification routes to
tunnels.
5. Run commit
The configuration is committed.
Step 10 (Optional) Enable the DSCP-based BGP IPv6 Flow Specification traffic filtering
rule.
1. Run system-view
The system view is displayed.
2. Run flowspec allow ipv6 dscp
The DSCP-based BGP IPv6 Flow Specification traffic filtering rule is enabled.
3. Run commit
The configuration is committed.
Step 11 (Optional) Enable BGP Flow Specification to match inner packet information
about the packets that leave an SRv6 TE Policy or SRv6 BE egress.
1. Run system-view
The system view is displayed.
2. Run flowspec match srv6-inner-ip enable
BGP Flow Specification is enabled to match inner packet information about
the packets that leave an SRv6 TE Policy or SRv6 BE egress.
3. Run commit
The configuration is committed.
Step 12 (Optional) Enable BGP IPv6 Flow Specification to match the internal protocol
number in the header of an IPv6 fragment.
1. Run system-view
The system view is displayed.
2. Run flowspec match ipv6 fragment-inner-protocol enable
BGP IPv6 Flow Specification is enabled to match the internal protocol number
in the header of an IPv6 fragment.
3. Run commit
The configuration is committed.
Step 13 (Optional) Enable the device to redirect traffic to a specified IPv6 next hop based
on a static BGP Flow Specification route.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv6-family flow
The BGP-IPv6-Flow address family view is displayed.
The device is enabled to redirect traffic to a specified IPv6 next hop based on
a static BGP IPv6 Flow Specification route.
5. Run commit
----End
● Run the display bgp flow ipv6 peer command to check information about
the BGP IPv6 Flow Specification peer.
● Run the display bgp flow ipv6 routing-table command to check information
about BGP IPv6 Flow Specification routes.
● Run the display bgp flow ipv6 routing-table statistics command to check
statistics about BGP IPv6 Flow Specification routes.
● Run the display flowspec ipv6 statistics reIndex [ flow-interface-group
infGrpId ] command to check statistics about traffic matching a specified BGP
IPv6 Flow Specification route.
● Run the display flowspec ipv6 rule reindex-value slot slot-id command to
check information about combined rules in the BGP IPv6 Flow Specification
route rule table.
● Run the display flowspec ipv6 rule statistics slot slot-id command to check
statistics about the rules for BGP IPv6 Flow Specification routes to take effect.
● Run the display flowspec resource rule { ipv4 | ipv6 } [ interface-based ]
[ slot slot-id ] command to check the resource usage information about BGP
Flow Specification route rules.
Usage Scenario
When deploying dynamic BGP VPN Flow Specification, a BGP VPN Flow
Specification peer relationship needs to be established between the traffic analysis
server and each ingress of the network to transmit BGP VPN Flow Specification
routes.
If you want to filter traffic based on the address prefix but the BGP VPN Flow
Specification route carrying the filtering rule cannot pass validation, disable
validation of BGP VPN Flow Specification routes received from a specified peer.
Pre-configuration Tasks
Before configuring dynamic BGP VPN Flow Specification, complete the following
tasks:
● Configure a VPN instance and bind interfaces to the VPN instance.
Procedure
Step 1 Establish a BGP VPN Flow Specification peer relationship.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run vpn-instance vpn-instance-name
A BGP-VPN instance is created, and the BGP-VPN instance view is displayed.
4. Run peer ipv4-address as-number as-number
The IP address of a peer and the number of the AS where the peer resides are
specified.
5. Run quit
The BGP view is displayed.
6. Run ipv4-flow vpn-instance vpn-instance-name
The BGP-Flow VPN instance IPv4 address family is enabled, and the BGP-Flow
VPN instance IPv4 address family view is displayed.
7. Run peer ipv4-address enable
A BGP VPN Flow Specification peer is specified.
After the BGP VPN Flow Specification peer relationship is established in the
BGP-Flow VPN instance IPv4 address family view, the BGP VPN Flow
Specification route generated by the traffic analysis server is imported
automatically to the BGP routing table and then sent to the peer.
8. Run commit
The configuration is committed.
Step 2 (Optional) Configure a Flow RR.
Before configuring a Flow RR, establish a BGP VPN Flow Specification peer
relationship between the Flow RR and traffic analysis server, and between the
Flow RR and each network ingress.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-flow vpn-instance vpn-instance-name
NOTE
5. Run commit
The configuration is committed.
Step 4 (Optional) Disable BGP VPN Flow Specification route validation.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-flow vpn-instance vpn-instance-name
The BGP-Flow VPN instance IPv4 address family view is displayed.
4. Run peer ipv4-address validation-disable
The device is disabled from validating BGP VPN Flow Specification routes
received from a specified peer.
5. Run commit
The configuration is committed.
Step 5 (Optional) Allow the device to recurse the BGP VPN IPv6 Flow Specification routes
received from a peer to a tunnel.
1. Run system-view
The system view is displayed.
2. Run tunnel-selector name matchMode node node
A tunnel selector is created and its view is displayed.
3. Run quit
The system view is displayed.
4. Run commit
The configuration is committed.
5. Run bgp as-number
The BGP view is displayed.
6. Run ipv4-flow vpn-instance vpn-instance-name
The BGP-Flow VPN instance IPv4 address family view is displayed.
7. Run peer peerIpv4Addr redirect ipv6 recursive-lookup tunnel tunnel-
selector tunnel-selector-name
The device is configured to recurse the BGP VPN IPv4 Flow Specification route
received from the specified peer to a tunnel.
8. Run commit
The configuration is committed.
Step 6 (Optional) Disable the device from validating the next hop of each route that
carries the redirection next-hop attribute and is received from a specified EBGP
peer.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-flow vpn-instance vpn-instance-name
The BGP-Flow VPN instance IPv4 address family view is displayed.
4. Run peer ipv4-address redirect ip validation-disable
The device is disabled from validating the next hop of each route that carries
the redirection next-hop attribute and is received from a specified EBGP peer.
5. Run commit
The configuration is committed.
Step 7 (Optional) Configure a redirection next-hop attribute ID for BGP VPN Flow
Specification routes.
The redirection next-hop attribute ID can be 0x010C (defined in a related RFC) or
0x0800 (defined in a related draft). If a Huawei device needs to communicate with
a non-Huawei device that does not support the redirection next-hop attribute ID
of 0x010C or 0x0800, set the redirection next-hop attribute ID of BGP VPN Flow
Specification routes as required. Perform one of the following configurations based
on the ID supported by non-Huawei devices:
NOTE
Step 13 (Optional) Enable BGP Flow Specification to match inner packet information
about the packets that leave an SRv6 TE Policy or SRv6 BE egress.
1. Run system-view
----End
Usage Scenario
When deploying static BGP VPN Flow Specification, a BGP VPN Flow Specification
route needs to be generated manually, and a BGP VPN Flow Specification peer
relationship needs to be established between the device that generates the BGP
VPN Flow Specification route and each ingress in the network to transmit BGP
VPN Flow Specification routes.
In an AS with multiple ingresses, a BGP VPN Flow route reflector (Flow RR) can be
deployed to reduce the number of BGP VPN Flow Specification peer relationships
and save network resources.
If you want to filter traffic based on the address prefix but the BGP VPN Flow
Specification route carrying the filtering rule cannot pass validation, disable the
validation of BGP VPN Flow Specification routes received from a specified peer.
Pre-configuration Tasks
Before configuring static BGP VPN Flow Specification, configure a VPN instance
and bind interfaces to a VPN instance.
Procedure
Step 1 Generate a BGP VPN Flow Specification route manually.
1. Run system-view
The system view is displayed.
2. Run flow-route flowroute-name vpn-instance vpn-instance-name
A static BGP VPN Flow Specification route is created, and the Flow-Route VPN
instance view is displayed.
One BGP VPN Flow Specification route can include multiple if-match and
apply clauses. if-match clauses define traffic filtering rules, and apply clauses
define traffic behaviors. The relationships among clauses are as follows:
– The relationship among if-match clauses of different types is "AND."
– If if-match clauses of the same type are configured repeatedly, some
rules override each other, and some other rules are in the OR
relationship. For details, see the precautions for the if-match command.
– The relationship among the traffic behaviors defined by apply clauses is
"AND."
The traffic behaviors defined by apply clauses apply to all traffic matching the
filtering rules of if-match clauses.
3. Based on the characteristics of the traffic to be controlled, choose one or
multiple if-match clauses as the filtering rule.
– To set a destination address-based traffic filtering rule, run the if-match
destination ipv4-address { mask | mask-length } command.
NOTE
– To set a port number-based traffic filtering rule, run the if-match port
{ greater-than | less-than | equal } port or if-match port greater-than
port less-than upper-port-value command.
– To set a source port number-based traffic filtering rule, run the if-match
source-port { greater-than | less-than | equal } port or if-match
source-port greater-than source-port less-than upper-source-port-value
command.
– To set a destination port number-based traffic filtering rule, run the if-
match destination-port { greater-than | less-than | equal } port or if-
match destination-port greater-than port less-than upper-port-value
command.
NOTE
The device can process the redirection next hop attribute configured using the
apply redirect ip redirect-ip-rt command received from a peer only after the
peer redirect ip command is run.
– To redirect the matched traffic to an SRv6 TE Policy, run the apply
redirect ipv6 redirect-ipv6-rt color colorvalue [ prefix-sid prefix-sid-
value ] command.
– To re-mark the service class of the matched traffic, run the apply
remark-dscp command.
– To limit the rate of the matched traffic, run the apply traffic-rate
command.
– To implement sampling for the matched traffic, run the apply traffic-
action sample command.
You can run the apply traffic-action sample command for a BGP VPN
Flow Specification route to sample the traffic that matches the specified
filtering rules. Through sampling, abnormal traffic can be identified and
filtered out, which protects the attacked device and improves network
security.
NOTE
The apply deny and apply traffic-rate commands are mutually exclusive.
If the configured BGP VPN Flow Specification route attribute does not need to take
effect locally, run the routing-table rib-only [ route-policy route-policy-name |
route-filter route-filter-name ] command to disable the device from delivering the
BGP VPN Flow Specification route to the FES forwarding table.
5. Run commit
The configuration is committed.
Step 2 Establish a BGP VPN Flow Specification peer relationship.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run vpn-instance vpn-instance-name
A BGP-VPN instance is created, and its view is displayed.
4. Run peer ipv4-address as-number as-number
An IP address and AS number are specified for the peer.
5. Run quit
The BGP view is displayed.
6. Run ipv4-flow vpn-instance vpn-instance-name
The BGP-Flow VPN instance IPv4 address family is enabled, and its view is
displayed.
5. Run commit
The configuration is committed.
Step 5 (Optional) Disable BGP VPN Flow Specification route validation.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-flow vpn-instance vpn-instance-name
The BGP-Flow VPN instance IPv4 address family view is displayed.
4. Run peer ipv4-address validation-disable
The device is disabled from validating BGP VPN Flow Specification routes
received from a specified peer.
5. Run commit
The configuration is committed.
Step 6 (Optional) Disable the device from validating the routes that carry a redirection
extended community attribute and are received from a specified EBGP peer.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-flow vpn-instance vpn-instance-name
The BGP-Flow VPN instance IPv4 address family view is displayed.
4. Run peer ipv4-address redirect ip validation-disable
The device is disabled from validating the routes that carry a redirection
extended community attribute and are received from a specified EBGP peer.
5. Run commit
The configuration is committed.
Step 7 (Optional) Configure a redirection next-hop attribute ID for BGP VPN Flow
Specification routes.
The redirection next-hop attribute ID can be 0x010C (defined in a related RFC) or
0x0800 (defined in a related draft). If a Huawei device needs to communicate with
a non-Huawei device that does not support the redirection next-hop attribute ID
of 0x010C or 0x0800, set the redirection next-hop attribute ID of BGP VPN Flow
Specification routes as required. Perform one of the following configurations based
on the ID supported by non-Huawei devices:
● Set the redirection next-hop attribute ID to 0x010C (defined in a related RFC)
for BGP VPN Flow Specification routes.
a. Run system-view
The system view is displayed.
Step 8 (Optional) Enable CAR statistics collection and packet loss statistics collection for
BGP Flow Specification.
1. Run system-view
CAR statistics collection and packet loss statistics collection are enabled for
BGP Flow Specification.
3. Run commit
NOTE
Step 11 (Optional) Enable the device to follow RFC 5575 when dealing with BGP Flow
Specification IPv4 fragmentation rules.
1. Run system-view
The device is enabled to follow RFC 5575 when dealing with BGP Flow
Specification IPv4 fragmentation rules.
3. Run commit
Step 12 (Optional) Enable BGP Flow Specification to match inner packet information
about the packets that leave an SRv6 TE Policy or SRv6 BE egress.
1. Run system-view
----End
Usage Scenario
When deploying dynamic BGP IPv6 VPN Flow Specification, a BGP IPv6 VPN Flow
Specification peer relationship needs to be established between the traffic analysis
server and each ingress of the network to transmit BGP IPv6 VPN Flow
Specification routes.
In an AS with multiple ingresses, a Flow RR can be deployed to reduce the number
of BGP IPv6 VPN Flow Specification peer relationships and save network resources.
If you want to filter traffic based on the address prefix but the BGP IPv6 VPN Flow
Specification route carrying the filtering rule cannot pass validation, disable
validation of BGP IPv6 VPN Flow Specification routes received from a specified
peer.
Pre-configuration Tasks
Before configuring dynamic BGP IPv6 VPN Flow Specification, complete the
following tasks:
● Configure a VPN instance and bind interfaces to the VPN instance.
Procedure
Step 1 Establish a BGP IPv6 VPN Flow Specification peer relationship.
1. Run system-view
The system view is displayed.
A peer IP address and the number of the AS where the peer resides are
specified.
5. Run quit
The BGP-Flow VPN instance IPv6 address family is enabled, and the BGP-Flow
VPN instance IPv6 address family view is displayed.
7. Run peer { ipv4-address | ipv6-address } enable
After the peer relationship is established in the BGP-Flow VPN instance IPv6
address family view, the BGP IPv6 VPN Flow Specification route generated by
the traffic analysis server is imported automatically to the BGP routing table
and then sent to the peer.
8. Run commit
Before configuring a Flow RR, establish a BGP IPv6 VPN Flow Specification peer
relationship between the Flow RR and traffic analysis server, and between the
Flow RR and each network ingress.
1. Run system-view
If the clients of a Flow RR are fully meshed, you can run the undo reflect
between-clients command on the Flow RR to disable route reflection
between clients through the RR, which reduces costs.
6. (Optional) Run reflector cluster-id { cluster-id-value | cluster-id-ipv4 }
A cluster ID is configured for the Flow RR.
If a cluster has multiple flow RRs, run this command to set the same cluster-
id for these RRs.
NOTE
5. Run commit
The configuration is committed.
Step 4 (Optional) Disable BGP IPv6 VPN Flow Specification route validation.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv6-flow vpn-instance vpn-instance-name
The BGP-Flow VPN instance IPv6 address family view is displayed.
4. Run peer { ipv4-address | ipv6-address } validation-disable
The device is disabled from validating BGP IPv6 VPN Flow Specification routes
received from a specified peer.
5. Run commit
The configuration is committed.
Step 5 (Optional) Disable BGP Flow Specification protection.
1. Run system-view
The system view is displayed.
2. Run flowspec protocol-protect { ipv4 | ipv6 } disable
BGP Flow Specification protection is disabled.
3. Run commit
The configuration is committed.
Step 6 (Optional) Configure the device to redirect traffic to a specified IPv6 next hop
after receiving a BGP VPN IPv6 Flow Specification route from a peer.
1. Run system-view
The device is configured to redirect traffic to a specified IPv6 next hop after
receiving a BGP VPN IPv6 Flow Specification route from a peer.
5. Run commit
Step 7 (Optional) Allow the device to recurse the BGP VPN IPv6 Flow Specification routes
received from a peer to a tunnel.
1. Run system-view
The device is allowed to recurse the BGP VPN IPv6 Flow Specification routes
received from a peer to a tunnel.
8. Run commit
Step 8 (Optional) Disable the device from validating the redirection next-hop attribute
carried in the routes that are received from an EBGP peer.
1. Run system-view
Step 12 (Optional) Enable BGP IPv6 Flow Specification to match the internal protocol
number in the header of an IPv6 fragment.
1. Run system-view
BGP IPv6 Flow Specification is enabled to match the internal protocol number
in the header of an IPv6 fragment.
3. Run commit
----End
Usage Scenario
When deploying static BGP IPv6 VPN Flow Specification, a BGP IPv6 VPN Flow
Specification route needs to be generated manually, and a BGP IPv6 VPN Flow
Specification peer relationship needs to be established between the device that
generates the BGP IPv6 VPN Flow Specification route and each ingress in the
network to transmit BGP IPv6 VPN Flow Specification routes.
In an AS with multiple ingresses, a BGP IPv6 VPN Flow route reflector (Flow RR)
can be deployed to reduce the number of BGP IPv6 VPN Flow Specification peer
relationships and save network resources.
If you want to filter traffic based on the address prefix but the BGP IPv6 VPN Flow
Specification route carrying the filtering rule cannot pass validation, disable the
validation of BGP IPv6 VPN Flow Specification routes received from a specified
peer.
Pre-configuration Tasks
Before configuring static BGP IPv6 VPN Flow Specification, configure a VPN
instance and bind interfaces to a VPN instance.
Procedure
Step 1 Generate a BGP IPv6 VPN Flow Specification route manually.
1. Run system-view
The system view is displayed.
2. Run flow-route flowroute-name ipv6 vpn-instance vpn-instance-name
A static BGP IPv6 VPN Flow Specification route is created, and the Flow-Route
IPv6 VPN instance view is displayed.
One BGP IPv6 VPN Flow Specification route can include multiple if-match
and apply clauses. if-match clauses define traffic filtering rules, and apply
clauses define traffic behaviors. The relationships among clauses are as
follows:
– The relationship among if-match clauses of different types is "AND."
– If if-match clauses of the same type are configured repeatedly, some
rules override each other, and some other rules are in the OR
relationship. For details, see the precautions for the if-match command.
– The relationship among the traffic behaviors defined by apply clauses is
"AND."
The traffic behaviors defined by apply clauses apply to all traffic matching the
filtering rules of if-match clauses.
3. According to characteristics of the traffic to be controlled, you can configure
one or more if-match clauses to define traffic filtering rules as needed:
– To set a destination address-based traffic filtering rule, run the if-match
destination ipv6-address { mask | mask-length } command.
NOTE
– To configure a filtering rule based on the source address, run the if-
match source ipv6-address { mask | mask-length } command.
– To set a port number-based traffic filtering rule, run the if-match port
{ greater-than | less-than | equal } port or if-match port greater-than
port less-than upper-port-value command.
– To set a source port number-based traffic filtering rule, run the if-match
source-port { greater-than | less-than | equal } port or if-match
source-port greater-than source-port less-than upper-source-port-value
command.
– To set a destination port number-based traffic filtering rule, run the if-
match destination-port { greater-than | less-than | equal } port or if-
match destination-port greater-than port less-than upper-port-value
command.
NOTE
The apply deny and apply traffic-rate commands are mutually exclusive.
If the configured BGP IPv6 VPN Flow Specification route attribute does not need to
take effect locally, run the routing-table rib-only [ route-policy route-policy-name |
route-filter route-filter-name ] command to disable the device from delivering the
BGP IPv6 VPN Flow Specification route to the FES forwarding table.
5. Run commit
The configuration is committed.
Step 2 Establish a BGP IPv6 VPN Flow Specification peer relationship.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run vpn-instance vpn-instance-name
A BGP-VPN instance is created, and its view is displayed.
4. Run peer { ipv4-address | ipv6-address } as-number as-number
An IP address and AS number are specified for the peer.
5. Run quit
The BGP view is displayed.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv6-flow vpn-instance vpn-instance-name
The BGP-Flow VPN instance IPv6 address family view is displayed.
4. Run route validation-mode include-as
The device is configured to check the AS_Path attribute during BGP IPv6 VPN
Flow Specification route validation.
BGP Flow Specification route validation is performed in either of the following
modes:
– Validation mode 1: After receiving a BGP Flow Specification route with a
destination address-based filtering rule, the device checks the validity of
the route using the rules described in Figure 1-32. The route is
considered valid only if the validation succeeds.
– Validation mode 2: After receiving a BGP Flow Specification route with a
destination address-based filtering rule, the device checks the validity of
the route by checking whether the AS_Path attribute of the route carries
the AS_Set and AS_Sequence fields. The route is considered valid only if
its AS_Path attribute does not carry the AS_Set or AS_Sequence field.
Validation mode 2 is configured using the route validation-mode include-as
command. If this command is configured, the device checks the validity of a
BGP Flow Specification route using mode 2 first.
– If the validation succeeds, the BGP Flow Specification route is considered
valid, and mode 1 is not used.
– If the validation fails, the device checks the validity of the BGP Flow
Specification route using mode 1.
If this command is not run, the device uses mode 1 to check the validity of
BGP Flow Specification routes.
5. Run commit
The configuration is committed.
Step 5 (Optional) Disable BGP IPv6 VPN Flow Specification route validation.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv6-flow vpn-instance vpn-instance-name
The BGP-Flow VPN instance IPv6 address family view is displayed.
4. Run peer { ipv4-address | ipv6-address } validation-disable
The device is disabled from validating BGP IPv6 VPN Flow Specification routes
received from a specified peer.
5. Run commit
The configuration is committed.
Step 6 (Optional) Disable BGP Flow Specification protection.
1. Run system-view
The system view is displayed.
2. Run flowspec protocol-protect { ipv4 | ipv6 } disable
BGP Flow Specification protection is disabled.
3. Run commit
The configuration is committed.
Step 7 (Optional) Configure the device to redirect traffic to a specified IPv6 next hop
based on a static BGP VPN IPv6 Flow Specification route.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv6-flow vpn-instance vpn-instance-name
The BGP-Flow VPN instance IPv6 address family view is displayed.
4. Run local-route redirect ipv6 recursive-lookup ip
The device is configured to redirect traffic to a specified IPv6 next hop based
on a static BGP VPN IPv6 Flow Specification route.
5. Run commit
The configuration is committed.
Step 8 (Optional) Allow the device to recurse static BGP VPN IPv6 Flow Specification
routes to tunnels.
1. Run system-view
Step 9 (Optional) Enable the DSCP-based BGP IPv6 Flow Specification traffic filtering
rule.
1. Run system-view
The DSCP-based BGP IPv6 Flow Specification traffic filtering rule is enabled.
3. Run commit
Step 10 (Optional) Enable BGP Flow Specification to match inner packet information
about the packets that leave an SRv6 TE Policy or SRv6 BE egress.
1. Run system-view
Step 11 (Optional) Enable BGP IPv6 Flow Specification to match the internal protocol
number in the header of an IPv6 fragment.
1. Run system-view
BGP IPv6 Flow Specification is enabled to match the internal protocol number
in the header of an IPv6 fragment.
3. Run commit
----End
Usage Scenario
Before deploying dynamic BGP VPNv4 Flow Specification, you need to establish a
BGP VPNv4 Flow Specification peer relationship between the traffic analysis server
and each ingress of the network to transmit BGP VPNv4 Flow Specification routes.
Pre-configuration Tasks
Before configuring dynamic BGP VPNv4 Flow Specification, complete the following
tasks:
Procedure
Step 1 Establish a BGP VPNv4 Flow Specification peer relationship.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run peer ipv4-address as-number as-number
The IP address of a peer and the number of the AS where the peer resides are
specified.
4. Run ipv4-flow vpnv4
The BGP-Flow VPNv4 address family is enabled, and the BGP-Flow VPNv4
address family view is displayed.
5. Run peer ipv4-address enable
A BGP VPNv4 Flow Specification peer is specified.
6. Run commit
The configuration is committed.
Step 2 (Optional) Configure a Flow RR.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-flow vpnv4
The BGP-Flow VPNv4 address family is enabled, and the BGP-Flow VPNv4
address family view is displayed.
4. Run peer ipv4-address reflect-client
A Flow RR is configured, and clients are specified for it.
The router on which the peer reflect-client command is run functions as a
Flow RR, and the network ingress and traffic analysis server function as
clients.
5. (Optional) Run undo reflect between-clients
Route reflection between clients through the RR is disabled.
If the clients of a Flow RR are fully meshed, you can run the undo reflect
between-clients command on the Flow RR to disable route reflection
between clients through the RR, which reduces costs.
6. (Optional) Run reflector cluster-id { cluster-id-value | cluster-id-ipv4 }
A cluster ID is configured for the Flow RR.
If a cluster has multiple flow RRs, run this command to set the same cluster-
id for these RRs.
NOTE
7. Run commit
Step 3 (Optional) Configure the redirection next-hop attribute ID for BGP VPNv4 Flow
Specification routes.
----End
● Run the display flowspec rule statistics slot slot-id command to check
statistics about the rules for BGP Flow Specification routes to take effect.
● Run the display flowspec resource rule { ipv4 | ipv6 } [ interface-based ]
[ slot slot-id ] command to check the resource usage information about BGP
Flow Specification route rules.
Usage Scenario
To deploy static BGP VPNv4 Flow Specification, a BGP VPN Flow Specification
route needs to be created manually first. After the BGP-Flow VPNv4 address
family is enabled, a BGP VPNv4 Flow Specification route is generated
automatically. Then a BGP VPNv4 Flow Specification peer relationship needs be
established between the device on which the BGP VPN Flow Specification route is
created and the network ingress device to transmit the BGP VPNv4 Flow
Specification route.
In an AS with multiple ingresses, a BGP VPNv4 Flow route reflector (Flow RR) can
be deployed to reduce the number of BGP VPN Flow Specification peer
relationships and save network resources.
Pre-configuration Tasks
Before configuring static BGP VPNv4 Flow Specification, complete the following
tasks:
Procedure
Step 1 Generate a BGP VPN Flow Specification route manually.
1. Run system-view
A static BGP VPN Flow Specification route is created, and the Flow-Route VPN
instance view is displayed.
One BGP VPN Flow Specification route can include multiple if-match and
apply clauses. if-match clauses define traffic filtering rules, and apply clauses
define traffic behaviors. The relationships among clauses are as follows:
– The relationship among if-match clauses of different types is "AND."
– If if-match clauses of the same type are configured repeatedly, some
rules override each other, and some other rules are in the OR
relationship. For details, see the precautions for the if-match command.
– To configure a filtering rule based on the packet length of BGP VPN Flow
Specification routes, run the if-match packet-length { greater-than |
less-than | equal } packet-length-value command.
4. Run the following command as required to configure actions for apply
clauses:
– To discard the matched traffic, run the apply deny command.
– To redirect the matching traffic to the traffic cleaning device or blackhole,
run the apply redirect { vpn-target vpn-target-import | ip redirect-ip-rt }
command.
NOTE
The device can process the redirection next hop attribute configured using the
apply redirect ip redirect-ip-rt command received from a peer only after the
peer redirect ip command is run.
– To re-mark the service class of the matching traffic, run the apply
remark-dscp command.
– To limit the rate of the matched traffic, run the apply traffic-rate
command.
NOTE
The apply deny and apply traffic-rate commands are mutually exclusive.
If the configured BGP VPN Flow Specification route attribute does not need to take
effect locally, run the routing-table rib-only [ route-policy route-policy-name |
route-filter route-filter-name ] command to disable the device from delivering the
BGP VPN Flow Specification route to the FES forwarding table.
5. Run commit
The configuration is committed.
Step 2 Establish a BGP VPNv4 Flow Specification peer relationship.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run peer ipv4-address as-number as-number
An IP address and AS number are specified for the peer.
4. Run ipv4-flow vpnv4
The BGP-Flow VPNv4 address family is enabled, and its view is displayed.
5. Run peer ipv4-address enable
A BGP VPNv4 Flow Specification peer relationship is established.
6. Run commit
The configuration is committed.
Step 3 (Optional) Configure a Flow RR.
Before configuring a Flow RR, establish a BGP VPNv4 Flow Specification peer
relationship between the Flow RR with the device that generates the BGP VPN
Flow Specification route and every ingress.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv4-flow vpnv4
The BGP-Flow VPNv4 address family is enabled, and its view is displayed.
4. Run peer ipv4-address reflect-client
A Flow RR is configured, and clients are specified for it.
The router on which the peer reflect-client command is run functions as a
Flow RR, and the specified peers function as clients.
5. (Optional) Run undo reflect between-clients
Route reflection between clients through the RR is disabled.
If the clients of a Flow RR are fully meshed, you can run the undo reflect
between-clients command on the Flow RR to disable route reflection
between clients through the RR, which reduces costs.
6. (Optional) Run reflector cluster-id { cluster-id-value | cluster-id-ipv4 }
A cluster ID is configured for the Flow RR.
If a cluster has multiple flow RRs, run this command to set the same cluster-
id for these RRs.
The reflector cluster-id command is applicable only to Flow RRs.
7. Run commit
The configuration is committed.
Step 4 (Optional) Configure the redirection next-hop attribute ID for BGP VPNv4 Flow
Specification routes.
The redirection next-hop attribute ID can be 0x010C (defined in a related RFC) or
0x0800 (defined in a related draft). If a Huawei device needs to communicate with
a non-Huawei device that does not support the redirection next-hop attribute ID
of 0x010C or 0x0800, set the redirection next-hop attribute ID of BGP VPNv4 Flow
Specification routes as required. Perform one of the following configurations based
on the ID supported by non-Huawei devices:
● Set the redirection next-hop attribute ID to 0x010C (defined in a related RFC)
for BGP VPNv4 Flow Specification routes.
a. Run system-view
The system view is displayed.
b. Run bgp as-number
The BGP view is displayed.
c. Run ipv4-flow vpnv4
The BGP-Flow VPNv4 address family is enabled, and the BGP-Flow VPNv4
address family view is displayed.
d. Run peer ipv4-address redirect ip rfc-compatible
Step 6 (Optional) Enable the device to follow RFC 5575 when dealing with BGP Flow
Specification IPv4 fragmentation rules.
1. Run system-view
BGP Flow Specification IPv4 fragmentation rules are enabled to comply with
RFC 5575.
3. Run commit
Step 7 (Optional) Enable BGP Flow Specification to match inner packet information
about the packets that leave an SRv6 TE Policy or SRv6 BE egress.
1. Run system-view
----End
● Run the display bgp flow vpnv4 all peer [ [ ipv4-address ] verbose ]
command to check information about all BGP VPN Flow Specification peers
and BGP VPNv4 Flow Specification peers.
● Run the display bgp flow vpnv4 { all | route-distinguisher route-
distinguisher } routing-table [ reindex ] command to check information
about all BGP VPN Flow Specification routes and BGP VPNv4 Flow
Specification routes or the BGP VPN Flow Specification routes and BGP VPNv4
Flow Specification routes with a specified RD.
● Run the display bgp flow vpnv4 { all | route-distinguisher route-
distinguisher } routing-table statistics command to check statistics about all
BGP VPN Flow Specification routes and BGP VPNv4 Flow Specification routes
or the BGP VPN Flow Specification routes and BGP VPNv4 Flow Specification
routes with a specified RD.
● Run the display flowspec rule reindex-value slot slot-id command to check
information about combined rules in the local BGP Flow Specification rule
table.
● Run the display flowspec rule statistics slot slot-id command to check
statistics about the rules for BGP Flow Specification routes to take effect.
● Run the display flowspec resource rule { ipv4 | ipv6 } [ interface-based ]
[ slot slot-id ] command to check the resource usage information about BGP
Flow Specification route rules.
Usage Scenario
When deploying dynamic BGP VPNv6 Flow Specification, a BGP VPNv6 Flow
Specification peer relationship needs to be established between the traffic analysis
server and each ingress of the network to transmit BGP VPNv6 Flow Specification
routes.
Pre-configuration Tasks
Before configuring dynamic BGP VPNv6 Flow Specification, complete the following
tasks:
● Configure BGP peer relationships.
Procedure
Step 1 Establish a BGP VPNv6 Flow Specification peer relationship.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run peer ipv4-address as-number as-number
The IP address of a peer and the number of the AS where the peer resides are
specified.
4. Run ipv6-flow vpnv6
The BGP-Flow VPNv6 address family is enabled, and the BGP-Flow VPNv6
address family view is displayed.
5. Run peer ipv4-address enable
A BGP VPNv6 Flow Specification peer is specified.
6. Run commit
The configuration is committed.
Step 2 (Optional) Configure a Flow RR.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv6-flow vpnv6
The BGP-Flow VPNv6 address family is enabled, and the BGP-Flow VPNv6
address family view is displayed.
4. Run peer ipv4-address reflect-client
A Flow RR is configured, and clients are specified for it.
The router on which the peer reflect-client command is run functions as a
Flow RR, and the network ingress and traffic analysis server function as
clients.
5. (Optional) Run undo reflect between-clients
Route reflection between clients through the RR is disabled.
If the clients of a Flow RR are fully meshed, you can run the undo reflect
between-clients command on the Flow RR to disable route reflection
between clients through the RR, which reduces costs.
NOTE
BGP IPv6 Flow Specification is enabled to match the internal protocol number
in the header of an IPv6 fragment.
3. Run commit
The configuration is committed.
----End
Usage Scenario
To deploy static BGP VPNv6 Flow Specification, create a BGP IPv6 VPN Flow
Specification route first, and then establish a BGP VPNv6 Flow Specification peer
relationship between the device on which the BGP IPv6 VPN Flow Specification
route is created and the network ingress to transmit the BGP VPNv6 Flow
Specification route.
In an AS with multiple ingresses, a BGP Flow route reflector (Flow RR) can be
deployed to reduce the number of BGP VPNv6 Flow Specification peer
relationships and save network resources.
If you want to filter traffic based on an address prefix and the BGP VPNv6 Flow
Specification route carrying the filtering rule cannot pass validation, disable the
validation of the BGP VPNv6 Flow Specification routes received from a specified
peer.
Pre-configuration Tasks
Before configuring static BGP VPNv6 Flow Specification, configure a VPN instance
and bind an interface to the VPN instance.
Procedure
Step 1 Create a BGP IPv6 VPN Flow Specification route.
1. Run system-view
The system view is displayed.
2. Run flow-route flowroute-name ipv6 vpn-instance vpn-instance-name
A static BGP IPv6 VPN Flow Specification route is created, and the Flow-Route
IPv6 VPN instance view is displayed.
One BGP IPv6 VPN Flow Specification route can include multiple if-match
and apply clauses. if-match clauses define traffic filtering rules, and apply
clauses define traffic behaviors. The relationships among clauses are as
follows:
– The relationship among if-match clauses of different types is "AND."
– If if-match clauses of the same type are configured repeatedly, some
rules override each other, and some other rules are in the OR
relationship. For details, see the precautions for the if-match command.
– The relationship among the traffic behaviors defined by apply clauses is
"AND."
The traffic behaviors defined by apply clauses apply to all traffic matching the
filtering rules of if-match clauses.
3. According to characteristics of the traffic to be controlled, you can configure
one or more if-match clauses to define traffic filtering rules as needed:
– To set a traffic filtering rule that is based on a destination IP address, run
the if-match destination ipv6-address { mask | mask-length } command.
NOTE
NOTE
The apply deny and apply traffic-rate commands are mutually exclusive.
If a configured BGP IPv6 VPN Flow Specification route does not need to take effect
locally, you can run the routing-table rib-only [ route-policy route-policy-name |
route-filter route-filter-name ] command to disable the device from delivering the
BGP IPv6 VPN Flow Specification route to the FES forwarding table.
5. Run commit
The configuration is committed.
Step 2 Establish a BGP VPNv6 Flow Specification peer relationship.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run vpn-instance vpn-instance-name
A BGP-VPN instance is created, and its view is displayed.
4. Run peer { ipv4-address | ipv6-address } as-number as-number
An IP address and AS number are specified for the peer.
5. Run quit
The BGP view is displayed.
6. Run ipv6-flow vpnv6
The BGP-Flow VPNv6 address family is enabled, and its view is displayed.
7. Run peer { ipv4-address | ipv6-address } enable
A BGP VPNv6 Flow Specification peer relationship is established.
After the BGP VPNv6 Flow Specification peer relationship is established in the
BGP-Flow VPNv6 address family view, the BGP IPv6 VPN Flow Specification
route generated by the traffic analysis server is imported automatically to the
BGP routing table and then sent to the peer.
8. Run commit
The configuration is committed.
Step 3 (Optional) Configure a Flow RR.
Before configuring a Flow RR, establish a BGP VPNv6 Flow Specification peer
relationship between the Flow RR and device on which the BGP IPv6 VPN Flow
Specification route is generated, and between the Flow RR and each network
ingress.
1. Run system-view
The system view is displayed.
2. Run bgp as-number
The BGP view is displayed.
3. Run ipv6-flow vpnv6
The BGP-Flow VPNv6 address family is enabled, and its view is displayed.
4. Run peer { ipv4-address | ipv6-address } reflect-client
If the clients of a Flow RR are fully meshed, you can run the undo reflect
between-clients command on the Flow RR to disable route reflection
between clients through the RR, which reduces costs.
6. (Optional) Run reflector cluster-id { cluster-id-value | cluster-id-ipv4 }
If a cluster has multiple Flow RRs, run this command to set the same cluster-
id for these RRs.
The reflector cluster-id command is applicable only to Flow RRs.
7. Run commit
Step 5 (Optional) Enable the DSCP-based BGP IPv6 Flow Specification traffic filtering
rule.
1. Run system-view
The DSCP-based BGP IPv6 Flow Specification traffic filtering rule is enabled.
3. Run commit
Step 6 (Optional) Enable BGP Flow Specification to match inner packet information
about the packets that leave an SRv6 TE Policy or SRv6 BE egress.
1. Run system-view
Usage Scenario
BMP is mainly used on a network where a monitoring server exists and the BGP
status of devices on the network needs to be monitored. The status includes the
Pre-configuration Tasks
Before configuring BMP, complete the following tasks:
● Configure basic BGP functions.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run bmp
BMP is enabled, and the BMP view is displayed.
Step 3 (Optional) Run statistics-timer time
An interval at which the BMP device sends BGP running statistics to a monitoring
server is configured.
You can configure the interval at which the BMP device sends BGP running
statistics to a monitoring server based on BGP stability requirements. Generally, if
high network quality is required, you need to set a small interval for reporting the
statistics. However, if the statistics are frequently reported, some network
bandwidth resources are occupied.
By default, the interval at which the BMP device reports BGP running statistics to
a monitoring server is 3600s. Using the default interval is recommended.
Step 4 Run bmp-session [ vpn-instance vrf-name ] ipv4-address [ alias alias-name ]
An IPv4 session address is specified for the TCP connection to be established
between the BMP device and the monitoring server.
alias alias-name specifies a session alias. If the device needs to establish TCP
connections with monitoring servers that have the same destination IP address but
different destination port numbers, specify different values for the alias alias-
name parameter to differentiate the connections.
Step 5 Run one of the following commands to enter the BMP-Monitor view:
● monitor public: displays the BMP-Monitor view and allows the status of all
BGP peers in public address families to be monitored.
● monitor vpn-instance: displays the BMP-Monitor view and allows the status
of all BGP peers in address families of a specified VPN instance to be
monitored.
Step 6 Run route-mode ipv4-family flow local-rib [ report route-identifier ]
The BMP device is configured to send statistics about Local-RIB routes of BGP
peers in the BGP-Flow address family to the monitoring server.
Step 7 Run quit
Return to the BMP session view.
----End
Usage Scenario
Without BMP, you have to run a query command on a BGP4+ device if you want
to learn the BGP4+ running status of the device, which is inconvenient. To improve
the network monitoring efficiency, you can configure BMP so that the BGP4+
running status of a client can be monitored by servers.
Pre-configuration Tasks
Before configuring BMP, configure basic BGP4+ functions.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run bmp
BMP is enabled, and the BMP view is displayed.
Step 3 (Optional) Run statistics-timer time
An interval at which the BMP device sends BGP4+ running statistics to a
monitoring server is configured.
You can configure the interval at which the BMP device sends BGP4+ running
statistics to a monitoring server based on BGP4+ stability requirements. Generally,
if high network quality is required, you need to set a small interval for reporting
the statistics. However, if the statistics are frequently reported, some network
bandwidth resources are occupied.
By default, the interval at which the BMP device reports BGP4+ running statistics
to a monitoring server is 3600s. Using the default interval is recommended.
alias alias-name specifies a session alias. If the device needs to establish TCP
connections with monitoring servers that have the same destination IPv6 address
but different destination port numbers, specify different values for the alias alias-
name parameter to differentiate the connections.
Step 5 Run one of the following commands to enter the BMP-Monitor view:
● monitor public: displays the BMP-Monitor view and allows the status of all
BGP4+ peers in public address families to be monitored.
● monitor vpn-instance: displays the BMP-Monitor view and allows the status
of all BGP4+ peers in address families of a specified VPN instance to be
monitored.
The BMP device is configured to send statistics about Local-RIB routes of BGP4+
peers in the BGP-IPv6-Flow address family to the monitoring server.
----End
Networking Requirements
On the network shown in Figure 1-33, DeviceA belongs to AS 100; DeviceB,
DeviceC, and Server belong to AS 200; DeviceB is the ingress of AS 200. AS 100
and AS 200 communicate with each other through DeviceB.
When an attack source appears in AS 100, attack traffic flows into AS 200 through
DeviceB, posing a threat to AS 200. To ensure network security, configure dynamic
BGP Flow Specification. Specifically, deploy a traffic analysis server on the network
and establish a BGP Flow Specification peer relationship between the traffic
analysis server and DeviceB. DeviceB periodically samples traffic and sends
sampled traffic to the traffic analysis server. The traffic analysis server generates a
BGP Flow Specification route based on the characteristics of sampled attack traffic
and sends the route to DeviceB. DeviceB converts the route into a traffic policy to
filter and control attack traffic, ensuring the normal running of services in AS 200.
In this example, interface1, interface2, and interface3 represent GE1/0/0, GE2/0/0, and
GE3/0/0, respectively.
Precautions
None
Configuration Roadmap
The configuration roadmap is as follows:
The traffic analysis server is a third-party device and must be able to establish BGP
Flow Specification peer relationships.
Data Preparation
To complete the configuration, you need the following data:
● Router IDs of DeviceA and DeviceB (1.1.1.1 and 2.2.2.2, respectively)
● AS number of DeviceA: 100; AS number of DeviceB, DeviceC, and Server: 200
Procedure
Step 1 Configure IP addresses for interfaces.
For configuration details, see the configuration files.
Step 2 Establish a BGP Flow Specification peer relationship and disable route validation.
# Configure DeviceB.
[~DeviceB] bgp 200
[*DeviceB-bgp] peer 10.2.1.2 as-number 200
[*DeviceB-bgp] ipv4-family flow
[*DeviceB-bgp-af-ipv4-flow] peer 10.2.1.2 enable
[*DeviceB-bgp-af-ipv4-flow] peer 10.2.1.2 validation-disable
[*DeviceB-bgp-af-ipv4-flow] commit
[~DeviceB-bgp-af-ipv4-flow] quit
[~DeviceB-bgp] quit
* > ReIndex : 97
Dissemination Rules:
FragmentType : match (Don't fragment)
MED :0 PrefVal : 0
LocalPref: 100
Path/Ogn : i
# Check the traffic filtering rule carried in each BGP Flow Specification route
based on the corresponding ReIndex shown in the preceding command output.
<DeviceB> display bgp flow routing-table 97
BGP local router ID : 2.2.2.2
Local AS number : 200
ReIndex : 97
Order : 2147483647
Dissemination Rules :
FragmentType : match (Don't fragment)
----End
Configuration Files
● DeviceA configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.10.1.1 255.255.255.0
#
bgp 100
peer 10.10.1.2 as-number 200
#
ipv4-family unicast
undo synchronization
peer 10.10.1.2 enable
#
return
Networking Requirements
On the network shown in Figure 1-34, DeviceA belongs to AS 100; DeviceB,
DeviceC, and DeviceD belong to AS 200; DeviceB is the ingress of AS 200. AS 100
and AS 200 communicate with each other through DeviceB.
If an attack source appears in AS 100, attack traffic flows into AS 200 through
DeviceB, which severely affects the network performance of AS 200.
In this example, interface1, interface2, and interface3 represent GE1/0/0, GE2/0/0, and
GE3/0/0, respectively.
Precautions
None
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
● Router IDs of DeviceA, DeviceB, DeviceC, and DeviceD: 1.1.1.1, 2.2.2.2, 3.3.3.3,
and 4.4.4.4
● AS number of DeviceA: 100; AS number of DeviceB, DeviceC, and DeviceD:
200
Procedure
Step 1 Configure an IP address for each interface.
# Configure DeviceA.
[~DeviceA] bgp 100
[*DeviceA-bgp] router-id 1.1.1.1
[*DeviceA-bgp] peer 10.10.1.2 as-number 200
[*DeviceA-bgp] commit
[~DeviceA-bgp] quit
# Configure DeviceB.
[~DeviceB] bgp 200
[*DeviceB-bgp] router-id 2.2.2.2
[*DeviceB-bgp] peer 10.10.1.1 as-number 100
[*DeviceB-bgp] peer 3.3.3.3 as-number 200
[*DeviceB-bgp] peer 3.3.3.3 connect-interface LoopBack1
[*DeviceB-bgp] peer 4.4.4.4 as-number 200
[*DeviceB-bgp] peer 4.4.4.4 connect-interface LoopBack1
[*DeviceB-bgp] commit
[~DeviceB-bgp] quit
# Configure DeviceC.
[~DeviceC] bgp 200
[*DeviceC-bgp] router-id 3.3.3.3
[*DeviceC-bgp] peer 2.2.2.2 as-number 200
[*DeviceC-bgp] peer 2.2.2.2 connect-interface LoopBack1
[*DeviceC-bgp] commit
[~DeviceC-bgp] quit
# Configure DeviceD.
[~DeviceD] bgp 200
[*DeviceD-bgp] router-id 4.4.4.4
[*DeviceD-bgp] peer 2.2.2.2 as-number 200
[*DeviceD-bgp] peer 2.2.2.2 connect-interface LoopBack1
[*DeviceD-bgp] commit
[~DeviceD-bgp] quit
# Configure DeviceD.
[~DeviceD] flow-route FlowSpec2
[*DeviceD-flow-route] if-match source-port equal 170
[*DeviceD-flow-route] apply traffic-rate 10000
[*DeviceD-flow-route] commit
[~DeviceD-flow-route] quit
# Configure DeviceC.
[~DeviceC]bgp 200
[*DeviceC-bgp] ipv4-family flow
[*DeviceC-bgp-af-ipv4-flow] peer 2.2.2.2 enable
[*DeviceC-bgp-af-ipv4-flow] commit
[~DeviceC-bgp-af-ipv4-flow] quit
[~DeviceC-bgp] quit
# Configure DeviceD.
[~DeviceD]bgp 200
[*DeviceD-bgp] ipv4-family flow
[*DeviceD-bgp-af-ipv4-flow] peer 2.2.2.2 enable
[*DeviceD-bgp-af-ipv4-flow] commit
[~DeviceD-bgp-af-ipv4-flow] quit
[~DeviceD-bgp] quit
* > ReIndex : 33
Dissemination Rules:
Src. Port : eq 159
MED :0 PrefVal : 0
LocalPref: 100
Path/Ogn : i
* > ReIndex : 34
Dissemination Rules:
Src. Port : eq 170
MED :0 PrefVal : 0
LocalPref: 100
Path/Ogn : i
# Check the traffic filtering rule carried in each BGP flow specification route based
on the corresponding ReIndex shown in the preceding command output.
<DeviceB> display bgp flow routing-table 33
BGP local router ID : 2.2.2.2
Local AS number : 200
ReIndex : 33
Order : 1610612735
Dissemination Rules :
Src. Port : eq 159
----End
Configuration Files
● DeviceA configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.10.1.1 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
bgp 100
router-id 1.1.1.1
peer 10.10.1.2 as-number 200
ipv4-family unicast
undo synchronization
peer 10.10.1.2 enable
#
return
● DeviceB configuration file
#
sysname DeviceB
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.10.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
undo shutdown
ip address 10.2.1.1 255.255.255.0
#
interface GigabitEthernet3/0/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
bgp 200
router-id 2.2.2.2
peer 3.3.3.3 as-number 200
peer 3.3.3.3 connect-interface LoopBack1
peer 4.4.4.4 as-number 200
peer 4.4.4.4 connect-interface LoopBack1
peer 10.10.1.1 as-number 100
ipv4-family unicast
undo synchronization
peer 3.3.3.3 enable
peer 4.4.4.4 enable
peer 10.10.1.1 enable
ipv4-family flow
peer 3.3.3.3 enable
peer 4.4.4.4 enable
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.2.1.0 0.0.0.255
#
return
● DeviceC configuration file
#
sysname DeviceC
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.2.1.2 255.255.255.0
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
bgp 200
router-id 3.3.3.3
peer 2.2.2.2 as-number 200
peer 2.2.2.2 connect-interface LoopBack1
ipv4-family unicast
undo synchronization
import-route direct
1.1.14.17.3 Example for Configuring dynamic BGP Flow Specification with a BGP RR
Deploying BGP flow specification with a BGP RR can reduce the number of BGP
flow specification peer connections.
Networking Requirements
BGP flow specification can be configured to defend against DoS/DDoS attacks.
Generally, the characteristics of such attack traffic are unknown. Therefore,
dynamic BGP flow specification needs to be deployed on a traffic analysis server.
In an AS with multiple ingresses, a flow route reflector (Flow RR) can be
configured to avoid unnecessary mesh connections between the ingresses and the
traffic analysis server. The ingresses and the traffic analysis server function as
clients, and the Flow RR reflects the BGP flow specification routes generated by
the traffic analysis server to the ingresses.
On the network shown in Figure 1-35, AS 100 can communicate with other ASs
through boundary devices DeviceA and DeviceB. If DoS/DDoS attack traffic enters
In this example, interface1, interface2, and interface3 represent GE1/0/0, GE2/0/0, and
GE3/0/0, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Establish OSPF connections between the Flow RR and DeviceA, between the
Flow RR and DeviceB, and between the Flow RR and the server for
interworking.
2. Establish BGP flow specification peer relationships between the Flow RR and
DeviceA, between the Flow RR and DeviceB, and between the Flow RR and
the server.
NOTE
The traffic analysis server is a third-party device and must be able to establish BGP
flow specification peer relationships.
3. Configure the Flow RR function on the Flow RR and specify DeviceA, DeviceB,
and the server as clients so that the Flow RR can reflect the BGP flow
specification routes generated by the server to DeviceA and DeviceB.
Data Preparation
To complete the configuration, you need the following data:
● Router IDs of DeviceA, DeviceB, and Flow RR: 1.1.1.1, 2.2.2.2, and 3.3.3.3
● Number of the AS where DeviceA, DeviceB, Flow RR, and the server reside:
100
Procedure
Step 1 Configure an IP address for each interface.
For configuration details, see the configuration files.
Step 2 Configure OSPF.
For configuration details, see the configuration files.
Step 3 Establish BGP flow specification peer relationships.
# Configure DeviceA.
[~DeviceA] bgp 100
[*DeviceA-bgp] router-id 1.1.1.1
[*DeviceA-bgp] peer 3.3.3.3 as-number 100
[*DeviceA-bgp] peer 3.3.3.3 connect-interface LoopBack1
[*DeviceA-bgp] ipv4-family flow
[*DeviceA-bgp-af-ipv4-flow] peer 3.3.3.3 enable
[*DeviceA-bgp-af-ipv4-flow] commit
[~DeviceA-bgp-af-ipv4-flow] quit
[~DeviceA-bgp] quit
# Configure DeviceB.
[~DeviceB] bgp 100
[*DeviceB-bgp] router-id 2.2.2.2
[*DeviceB-bgp] peer 3.3.3.3 as-number 100
[*DeviceB-bgp] peer 3.3.3.3 connect-interface LoopBack1
[*DeviceB-bgp] ipv4-family flow
[*DeviceB-bgp-af-ipv4-flow] peer 3.3.3.3 enable
[*DeviceB-bgp-af-ipv4-flow] commit
[~DeviceB-bgp-af-ipv4-flow] quit
[~DeviceB-bgp] quit
* > ReIndex : 33
Dissemination Rules:
Port : eq 100
FragmentType : match (Don't fragment)
MED :0 PrefVal : 0
LocalPref: 100
Path/Ogn : i
# Check the traffic filtering rule carried in the BGP flow specification route based
on the value of ReIndex in the preceding command output.
<DeviceA> display bgp flow routing-table 33
BGP local router ID : 1.1.1.1
Local AS number : 100
ReIndex : 33
Order : 2147483647
Dissemination Rules :
Port : eq 100
FragmentType : match (Don't fragment)
The command output shows that DeviceA has learned the route advertised by the
server from the Flow RR. The Originator and Cluster_ID attributes of the route are
also displayed.
----End
Configuration Files
● DeviceA configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.3.1.2 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
bgp 100
router-id 1.1.1.1
Networking Requirements
As shown in Figure 1-36, Device A belongs to AS 100, while Device B, Device C,
and Server belong to AS 200. Device B is an ingress of AS 200. AS 200
communicates with AS 100 through Device B.
The attack source in AS 100 may flow into AS 200 through Device B, posing a
threat to AS 200. In this situation, configure dynamic BGP IPv6 Flow Specification
Precautions
None
Configuration Roadmap
The configuration roadmap is as follows:
The traffic analysis server is a non-Huawei device, and it must be a BGP IPv6 Flow
Specification peer of another device.
Data Preparation
To complete the configuration, you need the following data:
● Router ID of Device A (1.1.1.1) and router ID of Device B (2.2.2.2)
● AS number (100) of Device A and AS number (200) of Device B, Device C, and
Server
Procedure
Step 1 Assign an IP address to each interface.
For detailed configurations, see the configuration files in this example.
Step 2 Configure an IPv4 peer.
# Configure Device A.
[~DeviceA] bgp 100
[*DeviceA-bgp] peer 10.10.1.2 as-number 200
[*Device-bgp] commit
Step 3 Configure a BGP IPv6 Flow Specification peer and disable route authentication.
# Configure Device B.
[~DeviceB] bgp 200
[*DeviceB-bgp] peer 10.2.1.2 as-number 200
[*DeviceB-bgp] peer 10.10.1.1 as-number 100
[*DeviceB-bgp] ipv6-family flow
[*DeviceB-bgp-af-ipv6-flow] peer 10.2.1.2 enable
[*DeviceB-bgp-af-ipv6-flow] peer 10.2.1.2 validation-disable
[*DeviceB-bgp-af-ipv6-flow] commit
[~DeviceB-bgp-af-ipv6-flow] quit
[~DeviceB-bgp] quit
* > ReIndex : 2
Dissemination Rules:
FragmentType : match (Don't fragment)
MED :0 PrefVal : 0
LocalPref: 100
Path/Ogn : i
# Check the traffic policy in each BGP IPv6 Flow Specification route based on the
ReIndex shown in the preceding output.
<DeviceB> display bgp flow ipv6 routing-table 2
BGP local router ID : 2.2.2.2
Local AS number : 200
Paths: 1 available, 1 best
ReIndex : 2
Order : 2147483647
Dissemination Rules :
----End
Configuration Files
● Device A configuration file
sysname DeviceA
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.10.1.1 255.255.255.0
#
bgp 100
peer 10.10.1.2 as-number 200
#
ipv4-family unicast
undo synchronization
peer 10.10.1.2 enable
#
return
Networking Requirements
On the network shown in Figure 1-37, DeviceA belongs to AS 100; DeviceB,
DeviceC, and DeviceD belong to AS 200; DeviceB is the ingress of AS 200. AS 100
and AS 200 communicate with each other through DeviceB.
If an attack source appears in AS 100, attack traffic flows into AS 200 through
DeviceB, which severely affects the network performance of AS 200.
Static BGP IPv6 flow specification can be configured to resolve this problem.
Specifically, you can manually configure a BGP IPv6 flow specification route, and
establish a BGP IPv6 flow specification peer relationship to allow the BGP IPv6
flow specification route to be sent to DeviceB. In this way, the attack traffic is
discarded, or its rate is limited.
Figure 1-37 Networking for configuring static BGP IPv6 Flow Specification
NOTE
In this example, interface1, interface2, and interface3 represent GE1/0/0, GE2/0/0, and
GE3/0/0, respectively.
Precautions
None
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
● Router IDs of DeviceA, DeviceB, DeviceC, and DeviceD: 1.1.1.1, 2.2.2.2, 3.3.3.3,
and 4.4.4.4
● AS number of DeviceA: 100; AS number of DeviceB, DeviceC, and DeviceD:
200
Procedure
Step 1 Configure an IP address for each interface.
For configuration details, see the configuration files.
Step 2 Configure OSPF.
For configuration details, see the configuration files.
Step 3 Establish BGP connections.
# Configure DeviceA.
[~DeviceA] bgp 100
[*DeviceA-bgp] router-id 1.1.1.1
[*DeviceA-bgp] peer 10.10.1.2 as-number 200
[*Device-bgp] commit
# Configure DeviceB.
[~DeviceB] bgp 200
[*DeviceB-bgp] router-id 2.2.2.2
[*DeviceB-bgp] peer 10.10.1.1 as-number 100
[*DeviceB-bgp] peer 3.3.3.3 as-number 200
[*DeviceB-bgp] peer 3.3.3.3 connect-interface LoopBack1
[*DeviceB-bgp] peer 4.4.4.4 as-number 200
[*DeviceB-bgp] peer 4.4.4.4 connect-interface LoopBack1
[*DeviceB-bgp] commit
# Configure DeviceC.
[~DeviceC] bgp 200
[*DeviceC-bgp] router-id 3.3.3.3
[*DeviceC-bgp] peer 2.2.2.2 as-number 200
[*DeviceC-bgp] peer 2.2.2.2 connect-interface LoopBack1
[*DeviceC-bgp] commit
# Configure DeviceD.
[~DeviceD] bgp 200
[*DeviceD-bgp] router-id 4.4.4.4
[*DeviceD-bgp] peer 2.2.2.2 as-number 200
[*DeviceD-bgp] peer 2.2.2.2 connect-interface LoopBack1
[*DeviceD-bgp] commit
# Configure DeviceC.
[~DeviceC] flow-route FlowSpec1 ipv6
[*DeviceC-flow-route-ipv6] if-match source-port equal 159
[*DeviceC-flow-route-ipv6] apply deny
[*DeviceC-flow-route-ipv6] commit
[~DeviceC-flow-route-ipv6] quit
# Configure DeviceD.
[~DeviceD] flow-route FlowSpec2 ipv6
[*DeviceD-flow-route-ipv6] if-match source-port equal 170
[*DeviceD-flow-route-ipv6] apply traffic-rate 10000
[*DeviceD-flow-route-ipv6] commit
[~DeviceD-flow-route-ipv6] quit
# Configure DeviceC.
[~DeviceC]bgp 200
[*DeviceC-bgp] ipv6-family flow
[*DeviceC-bgp-af-ipv6-flow] peer 2.2.2.2 enable
[*DeviceC-bgp-af-ipv6-flow] commit
[~DeviceC-bgp-af-ipv6-flow] quit
[~DeviceC-bgp] quit
# Configure DeviceD.
[~DeviceD]bgp 200
[*DeviceD-bgp] ipv6-family flow
[*DeviceD-bgp-af-ipv6-flow] peer 2.2.2.2 enable
[*DeviceD-bgp-af-ipv6-flow] commit
[~DeviceD-bgp-af-ipv6-flow] quit
[~DeviceD-bgp] quit
# Display information about the BGP IPv6 flow specification routes received by
DeviceB.
<DeviceB> display bgp flow ipv6 routing-table
BGP Local router ID is 2.2.2.2
Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V - valid, I - invalid, N - not-found
# Check the traffic filtering rule carried in each BGP IPv6 flow specification route
based on the corresponding ReIndex shown in the preceding command output.
<DeviceB> display bgp flow ipv6 routing-table 2
BGP local router ID : 2.2.2.2
Local AS number : 200
ReIndex : 2
Order : 0
Dissemination Rules :
Src. Port : eq 159
----End
Configuration Files
● DeviceA configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.10.1.1 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
bgp 100
router-id 1.1.1.1
peer 10.10.1.2 as-number 200
ipv4-family unicast
undo synchronization
peer 10.10.1.2 enable
#
return
undo shutdown
ip address 10.2.1.1 255.255.255.0
#
interface GigabitEthernet3/0/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
bgp 200
router-id 2.2.2.2
peer 3.3.3.3 as-number 200
peer 3.3.3.3 connect-interface LoopBack1
peer 4.4.4.4 as-number 200
peer 4.4.4.4 connect-interface LoopBack1
peer 10.10.1.1 as-number 100
ipv4-family unicast
undo synchronization
peer 3.3.3.3 enable
peer 4.4.4.4 enable
peer 10.10.1.1 enable
#
ipv6-family flow
peer 3.3.3.3 enable
peer 4.4.4.4 enable
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.2.1.0 0.0.0.255
#
return
#
sysname DeviceD
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.1.2 255.255.255.0
#
interface LoopBack1
ip address 4.4.4.4 255.255.255.255
#
bgp 200
router-id 4.4.4.4
peer 2.2.2.2 as-number 200
peer 2.2.2.2 connect-interface LoopBack1
ipv4-family unicast
undo synchronization
peer 2.2.2.2 enable
ipv6-family flow
peer 2.2.2.2 enable
#
ospf 1
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 10.1.1.0 0.0.0.255
#
flow-route FlowSpec2 ipv6
if-match source-port equal 170
apply traffic-rate 10000
#
return
1.1.14.17.6 Example for Configuring dynamic BGP IPv6 Flow Specification with a
BGP RR
Deploying BGP IPv6 flow specification with a BGP RR can reduce the number of
BGP IPv6 flow specification peer connections.
Networking Requirements
BGP IPv6 flow specification can be configured to defend against DoS/DDoS
attacks. Generally, the characteristics of such attack traffic are unknown.
Therefore, dynamic BGP IPv6 flow specification needs to be deployed on a traffic
analysis server. In an AS with multiple ingresses, a flow route reflector (Flow RR)
can be configured to avoid unnecessary mesh connections between the ingresses
and the traffic analysis server. The ingresses and the traffic analysis server function
as clients, and the Flow RR reflects the BGP IPv6 flow specification routes
generated by the traffic analysis server to the ingresses.
On the network shown in Figure 1-38, AS 100 can communicate with other ASs
through boundary devices DeviceA and DeviceB. If DoS/DDoS attack traffic enters
AS 100 through DeviceA and DeviceB, it causes impacts such as congestion in AS
100. In this case, you can deploy BGP IPv6 flow specification (dynamic BGP IPv6
flow specification is used in this example) to eliminate the impact. In addition, to
reduce resource consumption of the server and the number of BGP IPv6 flow
specification peer relationships maintained by the server, configure a Flow RR in
AS 100. The Flow RR is used to reflect the BGP IPv6 flow specification routes
generated by the server to DeviceA and DeviceB for them to control attack traffic.
In this example, interface1, interface2, and interface3 represent GE1/0/0, GE2/0/0, and
GE3/0/0, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
1. Establish OSPF connections between the Flow RR and DeviceA, between the
Flow RR and DeviceB, and between the Flow RR and the server for
interworking.
2. Establish BGP IPv6 flow specification peer relationships between the Flow RR
and DeviceA, between the Flow RR and DeviceB, and between the Flow RR
and the server.
NOTE
The traffic analysis server is a third-party device and must be able to establish BGP
IPv6 flow specification peer relationships.
3. Configure the Flow RR function on the Flow RR and specify DeviceA, DeviceB,
and the server as clients so that the Flow RR can reflect the BGP IPv6 flow
specification routes generated by the server to DeviceA and DeviceB.
Data Preparation
To complete the configuration, you need the following data:
● Router IDs of DeviceA, DeviceB, and Flow RR: 1.1.1.1, 2.2.2.2, and 3.3.3.3
● Number of the AS where DeviceA, DeviceB, Flow RR, and the server reside:
100
● ID of the cluster to which the Flow RR belongs: 1
Procedure
Step 1 Configure an IP address for each interface.
# Configure DeviceB.
[~DeviceB] bgp 100
[*DeviceB-bgp] router-id 2.2.2.2
[*DeviceB-bgp] peer 3.3.3.3 as-number 100
[*DeviceB-bgp] peer 3.3.3.3 connect-interface LoopBack1
[*DeviceB-bgp] ipv6-family flow
[*DeviceB-bgp-af-ipv6-flow] peer 3.3.3.3 enable
[*DeviceB-bgp-af-ipv6-flow] commit
[~DeviceB-bgp-af-ipv6-flow] quit
[~DeviceB-bgp] quit
MED :0 PrefVal : 0
LocalPref: 100
Path/Ogn : i
# Check the traffic filtering rule carried in each BGP IPv6 flow specification route
based on the corresponding ReIndex shown in the preceding command output.
<DeviceA> display bgp flow ipv6 routing-table 2
BGP local router ID : 1.1.1.1
Local AS number : 100
Paths: 1 available, 1 best
ReIndex : 2
Order : 2147483647
Dissemination Rules :
Port : eq 100
FragmentType : match (Don't fragment)
The command output shows that DeviceA has learned the route advertised by the
server from the Flow RR. The Originator and Cluster_ID attributes of the route are
also displayed.
----End
Configuration Files
● DeviceA configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.3.1.2 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
bgp 100
router-id 1.1.1.1
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack1
ipv4-family unicast
undo synchronization
peer 3.3.3.3 enable
ipv6-family flow
ipv6-family flow
reflector cluster-id 1
peer 1.1.1.1 enable
peer 1.1.1.1 reflect-client
peer 2.2.2.2 enable
peer 2.2.2.2 reflect-client
peer 10.2.1.2 enable
peer 10.2.1.2 reflect-client
peer 10.2.1.2 validation-disable
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.2.1.0 0.0.0.255
network 10.3.1.0 0.0.0.255
#
return
Networking Requirements
As shown in Figure 1-39, in the VPN domain, the CE belongs to AS 100; PE1 and
Server belong to AS 200; PE1 is the ingress of AS 200. AS 200 can communicate
with AS 100 through PE1.
When an attack source appears in AS 100, attack traffic flows into AS 200 through
PE1, posing a threat to AS 200. To ensure VPN security, configure dynamic BGP
VPN Flow Specification. Specifically, deploy a traffic analysis server (Server) on the
network and establish a BGP VPN Flow Specification peer relationship between
the server and PE1. PE1 periodically samples traffic and sends sampled traffic to
the traffic analysis server. The traffic analysis server generates a BGP VPN Flow
Specification route based on the characteristics of sampled attack traffic and sends
the route to PE1. PE1 then converts the route into a traffic filtering policy to filter
and control attack traffic, ensuring the security of VPN services in AS 200.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interface IP addresses.
2. Create a VPN instance on PE1 and Server and bind the VPN instance to their
interfaces.
3. Configure PE1 to establish a BGP VPN Flow Specification peer relationship
with Server so that the automatically generated BGP VPN Flow Specification
route can be sent to PE1 to form a traffic filtering policy.
NOTE
The traffic analysis server is a third-party device and must be able to establish BGP
VPN Flow Specification peer relationships.
Data Preparation
To complete the configuration, you need the following data:
● Router IDs of CE1 and PE1: 1.1.1.1 and 2.2.2.2, respectively
● AS number (100) of CE1 and the AS number (200) of PE1 and Server
● VPN instance name: vpna
Procedure
Step 1 Configure IP addresses for interfaces.
For configuration details, see the configuration files.
Step 2 Create a VPN instance and bind it to each interface.
# Configure PE1.
Step 3 Establish a BGP VPN Flow Specification peer relationship and disable route
validation.
# Configure PE1.
[~PE1]bgp 200
[*PE1-bgp] router-id 2.2.2.2
[*PE1-bgp] commit
[~PE1-bgp] vpn-instance vpna
[*PE1-bgp-instance-vpna] peer 10.1.1.1 as-number 100
[*PE1-bgp-instance-vpna] peer 10.2.1.2 as-number 200
[*PE1-bgp-instance-vpna] quit
[*PE1-bgp] ipv4-flow vpn-instance vpna
[*PE1-bgp-flow-vpna] peer 10.1.1.1 enable
[*PE1-bgp-flow-vpna] peer 10.2.1.2 enable
[*PE1-bgp-flow-vpna] peer 10.1.1.1 validation-disable
[*PE1-bgp-flow-vpna] peer 10.2.1.2 validation-disable
[*PE1-bgp-flow-vpna] commit
[~PE1-bgp-flow-vpna] quit
[~PE1-bgp] quit
# Check information about the BGP VPN Flow Specification routes received by
PE1.
<PE1> display bgp flow vpnv4 vpn-instance vpna routing-table
Total Number of Routes: 1
* > ReIndex : 2
Dissemination Rules:
Protocol : eq 6
Src. Port : eq 159
ICMP Code : eq 3
FragmentType : match (Don't fragment)
MED :0 PrefVal : 0
LocalPref: 100
Path/Ogn : i
# Check the traffic filtering rule carried in each BGP VPN Flow Specification route
based on the value of ReIndex in the preceding command output.
<PE1> display bgp flow vpnv4 vpn-instance vpna routing-table 2
ReIndex : 2
Order : 0
Dissemination Rules :
Protocol : eq 6
Src. Port : eq 159
ICMP Code : eq 3
FragmentType : match (Don't fragment)
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
bgp 100
router-id 1.1.1.1
peer 10.1.1.2 as-number 200
#
ipv4-family unicast
undo synchronization
peer 10.1.1.2 enable
#
ipv4-family flow
peer 10.1.1.2 enable
#
return
Networking Requirements
As shown in Figure 1-40, in the VPN, CE1 belongs to AS 100; PE1 and PE2 belong
to AS 200; all devices are in the same VPN domain. PE1 is the ingress of the VPN
domain in AS 200. AS 200 can communicate with AS 100 through PE1.
If an attack source appears in AS 100, attack traffic flows into AS 200 through
PE1, which severely affects the VPN performance of AS 200.
Static BGP VPN Flow Specification can be configured to resolve this problem.
Specifically, you can manually configure a BGP Flow Specification route, and
establish a BGP Flow Specification peer relationship to allow the BGP VPN Flow
Specification route to be sent to PE1. In this way, the attack traffic is discarded, or
its rate is limited.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interface IP addresses.
2. Create a VPN instance on PE1 and PE2 and bind it to their interfaces.
3. Configure a BGP VPN Flow Specification route named FlowSpec1 on PE2 to
discard the attack traffic with the source port number being 159.
4. Establish a BGP VPN Flow Specification peer relationship between PE1 and
PE2 so that the created BGP VPN Flow Specification route can be sent to PE1
to form a traffic filtering policy.
Data Preparation
To complete the configuration, you need the following data:
● Router IDs of CE1, PE1, and PE2: 1.1.1.1, 2.2.2.2, and 3.3.3.3, respectively
● AS number of CE1: 100; AS number of PE1 and PE2: 200
● VPN instance name: vpna
Procedure
Step 1 Configure IP addresses for interfaces.
For configuration details, see the configuration files.
Step 2 Create a VPN instance and bind it to each interface.
# Configure PE1.
[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv4-family
[*PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[*PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 export-extcommunity
[*PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 import-extcommunity
[*PE1-vpn-instance-vpna-af-ipv4] commit
[~PE1-vpn-instance-vpna-af-ipv4] quit
[~PE1-vpn-instance-vpna] quit
[~PE1] interface GigabitEthernet1/0/0
[~PE1-GigabitEthernet1/0/0] undo shutdown
[*PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpna
# Configure PE2.
[~PE2] ip vpn-instance vpna
[*PE2-vpn-instance-vpna] ipv4-family
[*PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 200:1
[*PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 export-extcommunity
[*PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 import-extcommunity
[*PE2-vpn-instance-vpna-af-ipv4] commit
[~PE2-vpn-instance-vpna-af-ipv4] quit
[~PE2-vpn-instance-vpna] quit
[~PE2] interface GigabitEthernet1/0/0
[~PE2-GigabitEthernet1/0/0] undo shutdown
[*PE2-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[*PE2-GigabitEthernet1/0/0] ip address 10.2.1.2 255.255.255.0
[*PE2-GigabitEthernet1/0/0] commit
[~PE2-GigabitEthernet1/0/0] quit
# Configure PE2.
[~PE2] flow-route FlowSpec1 vpn-instance vpna
[*PE2-flow-route-vpna] if-match source-port equal 159
[*PE2-flow-route-vpna] apply deny
[*PE2-flow-route-vpna] commit
[~PE2-flow-route-vpna] quit
# Configure PE1.
[~PE1]bgp 200
[*PE1-bgp] router-id 2.2.2.2
[*PE1-bgp] commit
[~PE1-bgp] vpn-instance vpna
[*PE1-bgp-instance-vpna] peer 10.1.1.1 as-number 100
[*PE1-bgp-instance-vpna] peer 10.2.1.2 as-number 200
[*PE1-bgp-instance-vpna] quit
[*PE1-bgp] ipv4-flow vpn-instance vpna
[*PE1-bgp-flow-vpna] peer 10.1.1.1 enable
[*PE1-bgp-flow-vpna] peer 10.2.1.2 enable
[*PE1-bgp-flow-vpna] commit
[~PE1-bgp-flow-vpna] quit
[~PE1-bgp] quit
# Configure PE2.
[~PE2]bgp 200
[*PE2-bgp] router-id 3.3.3.3
[*PE2-bgp] commit
[~PE2-bgp] vpn-instance vpna
[*PE2-bgp-instance-vpna] peer 10.2.1.1 as-number 200
[*PE2-bgp-instance-vpna] quit
[*PE2-bgp] ipv4-flow vpn-instance vpna
[*PE2-bgp-flow-vpna] peer 10.2.1.1 enable
[*PE2-bgp-flow-vpna] commit
[~PE2-bgp-flow-vpna] quit
[~PE2-bgp] quit
# Check information about the BGP VPN Flow Specification routes received by
PE1.
<PE1> display bgp flow vpnv4 vpn-instance vpna routing-table
Total Number of Routes: 1
* > ReIndex : 1
Dissemination Rules:
Src. Port : eq 159
MED :0 PrefVal : 0
LocalPref: 100
Path/Ogn : i
# Check the traffic filtering rule carried in each BGP VPN Flow Specification route
based on the value of ReIndex in the preceding command output.
<PE1> display bgp flow vpnv4 vpn-instance vpna routing-table 1
ReIndex : 1
Order : 0
Dissemination Rules :
Src. Port : eq 159
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
bgp 100
router-id 1.1.1.1
peer 10.1.1.2 as-number 200
#
ipv4-family unicast
undo synchronization
peer 10.1.1.2 enable
#
ipv4-family flow
peer 10.1.1.2 enable
#
return
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
interface GigabitEthernet1/0/0
undo shutdown
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
undo shutdown
ip binding vpn-instance vpna
ip address 10.2.1.1 255.255.255.0
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
bgp 200
router-id 2.2.2.2
#
ipv4-family unicast
undo synchronization
#
vpn-instance vpna
peer 10.1.1.1 as-number 100
peer 10.2.1.2 as-number 200
#
ipv4-flow vpn-instance vpna
peer 10.1.1.1 enable
peer 10.2.1.2 enable
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
interface GigabitEthernet1/0/0
undo shutdown
ip binding vpn-instance vpna
ip address 10.2.1.2 255.255.255.0
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
bgp 200
router-id 3.3.3.3
#
ipv4-family unicast
undo synchronization
#
vpn-instance vpna
peer 10.2.1.1 as-number 200
#
ipv4-flow vpn-instance vpna
peer 10.2.1.1 enable
#
flow-route FlowSpec1 vpn-instance vpna
if-match source-port equal 159
apply deny
#
return
1.1.14.17.9 Example for Configuring Dynamic BGP IPv6 VPN Flow Specification
If the characteristics of DoS or DDoS attack traffic are unknown in an IPv6 VPN
domain, a traffic analysis server can help implement BGP IPv6 VPN Flow
Specification to ensure network security in the domain.
Networking Requirements
As shown in Figure 1-41, in the IPv6 VPN domain, the CE belongs to AS 100; PE1
and Server belong to AS 200; PE1 is the ingress of AS 200. AS 200 can
communicate with AS 100 through PE1.
When an attack source appears in AS 100, attack traffic flows into AS 200 through
PE1, posing a threat to AS 200. To ensure IPv6 VPN security, configure dynamic
BGP IPv6 VPN Flow Specification. Specifically, deploy a traffic analysis server
(Server) on the network and establish a BGP IPv6 VPN Flow Specification peer
relationship between the server and PE1. PE1 periodically samples traffic and
sends sampled traffic to the traffic analysis server. The traffic analysis server
generates a BGP IPv6 VPN Flow Specification route based on the characteristics of
sampled attack traffic and sends the route to PE1. PE1 then converts the route
into a traffic filtering policy to filter and control attack traffic, ensuring the
security of VPN services in AS 200.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interface IP addresses.
2. Create a VPN instance on PE1 and Server and bind the VPN instance to their
interfaces.
3. Configure PE1 to establish a BGP IPv6 VPN Flow Specification peer
relationship with Server so that the automatically generated BGP IPv6 VPN
Flow Specification route can be sent to PE1 to form a traffic filtering policy.
NOTE
The traffic analysis server is a third-party device and must be able to establish BGP
IPv6 VPN Flow Specification peer relationships.
Data Preparation
To complete the configuration, you need the following data:
● AS number (100) of CE1 and the AS number (200) of PE1 and Server
● VPN instance name: vpna
Procedure
Step 1 Configure IP addresses for interfaces.
For configuration details, see the configuration files.
Step 2 Create a VPN instance and bind it to each interface.
# Configure PE1.
[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv6-family
[*PE1-vpn-instance-vpna-af-ipv6] route-distinguisher 2:2
[*PE1-vpn-instance-vpna-af-ipv6] vpn-target 2:2 export-extcommunity
[*PE1-vpn-instance-vpna-af-ipv6] vpn-target 2:2 import-extcommunity
[*PE1-vpn-instance-vpna-af-ipv6] commit
[~PE1-vpn-instance-vpna-af-ipv6] quit
[~PE1-vpn-instance-vpna] quit
[~PE1] interface GigabitEthernet1/0/0
[~PE1-GigabitEthernet1/0/0] undo shutdown
[*PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[*PE1-GigabitEthernet1/0/0] ipv6 enable
[*PE1-GigabitEthernet1/0/0] ipv6 address 2001:db8:1::2 64
[*PE1-GigabitEthernet1/0/0] commit
[~PE1-GigabitEthernet1/0/0] quit
[~PE1-bgp-flow-6-vpna] quit
[~PE1-bgp] quit
# Check the information about the BGP IPv6 VPN Flow Specification routes
received by PE1.
<PE1> display bgp flow vpnv6 vpn-instance vpna routing-table
# Check the traffic filtering rule carried in each BGP IPv6 VPN Flow Specification
route based on the value of ReIndex in the preceding command output.
<PE1> display bgp flow vpnv6 vpn-instance vpna routing-table 1
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
undo shutdown
ipv6 enable
ipv6 address 2001:db8:1::1/64
#
bgp 100
peer 2001:db8:1::2 as-number 200
#
ipv4-family unicast
undo synchronization
#
ipv6-family flow
peer 2001:db8:1::2 enable
#
return
1.1.14.17.10 Example for Configuring Static BGP IPv6 VPN Flow Specification
In an IPv6 VPN domain, you can manually configure BGP IPv6 VPN Flow
Specification routes to implement static BGP IPv6 VPN Flow Specification for DoS/
DDoS attacks whose characteristics can be predicted, ensuring device security in
the VPN.
Networking Requirements
As shown in Figure 1-42, in the IPv6 VPN, CE1 belongs to AS 100; PE1 belongs to
AS 200. CE1 and PE1 are in the same VPN domain. PE1 is the ingress of the VPN
domain in AS 200. AS 200 can communicate with AS 100 through PE1.
If an attack source appears in AS 100, attack traffic flows into AS 200 through
PE1, which severely affects the VPN performance of AS 200.
Static BGP IPv6 VPN Flow Specification can be configured to resolve this problem.
Specifically, you can manually configure a BGP IPv6 Flow Specification route, and
establish a BGP IPv6 VPN Flow Specification peer relationship to allow the BGP
IPv6 VPN Flow Specification route to be sent to PE1. In this way, the attack traffic
is discarded, or its rate is limited.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interface IP addresses.
2. Create a VPN instance on PE1 and bind the VPN instance to each interface.
3. Configure a BGP IPv6 VPN Flow Specification route named FlowSpec1 on PE1
to discard the attack traffic with the source port number being 159.
Data Preparation
To complete the configuration, you need the following data:
● AS number (100) of CE1 and the AS number (200) of PE1
● VPN instance name: vpna
Procedure
Step 1 Configure IP addresses for interfaces.
For configuration details, see the configuration files.
Step 2 Create a VPN instance and bind it to each interface.
# Configure PE1.
[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv6-family
[*PE1-vpn-instance-vpna-af-ipv6] route-distinguisher 2:2
[*PE1-vpn-instance-vpna-af-ipv6] vpn-target 2:2 export-extcommunity
[*PE1-vpn-instance-vpna-af-ipv6] vpn-target 2:2 import-extcommunity
[*PE1-vpn-instance-vpna-af-ipv6] commit
[~PE1-vpn-instance-vpna-af-ipv6] quit
[~PE1-vpn-instance-vpna] quit
[~PE1] interface GigabitEthernet1/0/0
[~PE1-GigabitEthernet1/0/0] undo shutdown
[*PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[*PE1-GigabitEthernet1/0/0] ipv6 enable
[*PE1-GigabitEthernet1/0/0] ipv6 address 2001:db8:1::2 64
[*PE1-GigabitEthernet1/0/0] commit
[~PE1-GigabitEthernet1/0/0] quit
# Check the information about the BGP IPv6 VPN Flow Specification routes
received by PE1.
<PE1> display bgp flow vpnv6 vpn-instance vpna routing-table
MED :0 PrefVal : 0
LocalPref:
Path/Ogn : i
# Check the traffic filtering rule carried in each BGP IPv6 VPN Flow Specification
route based on the value of ReIndex in the preceding command output.
<PE1> display bgp flow vpnv6 vpn-instance vpna routing-table 1
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
undo shutdown
ipv6 enable
ipv6 address 2001:db8:1::1/64
#
bgp 100
peer 2001:db8:1::2 as-number 200
#
ipv4-family unicast
undo synchronization
#
ipv6-family flow
peer 2001:db8:1::2 enable
#
return
undo synchronization
#
vpn-instance vpna
peer 2001:db8:1::1 as-number 200
#
ipv6-flow vpn-instance vpna
peer 2001:db8:1::1 enable
#
flow-route FlowSpec1 ipv6 vpn-instance vpna
if-match source-port equal 159
apply deny
#
return
Networking Requirements
As shown in Figure 1-43, in a VPN, the CE belongs to AS 100; PE1 and Server
belong to AS 200; PE1 is a network ingress of AS 200. AS 200 can communicate
with AS 100 through PE1.
When an attack source appears in AS 100, attack traffic flows into AS 200 through
PE1, posing a threat to AS 200. To ensure VPN security, configure dynamic BGP
VPNv4 Flow Specification. Specifically, deploy a traffic analysis server on the
network and establish a BGP VPNv4 Flow Specification peer relationship between
the traffic analysis server and PE1. PE1 periodically samples traffic and sends
sampled traffic to the traffic analysis server. The traffic analysis server generates a
BGP VPNv4 Flow Specification route based on the characteristics of sampled
attack traffic and sends the route to PE1. PE1 then converts the route into a traffic
filtering policy to filter and control attack traffic, ensuring the security of VPN
services in AS 200.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interface IP addresses.
2. Create a VPN instance on PE1 and Server and bind the VPN instance to PE1's
interface that is connected to CE1.
3. Configure PE1 to establish a BGP VPNv4 Flow Specification peer relationship
with Server so that the automatically generated BGP VPNv4 Flow
Specification route can be sent to PE1 to form a traffic filtering policy.
NOTE
The traffic analysis server is a third-party device and must be able to establish BGP
VPNv4 Flow Specification peer relationships.
Data Preparation
To complete the configuration, you need the following data:
● AS number (100) of CE1 and the AS number (200) of PE1 and Server
● VPN instance name: vpna
Procedure
Step 1 Configure IP addresses for interfaces.
For configuration details, see the configuration files.
Step 2 Create a VPN instance and bind the VPN instance to the PE1's interface that is
connected to CE1.
# Configure PE1.
[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv4-family
[*PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[*PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 export-extcommunity
[*PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 import-extcommunity
[*PE1-vpn-instance-vpna-af-ipv4] commit
[~PE1-vpn-instance-vpna-af-ipv4] quit
[~PE1-vpn-instance-vpna] quit
[~PE1] interface GigabitEthernet1/0/0
[~PE1-GigabitEthernet1/0/0] undo shutdown
[*PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[*PE1-GigabitEthernet1/0/0] ip address 10.1.1.2 255.255.255.0
[*PE1-GigabitEthernet1/0/0] commit
[~PE1-GigabitEthernet1/0/0] quit
[~PE1] interface GigabitEthernet2/0/0
[~PE1-GigabitEthernet2/0/0] undo shutdown
[*PE1-GigabitEthernet2/0/0] ip address 10.2.1.1 255.255.255.0
[*PE1-GigabitEthernet2/0/0] commit
[~PE1-GigabitEthernet2/0/0] quit
# Check information about the BGP VPNv4 Flow Specification routes received by
PE1. The command output also shows information about the received BGP VPN
Flow Specification routes.
<PE1> display bgp flow vpnv4 all routing-table
BGP Local router ID is 10.1.1.2
Status codes: * - valid, > - best, d - damped, x - best external, a - add path,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V - valid, I - invalid, N - not-found
# Check the traffic filtering rule carried in each BGP VPNv4 Flow Specification
route based on the value of ReIndex in the preceding command output.
<PE1> display bgp flow vpnv4 all routing-table 536870913
Order : 0
Dissemination Rules :
Src. Port : eq 159
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
bgp 100
peer 10.1.1.2 as-number 200
#
ipv4-family unicast
undo synchronization
peer 10.1.1.2 enable
#
ipv4-family flow
peer 10.1.1.2 enable
#
return
#
ipv4-flow vpnv4
policy vpn-target
peer 10.2.1.2 enable
#
return
Networking Requirements
As shown in Figure 1-44, in the VPN, CE1 belongs to AS 100; PE1 and PE2 belong
to AS 200, all devices are in the same VPN domain. PE1 is the ingress of the VPN
domain in AS 200. AS 200 can communicate with AS 100 through PE1.
If an attack source appears in AS 100, attack traffic flows into AS 200 through
PE1, which severely affects the VPN performance of AS 200.
Static BGP VPNv4 Flow Specification can be configured to resolve this problem.
Specifically, configure a BGP VPN Flow Specification route on PE2 and enable the
BGP-Flow VPNv4 address family so that a BGP VPNv4 Flow Specification route can
be generated automatically. Then, establish a BGP VPNv4 Flow Specification peer
relationship between PE1 and PE2 to transmit the BGP VPNv4 Flow Specification
route and form a traffic policy. Then attack traffic is filtered and controlled.
Configuration Roadmap
The configuration roadmap is as follows:
2. Create a VPN instance on PE1 and PE2 and bind it to the interface connecting
PE1 to CE1.
3. Configure a BGP VPN Flow Specification route named FlowSpec1 on PE2 to
discard the attack traffic with the source port number being 159.
4. Establish a BGP VPNv4 Flow Specification peer relationship between PE1 and
PE2 so that the generated BGP VPNv4 Flow Specification route can be sent to
PE1 to form traffic policy.
Data Preparation
To complete the configuration, you need the following data:
● AS number of CE1: 100; AS number of PE1 and PE2: 200
● VPN instance name: vpna
Procedure
Step 1 Configure IP addresses for interfaces.
For configuration details, see the configuration files.
Step 2 Create a VPN instance and bind the VPN instance to the PE1's interface that is
connected to CE1.
# Configure PE1.
[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv4-family
[*PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[*PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 export-extcommunity
[*PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 import-extcommunity
[*PE1-vpn-instance-vpna-af-ipv4] commit
[~PE1-vpn-instance-vpna-af-ipv4] quit
[~PE1-vpn-instance-vpna] quit
[~PE1] interface GigabitEthernet1/0/0
[~PE1-GigabitEthernet1/0/0] undo shutdown
[*PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[*PE1-GigabitEthernet1/0/0] ip address 10.1.1.2 255.255.255.0
[*PE1-GigabitEthernet1/0/0] commit
[~PE1-GigabitEthernet1/0/0] quit
[~PE1] interface GigabitEthernet2/0/0
[~PE1-GigabitEthernet2/0/0] undo shutdown
[*PE1-GigabitEthernet2/0/0] ip address 10.2.1.1 255.255.255.0
[*PE1-GigabitEthernet2/0/0] commit
[~PE1-GigabitEthernet2/0/0] quit
# Configure PE2.
[~PE2] ip vpn-instance vpna
[*PE2-vpn-instance-vpna] ipv4-family
[*PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 200:1
[*PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 export-extcommunity
[*PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 import-extcommunity
[*PE2-vpn-instance-vpna-af-ipv4] commit
[~PE2-vpn-instance-vpna-af-ipv4] quit
[~PE2-vpn-instance-vpna] quit
[~PE2] interface GigabitEthernet1/0/0
[~PE2-GigabitEthernet1/0/0] undo shutdown
[*PE2-GigabitEthernet1/0/0] ip address 10.2.1.2 255.255.255.0
[*PE2-GigabitEthernet1/0/0] commit
[~PE2-GigabitEthernet1/0/0] quit
# Configure PE2.
[~PE2] flow-route FlowSpec1 vpn-instance vpna
[*PE2-flow-route-vpna] if-match source-port equal 159
[*PE2-flow-route-vpna] apply deny
[*PE2-flow-route-vpna] commit
[~PE2-flow-route-vpna] quit
# Configure PE2.
[~PE2]bgp 200
[*PE2-bgp] peer 10.2.1.1 as-number 200
[*PE2-bgp] vpn-instance vpna
[*PE2-bgp-instance-vpna] quit
[*PE2-bgp] ipv4-flow vpn-instance vpna
[*PE2-bgp-flow-vpna] quit
[*PE2-bgp] ipv4-flow vpnv4
[*PE2-bgp-af-flow-vpnv4] peer 10.2.1.1 enable
[*PE2-bgp-af-flow-vpnv4] commit
[~PE2-bgp-af-flow-vpnv4] quit
[~PE2-bgp] quit
# Check information about the BGP VPNv4 Flow Specification routes received by
PE1.
<PE1> display bgp flow vpnv4 route-distinguisher 200:1 routing-table
Dissemination Rules:
Src. Port : eq 159
MED :0 PrefVal : 0
LocalPref: 100
Path/Ogn : i
# Check the traffic filtering rule carried in each BGP VPNv4 Flow Specification
route based on the value of ReIndex in the preceding command output.
<PE1> display bgp flow vpnv4 all routing-table 536870913
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
return
#
vpn-instance vpna
#
ipv4-flow vpn-instance vpna
#
ipv4-flow vpnv4
policy vpn-target
peer 10.2.1.2 enable
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.2.1.2 255.255.255.0
#
bgp 200
peer 10.2.1.1 as-number 200
#
ipv4-family unicast
undo synchronization
peer 10.2.1.1 enable
#
vpn-instance vpna
#
ipv4-flow vpn-instance vpna
#
ipv4-flow vpnv4
policy vpn-target
peer 10.2.1.1 enable
#
flow-route FlowSpec1 vpn-instance vpna
if-match source-port equal 159
apply deny
#
return
Networking Requirements
As shown in Figure 1-45, in a VPN, the CE belongs to AS 100; PE1 and Server
belong to AS 200; PE1 is a network ingress of AS 200. AS 200 can communicate
with AS 100 through PE1.
When an attack source appears in AS 100, attack traffic flows into AS 200 through
PE1, posing a threat to AS 200. In this case, it is required that dynamic BGP VPNv6
Flow Specification be configured to address this problem. To meet the
requirement, you need to deploy a traffic analysis server (Server) and establish a
BGP VPNv6 Flow Specification peer relationship between the server and PE1. PE1
periodically samples traffic and sends sampled traffic to the traffic analysis server.
The traffic analysis server generates a BGP VPNv6 Flow Specification route based
on the characteristics of sampled attack traffic and sends the route to PE1. PE1
then converts the route into a traffic filtering policy to filter and control attack
traffic, ensuring the security of VPN services in AS 200.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interface IP addresses.
2. Create a VPN instance on PE1 and Server and bind the VPN instance to PE1's
interface that is connected to CE1.
3. Establish a BGP VPNv6 Flow Specification peer relationship between PE1 and
the server so that the generated BGP VPNv6 Flow Specification route can be
sent to PE1 and be used by PE1 to generate a traffic filtering policy.
NOTE
The traffic analysis server is a third-party device and must be able to establish BGP
VPNv6 Flow Specification peer relationships.
Data Preparation
To complete the configuration, you need the following data:
● AS number (100) of CE1 and the AS number (200) of PE1 and Server
● VPN instance name: vpna
Procedure
Step 1 Configure IP addresses for interfaces.
For configuration details, see the configuration files.
Step 2 Create a VPN instance and bind the VPN instance to the PE1's interface that is
connected to CE1.
# Configure PE1.
[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv6-family
[*PE1-vpn-instance-vpna-af-ipv6] route-distinguisher 100:1
[*PE1-vpn-instance-vpna-af-ipv6] vpn-target 111:1 export-extcommunity
[*PE1-vpn-instance-vpna-af-ipv6] vpn-target 111:1 import-extcommunity
[*PE1-vpn-instance-vpna-af-ipv6] commit
[~PE1-vpn-instance-vpna-af-ipv6] quit
[~PE1-vpn-instance-vpna] ipv4-family
[~PE1-vpn-instance-vpna] route-distinguisher 100:1
[*PE1-vpn-instance-vpna-af-ipv4] commit
[~PE1-vpn-instance-vpna-af-ipv4] quit
[~PE1-vpn-instance-vpna] quit
[~PE1] interface GigabitEthernet1/0/0
[~PE1-GigabitEthernet1/0/0] undo shutdown
[*PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[*PE1-GigabitEthernet1/0/0] ipv6 enable
[*PE1-GigabitEthernet1/0/0] ipv6 address 2001:db8:1::2 64
[*PE1-GigabitEthernet1/0/0] commit
[~PE1-GigabitEthernet1/0/0] quit
[~PE1] interface GigabitEthernet2/0/0
[~PE1-GigabitEthernet2/0/0] undo shutdown
[*PE1-GigabitEthernet2/0/0] ip address 10.2.1.1 255.255.255.0
[*PE1-GigabitEthernet2/0/0] commit
[~PE1-GigabitEthernet2/0/0] quit
# Check information about the BGP VPNv6 Flow Specification routes received by
PE1. The command output also shows information about the received BGP IPv6
VPN Flow Specification routes.
# Check the traffic filtering rule carried in each BGP VPNv6 Flow Specification
route based on the value of ReIndex in the preceding command output.
<PE1> display bgp flow vpnv6 all routing-table 536870913
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 2001:db8:1::1 255.255.255.0
#
bgp 100
peer 2001:db8:1::2 as-number 200
#
ipv6-family unicast
undo synchronization
peer 2001:db8:1::2 enable
#
ipv6-family flow
Networking Requirements
As shown in Figure 1-46, in the VPN, CE1 belongs to AS 100; PE1 and PE2 belong
to AS 200, all devices are in the same VPN domain. PE1 is the ingress of the VPN
domain in AS 200. AS 200 can communicate with AS 100 through PE1.
If an attack source appears in AS 100, attack traffic flows into AS 200 through
PE1, which severely affects the VPN performance of AS 200.
In this case, it is required that static BGP VPNv6 Flow Specification be configured
to address this problem. To meet the requirement, you need to create a BGP IPv6
VPN Flow Specification route on PE2, and enable the BGP-Flow VPNv6 address
family so that a BGP VPNv6 Flow Specification route is generated automatically.
Then establish a BGP VPNv6 Flow Specification peer relationship between PE1 and
PE2 to transmit the BGP VPNv6 Flow Specification route. The BGP VPNv6 Flow
Specification route is used to generate a traffic filtering policy for traffic filtering
and control.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interface IP addresses.
2. Create a VPN instance on PE1 and PE2 and bind it to the interface connecting
PE1 to CE1.
3. Configure a BGP VPN Flow Specification route named FlowSpec1 on PE2 to
discard the attack traffic with the source port number being 159.
4. Establish a BGP VPNv6 Flow Specification peer relationship between PE1 and
PE2 so that the generated BGP VPNv6 Flow Specification route can be sent to
PE1 and be used by PE1 to generate a traffic filtering policy.
Data Preparation
To complete the configuration, you need the following data:
● AS number of CE1: 100; AS number of PE1 and PE2: 200
● VPN instance name: vpna
Procedure
Step 1 Configure IP addresses for interfaces.
For configuration details, see the configuration files.
Step 2 Create a VPN instance and bind the VPN instance to the PE1's interface that is
connected to CE1.
# Configure PE1.
[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv6-family
[*PE1-vpn-instance-vpna-af-ipv6] route-distinguisher 100:1
[*PE1-vpn-instance-vpna-af-ipv6] vpn-target 111:1 export-extcommunity
[*PE1-vpn-instance-vpna-af-ipv6] vpn-target 111:1 import-extcommunity
[*PE1-vpn-instance-vpna-af-ipv6] commit
[~PE1-vpn-instance-vpna-af-ipv6] quit
[~PE1-vpn-instance-vpna] ipv4-family
[~PE1-vpn-instance-vpna] route-distinguisher 100:1
[*PE1-vpn-instance-vpna-af-ipv4] commit
[~PE1-vpn-instance-vpna-af-ipv4] quit
[~PE1-vpn-instance-vpna] quit
[~PE1] interface GigabitEthernet1/0/0
[~PE1-GigabitEthernet1/0/0] undo shutdown
[*PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[*PE1-GigabitEthernet1/0/0] ip address 10.1.1.2 255.255.255.0
[*PE1-GigabitEthernet1/0/0] commit
[~PE1-GigabitEthernet1/0/0] quit
[~PE1] interface GigabitEthernet2/0/0
[~PE1-GigabitEthernet2/0/0] undo shutdown
[*PE1-GigabitEthernet2/0/0] ip address 10.2.1.1 255.255.255.0
[*PE1-GigabitEthernet2/0/0] commit
[~PE1-GigabitEthernet2/0/0] quit
# Configure PE2.
[~PE2] ip vpn-instance vpna
[*PE2-vpn-instance-vpna] ipv6-family
[*PE2-vpn-instance-vpna-af-ipv6] route-distinguisher 200:1
[*PE2-vpn-instance-vpna-af-ipv6] vpn-target 111:1 export-extcommunity
[*PE2-vpn-instance-vpna-af-ipv6] vpn-target 111:1 import-extcommunity
[*PE2-vpn-instance-vpna-af-ipv6] commit
[~PE2-vpn-instance-vpna-af-ipv6] quit
[~PE2-vpn-instance-vpna] quit
[~PE2] interface GigabitEthernet1/0/0
[~PE2-GigabitEthernet1/0/0] undo shutdown
[*PE2-GigabitEthernet1/0/0] ip address 10.2.1.2 255.255.255.0
[*PE2-GigabitEthernet1/0/0] commit
[~PE2-GigabitEthernet1/0/0] quit
# Configure PE2.
[~PE2] flow-route FlowSpec1 ipv6 vpn-instance vpna
[*PE2-flow-route-vpna] if-match source-port equal 159
[*PE2-flow-route-vpna] apply deny
[*PE2-flow-route-vpna] commit
[~PE2-flow-route-vpna] quit
# Configure PE1.
[~PE1]bgp 200
[*PE1-bgp] peer 10.2.1.2 as-number 200
[*PE1-bgp] vpn-instance vpna
[*PE1-bgp-instance-vpna] quit
[*PE1-bgp] ipv6-flow vpn-instance vpna
[*PE1-bgp-flow-vpna] quit
[*PE1-bgp] ipv6-flow vpnv6
[*PE1-bgp-af-flow-vpnv6] peer 10.2.1.2 enable
[*PE1-bgp-af-flow-vpnv6] commit
[~PE1-bgp-af-flow-vpnv6] quit
[~PE1-bgp] quit
# Configure PE2.
[~PE2]bgp 200
[*PE2-bgp] peer 10.2.1.1 as-number 200
[*PE2-bgp] vpn-instance vpna
[*PE2-bgp-instance-vpna] quit
[*PE2-bgp] ipv6-flow vpn-instance vpna
[*PE2-bgp-flow-6-vpna] quit
[*PE2-bgp] ipv6-flow vpnv6
[*PE2-bgp-af-flow-vpnv6] peer 10.2.1.1 enable
[*PE2-bgp-af-flow-vpnv6] commit
[~PE2-bgp-af-flow-vpnv6] quit
[~PE2-bgp] quit
# Check the status of the BGP VPNv6 Flow Specification peer relationship on PE2.
The command output shows that the BGP VPNv6 Flow Specification peer
relationship has been successfully established.
<PE2> display bgp flow vpnv6 all peer
# Check information about the BGP VPNv6 Flow Specification routes received by
PE1.
<PE1> display bgp flow vpnv6 route-distinguisher 200:1 routing-table
# Check the traffic filtering rule carried in each BGP VPNv6 Flow Specification
route based on the value of ReIndex in the preceding command output.
<PE1> display bgp flow vpnv6 all routing-table 536870913
AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, best, pre 255
Not advertised to any peer yet
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
bgp 100
peer 10.1.1.2 as-number 200
#
ipv6-family unicast
undo synchronization
peer 10.1.1.2 enable
#
ipv6-family flow
peer 10.1.1.2 enable
#
return
#
sysname PE2
#
ip vpn-instance vpna
ipv6-family
route-distinguisher 200:1
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.2.1.2 255.255.255.0
#
bgp 200
peer 10.2.1.1 as-number 200
#
ipv6-family unicast
undo synchronization
peer 10.2.1.1 enable
#
vpn-instance vpna
#
ipv6-flow vpn-instance vpna
#
ipv6-flow vpnv6
policy vpn-target
peer 10.2.1.1 enable
#
flow-route FlowSpec1 ipv6 vpn-instance vpna
if-match source-port equal 159
apply deny
#
return
NOTE
The HUAWEI NetEngine9000 does not support data encryption on an IPsec VPN tunnel. To
comply with RFC standards, IPsec on the HUAWEI NetEngine9000 applies only to the
DHCPv6, IGMP, IPv4 PIM, IPv6 PIM, MLD, OSPFv3, RIPng protocol packets but not to the
transmitted data.
NOTE
The maximum transmission unit (MTU) of an Ethernet interface indicates the maximum
size of an IP packet that can be transmitted without being fragmented. The Ethernet
interface discards a packet if the size of the packet sent to the Ethernet interface exceeds
the specified interface MTU. The TCP maximum segment size (MSS) indicates the
maximum size of the TCP payload that can be transmitted without being fragmented. For
TCP packets, the MTU value is equal to the sum of the TCP MSS value, TCP header length
(20 bytes), and IP header length (20 bytes) (TCP MSS + 40 bytes).
Before packets pass through an IPsec tunnel, the encryption and authentication fields are
added to the original packets. In transport mode, these fields are added between the IP and
TCP headers. In tunnel mode, a new IP header and the encryption and authentication fields
are added before the existing IP header. In this case, the sum length of the TCP MSS, 40
bytes, and added fields may exceed the interface MTU. As a result, packet loss occurs.
Therefore, when deploying IPsec, run the tcp max-mss command to adjust the TCP MSS
value. You can reduce the TCP MSS value to ensure that the IP packet size does not exceed
the MTU of the peer interface after the packet is encapsulated and transmitted along the
IPsec tunnel.
NOTE
For security purposes, you are advised not to use weak security algorithms in this feature. If
you need to use such an algorithm, run the undo crypto weak-algorithm disable
command to enable the weak security algorithm function first.
At the advent of IPv4, the Internet scale was small, and physical isolation alone
was a sufficient means for Internet security. IPv4 security protection, however, was
beyond consideration during IPv4 design and development, since no one expected
the explosive growth of the Internet.
Because IP does not provide any security, IP addresses are easily forged, contents
in IP packets may be tampered with, and packets may be replayed or intercepted
in transit. Therefore, conventional IP layer protocols cannot safeguard received IP
packets. Application-layer methods resolve the security problem, but are effective
only on specific applications. Therefore, there is an urgent need in protocols that
provide security services on the IP layer. The IPsec technology resolves this
problem.
IPsec provides following security services for IP packets mainly through encryption
and authentication:
● Data encryption
IPsec encrypts data to ensure data confidentiality.
● Data integrity authentication
IPsec ensures that the data is not tampered with during transmission using
data integrity authentication.
● Data origin authentication
IPsec authenticates data origins to ensure that data comes from real senders.
● Anti-replay
IPsec prevents malicious users from sending obtained packets by enabling the
receiver to discard duplicate packets.
Usage Scenario
IPsec can be configured to prevent protocol packets from being intercepted or
faked on a simple network.
Context
Before using IPsec to authenticate and encrypt protocol packets, you must create a
security proposal and define the security protocol type, authentication and
encryption algorithms, and encapsulation mode in the security proposal.
Procedure
Step 1 Run system-view
NOTE
NOTE
To help provide high security, do not use the MD5 or SHA1 algorithm as an AH
authentication algorithm.
● If ESP is configured, run the esp authentication-algorithm { md5 | sha1 |
sha2-256 | sha2-384 | sha2-512 } command to configure an authentication
algorithm.
NOTE
To help provide high security, do not use the MD5 or SHA1 algorithm as an ESP
authentication algorithm.
● If ESP is configured, run the esp encryption-algorithm { des | 3des | aes
{ 128 | 192 | 256 } } command to configure an ESP encryption algorithm.
NOTE
To help provide high security, do not use the DES or 3DES algorithm as an ESP
encryption algorithm.
----End
1.1.15.3.2 Configuring an SA
Configure a Security Association (SA) and specify a security protocol, a security
parameter index (SPI), and authentication keys.
Context
An SA is unidirectional. Incoming and outgoing protocol packets are processed by
different SAs. To ensure smooth SA negotiation, configure the same parameters
for the SAs that apply to incoming protocol packets and outgoing protocol packets
of the same flow, respectively. The parameters are as follows:
● Security proposal: defines the specific protection, including the authentication
and encryption algorithms.
● SPI: is a Security Parameter Index that identifies an SA.
● Key: is used to calculate message digests and encrypt protocol packets.
Procedure
Step 1 Run system-view
NOTE
A security proposal must be configured before it can be associated with protocol packet
flows.
One SA can use only one security proposal. If a security proposal has been applied to an SA,
the SA can use another security proposal only after the original one is deleted.
An SPI is set.
NOTE
The SPI uniquely identifies an SA. The inbound and outbound SPIs are set, and the inbound
SPI on the local end must be the same as the outbound SPI on the peer end.
Step 5 To configure the authentication key, run either of the following commands:
1. Run sa authentication-hex { inbound | outbound } { ah | esp } [ cipher ]
key-cipher-key
An authentication key for outgoing protocol packets on the local end must be identical with
that for incoming protocol packets on the peer end.
If multiple authentication keys are configured, the latest one takes effect.
Updating keys periodically is recommended.
----End
Context
To defend against network attacks, configure IPsec so that IPsec can be
implemented on protocol packets exchanged between routers. Table 1-26
describes IPsec applications.
Prerequisites
The security proposal and SA have been configured.
Procedure
Step 1 Run the display ipsec sa manual [ brief | name sa-name [ brief ] ] command to
check information about SAs.
Step 2 Run the display ipsec proposal [ name proposal-name | brief ] command to
check information about a security proposal.
Step 3 Run the display ipsec statistics [ sa-name sa-name ] [ slot slot-number ]
command to check statistics about protocol packets processed by IPsec.
----End
Networking Requirements
On the network shown in Figure 1-47, DeviceA and DeviceB are connected over a
public network, and OSPFv3 is deployed for their communication.
Configuration Notes
● The encapsulation modes and security protocols on both IPsec peers must be
identical.
● The authentication modes and encryption algorithms on the two IPsec peers
must be identical.
● The security parameter indexes (SPIs) and authentication keys on the two
IPsec peers must be identical.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure basic OSPFv3 functions on DeviceA and DeviceB.
2. Configure IPsec proposals. Configure ESP as the security protocol, SHA2-256
as the authentication algorithm, and AES-256 as the encryption algorithm.
3. Set SA parameters.
4. Apply SAs to OSPFv3 processes, enabling IPsec to protect OSPFv3 packets
transmitted between DeviceA and DeviceB.
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Configure OSPFv3 on DeviceA and DeviceB.
# Configure DeviceA.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] ospfv3 1
[*DeviceA-ospfv3-1] router-id 1.1.1.1
[*DeviceA-ospfv3-1] area 0
[*DeviceA-ospfv3-1-area-0.0.0.0] commit
[~DeviceA-ospfv3-1-area-0.0.0.0] quit
# Configure DeviceB.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] ospfv3 1
[*DeviceB-ospfv3-1] router-id 2.2.2.2
[*DeviceB-ospfv3-1] area 0
[*DeviceB-ospfv3-1-area-0.0.0.0] commit
[~DeviceB-ospfv3-1-area-0.0.0.0] quit
# Configure DeviceB.
[~DeviceB] interface gigabitethernet1/0/1
[~DeviceB-GigabitEthernet1/0/1] ipv6 enable
[*DeviceB-GigabitEthernet1/0/1] ipv6 address 2001:db8::2 64
[*DeviceB-GigabitEthernet1/0/1] ospfv3 1 area 0
[*DeviceB-GigabitEthernet1/0/1] commit
[~DeviceB-GigabitEthernet1/0/1] quit
[*DeviceA-ipsec-proposal-proposal1] commit
[~DeviceA-ipsec-proposal-proposal1] quit
# Run the display ipsec proposal command on DeviceA and DeviceB to check the
configuration. The following example uses the command output on DeviceA.
[~DeviceA] display ipsec proposal
Total IP security proposal number: 1
IP security proposal name: proposal1
encapsulation mode: transport
transform: esp-new
ESP protocol: authentication SHA2-HMAC-256, encryption 256-AES
Step 4 Configure IPsec SAs on DeviceA and DeviceB and apply a proposal to each SA.
# Configure an IPsec SA on DeviceA and apply a proposal to it.
[~DeviceA] ipsec sa sa1
[*DeviceA-ipsec-sa-sa1] proposal proposal1
[*DeviceA-ipsec-sa-sa1] commit
Step 5 # Configure SPIs and authentication keys in string format on DeviceA and DeviceB.
# Configure SPIs and authentication keys in string format on DeviceA.
[~DeviceA] ipsec sa sa1
[*DeviceA-ipsec-sa-sa1] sa spi inbound esp 12345
[*DeviceA-ipsec-sa-sa1] sa spi outbound esp 12345
[*DeviceA-ipsec-sa-sa1] sa string-key inbound esp abcdef
[*DeviceA-ipsec-sa-sa1] sa string-key outbound esp abcdef
[*DeviceA-ipsec-sa-sa1] commit
[~DeviceA-ipsec-sa-sa1] quit
# Run the display ipsec statistics command to check statistics about incoming
and outgoing protocol packets processed by IPsec and detailed information about
dropped protocol packets. If statistics about incoming and outgoing protocol
packets processed by IPsec are displayed, the configuration succeeds. For example:
[~DeviceA] display ipsec statistics
IPv6 security packet statistics:
input/output security packets: 184/19
input/output security bytes: 13216/1312
input/output dropped security packets: 0/0
dropped security packet detail:
memory process problem: 0
can't find SA: 0
queue is full: 0
authentication is failed: 0
wrong length: 0
replay packet: 0
too long packet: 0
invalid SA: 0
policy deny: 0
the normal packet statistics:
input/output dropped normal packets: 0/0
IPv4 security packet statistics:
input/output security packets: 0/0
input/output security bytes: 0/0
input/output dropped security packets: 0/0
dropped security packet detail:
memory process problem: 0
can't find SA: 0
queue is full: 0
authentication is failed: 0
wrong length: 0
replay packet: 0
too long packet: 0
invalid SA: 0
policy deny: 0
----End
Configuration Files
● DeviceA configuration file
#
sysname DeviceA
#
ipsec proposal proposal1
encapsulation-mode transport
esp authentication-algorithm sha2-256
esp encryption-algorithm aes 256
#
ipsec sa sa1
proposal proposal1
sa spi inbound esp 12345
sa string-key inbound esp %#%#<}jb{br9\zi%X+/Y@:Y>Lw(L\v#*^KsM"/8RaRe$%#%#
sa spi outbound esp 12345
sa string-key outbound esp %#%#<}j/@X4355SE9JZTD0>GQf"}w2@X,k6.E\Z,z\{#%#%#
#
ospfv3 1
router-id 1.1.1.1
ipsec sa sa1
area 0.0.0.0
#
interface GigabitEthernet1/0/1
undo shutdown
ipv6 enable
ipv6 address 2001:db8::1/64
ospfv3 1 area 0
#
return
NOTE
For security purposes, you are not advised to use the weak security algorithm in this
feature. To use the weak security algorithm, run the undo crypto weak-algorithm disable
command to enable the weak security algorithm.
Usage Scenario
Two devices need to obtain each other's identity information during an IPsec
negotiation. The NE9000 can use either a pre-shared key or certificate for identity
authentication. If you use certificates for device identity authentication, configure
the devices to obtain certificates before they perform an IPsec negotiation.
The NE9000 can obtain certificates either using CMP or in outband mode. CMP is
recommended to obtain and manage certificates on a CMP-capable network that
has many devices deployed.
Pre-configuration Tasks
Before configuring CMP-based certificate management, complete the following
tasks:
● Complete basic configurations for a CA server so that the CA server can
automatically issue certificates.
Usage Scenario
Generating a key pair is important for applying a certificate. The key pair consists
of a private key and a public key. The private key is reserved by a user, and the
public key and other information are delivered to the CA. Then, the CA generates a
certificate and signs it with the public key. If the private key is disclosed, the user
must delete the old key pair, create a new key pair, and reapply for a certificate.
NOTE
An RSA key pair is the abbreviation of the three names: Ron Rivest, Adi Shamirh,
and LenAdleman and is a public key encryption algorithm. RSA key pairs are
categorized into host key pairs and server key pairs. Each key pair is composed of
a private key and a public key. These two key pairs are used by SSH. The server
key pair is periodically changed by the local server, while the host key pair remains
unchanged. The host key pair is used when you apply for a certificate.
NOTE
● If an unnamed RSA key pair exists on a device, a newly created key pair overwrites the
old one. If multiple RSA key pairs exist or a named RSA key exists on a device, delete the
existing RSA key pairs before creating and renaming RSA key pairs.
● After the key pair is deleted or replaced, the existing certificate becomes invalid. You
need to apply for a new certificate, which ensures the RSA key pair and certificate
match.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run rsa pki local-key-pair [ key-name ] create
The local key pair is created.
NOTE
If the RSA key pair already exists on the device, you can also run the pki import rsa-key-
pair keypair-name { der key-filename | pem key-filename password password-val }
command to import the RSA key pair to the device memory for the configuration to take
effect. In this case, you do not need to create an RSA key pair.
----End
Context
The local certificate associates user identity information with the user public key,
while the identity information must be associated with a specific PKI entity. The
CA identifies the certificate applicant based on the identity information that the
entity provides. The entity information includes:
● Common name of the entity
● Country code of the entity
● Email address of the entity
● Fully Qualified Domain Name (FQDN) of the entity
● IP address of the entity
● Name of the region where the entity resides
● Organization name of the entity
● Department name of the entity
● State or province of the entity
NOTE
In the entity information, the common name of the entity is mandatory. Whether to
configure other attributes depends on the certificate issuing policy on the CA server. If
the attributes used to filter certificates do not map the certificate issuing policy,
certificate application will fail.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run pki entity entity-name
An entity name is created and the entity view is displayed.
Step 3 Configure entity attributes.
● Run common-name cn-name
The common name of the entity is configured.
● (Optional) Run country country-code
The country code of the entity is specified.
● (Optional) Run email email-address
The email address of the entity is configured.
● (Optional) Run fqdn fqdn-name
The FQDN of the entity is configured.
● (Optional) Run ip-address ip-address
The IP address of the entity is configured.
● (Optional) Run locality locality-name
The name of the locality where the entity resides is specified.
----End
Context
If CMP is used to obtain and manage certificates, the NE9000 and CA server
establish a CMP session to exchange the information required for generating
certificates. Before a CMP session is established, ensure that the NE9000 has the
following information to establish the CMP session:
● PKI entity
● RSA key pair
● Name of the CA server with which the NE9000 establishes the CMP session
● Certificate for authenticating the identity of the NE9000
● URL of the CMP server that receives CMP requests
Each digital certificate has a validity period. To ensure service availability, apply for
a new certificate before the existing certificate expires. However, manual operation
may leave certain certificates not updated. The NE9000 supports automatic
certificate update. The NE9000 initiates a certificate update request to the
connected CMPv2 server when the percentage of the certificate's remaining
validity period reaches a specified value. The obtained certificate overwrites the
certificate on the CF card and in the memory.
Perform the following steps on the NE9000 that needs to use CMP to obtain a
certificate:
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run pki domain domain-name
A PKI domain is created, and the PKI domain name configuration view is
displayed.
Step 3 Run pki cmp session session-name
NOTICE
An RSA key pair can be referenced by only one CMP session or PKI domain.
----End
Prerequisites
Before configuring automatic update, verify the functions to ensure that the
network and server are normal.
Context
The NE9000 supports IRs and KURs.
● IR: When the NE9000 does not obtain a certificate authorized by a carrier, it
needs to send an IR to request an identity authentication certificate.
● KUR: Each certificate has a validity period with definite start and end dates.
Therefore, the NE9000 needs to update its certificate before the certificate
expires. Automatic certificate update can be configured on the NE9000.
Certificates obtained using IRs are stored on the CF card but do not take effect.
These certificates take effect only after they are imported to the memory using a
command. Certificates obtained using KURs can be automatically saved in the
memory if the KUR function is enabled.
Perform the following steps on the NE9000 where you need to apply for a
certificate.
Procedure
Step 1 Run the system-view command to enter the system view.
Step 2 Run the pki domain domain-name command to enter the PKI domain name
configuration view.
Step 3 Run the pki cmp initial-request command to use IRs to apply for a certificate for
the local device.
If the NE9000 does not receive any response from the connected CA server after
sending a CMP request, it polls the CMP request. You can perform the following
steps to stop the CMP request polling process.
1. Run the pki cmp session session-name command to enter the CMP session
view.
2. Run the cmp poll-request stop command to manually stop the process of
polling a CMP request.
3. Run the quit command to return to the PKI domain name configuration view.
Step 6 Run the pki import-certificate local [ domain domainName ] filename file-
name command to import the local certificate.
NOTE
To ensure high security, you are advised not to import certificates that use the MD5 or
SHA1 algorithm. The recommended key length of a certificate is 2048 bits or more.
The default domain of the PKI is a reserved domain. In the default domain, you can run the
pki import-certificate command to install the downloaded user certificate or run the pki
load preset-local domain default command to load the preconfigured local certificate. By
default, a preconfigured local certificate has been loaded to the default domain.
Step 7 Run the pki domain domain-name command to enter the PKI domain name
configuration view.
Step 8 Run the pki cmp session session-name command to enter the CMP session view.
Step 10 Run the quit command to return to the PKI domain name configuration view.
NOTE
To ensure high security, you are advised not to import certificates that use the MD5 or
SHA1 algorithm. The recommended key length of a certificate is 2048 bits or more.
The default domain of the PKI is a reserved domain. In the default domain, you can run the
pki import-certificate command to install the downloaded user certificate or run the pki
load preset-ca domain default command to load the preconfigured CA certificate.
----End
Prerequisites
CMP-based certificate management has been configured.
Procedure
Step 1 Run the display rsa pki local-key-pair public command to check RSA key pairs.
Step 3 Run the display pki cert-req filename file-name command to check the
certificate request file with a specific name.
Step 4 Run the display pki certificate filename file-name command to check the
certificate file with a specific name.
Step 5 Run the display pki crl filename file-name command to check the CRL file with a
specific name.
Step 6 Run the display pki ca_list [ domain domainName ] command to check the CA
certificates and CRL in the memory of a device.
Step 7 Run the display pki cert_list [ domain domainName ] command to check local
certificates in the memory of a device.
----End
Applicable Environment
Two devices use digital certificates to authenticate each other's identity when
establishing a VPN, which prevents middleman attacks.
As shown in Figure 1, Device A and Device B apply for certificates from a same CA
server, and download CA certificates and local certificates from the server. When
an IPsec VPN needs to be established for data transmission between Device A and
Device B, Device A and Device B must authenticate each other using certificates.
When both have passed authentication, they can set up the IPsec VPN.
Pre-configuration Tasks
Before configuring the entity information, complete the following tasks:
● Assign an IP address to each interface.
● Configure routes between the devices that use digital certificates to
authenticate each other's identity when establishing a VPN.
Usage Scenario
Generating a key pair is important for applying a certificate. The key pair consists
of a private key and a public key. The private key is reserved by a user, and the
public key and other information are delivered to the CA. Then, the CA generates a
certificate and signs it with the public key. If the private key is disclosed, the user
must delete the old key pair, create a new key pair, and reapply for a certificate.
NOTE
An RSA key pair is the abbreviation of the three names: Ron Rivest, Adi Shamirh,
and LenAdleman and is a public key encryption algorithm. RSA key pairs are
categorized into host key pairs and server key pairs. Each key pair is composed of
a private key and a public key. These two key pairs are used by SSH. The server
key pair is periodically changed by the local server, while the host key pair remains
unchanged. The host key pair is used when you apply for a certificate.
NOTE
● If an unnamed RSA key pair exists on a device, a newly created key pair overwrites the
old one. If multiple RSA key pairs exist or a named RSA key exists on a device, delete the
existing RSA key pairs before creating and renaming RSA key pairs.
● After the key pair is deleted or replaced, the existing certificate becomes invalid. You
need to apply for a new certificate, which ensures the RSA key pair and certificate
match.
Procedure
Step 1 Run system-view
NOTE
If the RSA key pair already exists on the device, you can also run the pki import rsa-key-
pair keypair-name { der key-filename | pem key-filename password password-val }
command to import the RSA key pair to the device memory for the configuration to take
effect. In this case, you do not need to create an RSA key pair.
----End
Context
The local certificate associates user identity information with the user public key,
while the identity information must be associated with a specific PKI entity. The
CA identifies the certificate applicant based on the identity information that the
entity provides. The entity information includes:
In the entity information, the common name of the entity is mandatory. Whether to
configure other attributes depends on the certificate issuing policy on the CA server. If
the attributes used to filter certificates do not map the certificate issuing policy,
certificate application will fail.
Procedure
Step 1 Run system-view
----End
Context
NOTE
In the two-node cluster scenario, you are advised to set different certificate expiration dates
for the active and standby devices to prevent the active and standby devices from both
being unavailable.
Procedure
● Configure a PKI domain.
a. Run the system-view command to enter the system view.
b. Run the pki domain domain-name command to create a PKI domain and
enter the PKI domain view.
NOTE
To ensure high security, you are advised not to import certificates that use the
MD5 or SHA1 algorithm. The recommended key length of a certificate is 2048
bits or more.
The default domain of the PKI is a reserved domain. In the default domain, you
can run the pki import-certificate command to install the downloaded user
certificate or run the pki load { preset-ca | preset-local } domain default
command to load the preconfigured local certificate or CA certificate. By default,
a preconfigured local certificate has been loaded to the default domain.
c. (Optional) Run the pki strict-mode command to enable the PKI strict
check mode.
----End
Prerequisites
PKI certificates have been configured.
Procedure
Step 1 Run the display rsa pki local-key-pair [ file-name ] public command to check
information about the public key of the RSA key pair.
Step 2 Run the display pki cert-req filename file-name command to check contents in
the specific certificate request file.
Step 3 Run the display pki certificate filename file-name command to check contents
in the specific certificate.
Step 4 Run the display pki ca_list [ domain domainName ] command to check contents
in the CA certificates that are imported into the memory of the device.
Step 5 Run the display pki cert_list [ domain domainName ] command to check
contents in the local certificate that is imported into the memory of the device.
----End
Context
When a certificate is obtained, an IPsec tunnel can be set up between two devices
after the devices pass the identity verification during IPsec negotiation. To ensure
communication security during IPsec negotiation, configure certificate validity
check. A router supports CRL check, CA certificates, and local certificates.
Pre-configuration Tasks
Before configuring certificate validity check, complete the task of Obtaining
Certificates.
Prerequisites
Before setting automatic CRL update, verify functions to ensure that the network
and server are normal.
Context
Before configuring the CRL function, be aware of the following information:
● Enable CRL check.
Before configuring CRL, enable CRL check.
When a certificate is being verified after CRL check is enabled, the CRL is
queried for checking whether it contains the serial number of the certificate. If
the CRL contains the serial number of the certificate, the certificate has been
revoked and considered invalid. For details about how to verify the certificate
validity, see 1.1.16.5.2 Verifying the Certificates.
● Update the CRL.
To ensure that the latest CRL is used, check the CRL status periodically and
download the latest CRL from the CRL server using HTTP or LDAP.
Updating the CRL consists of automatically updating the CRL and manually
updating the CRL. Automatically updating the CRL can be implemented using
HTTP or LDAP. After the specified interval elapses, the system automatically
downloads the CRL using HTTP or LDAP. When the latest CRL is urgently
required, manually update the CRL by downloading the CRL from the CRL
server.
If the device does not have any homogeneous CRL certificate, the new CRL
certificate is imported to the non-domain.
If the device has only one homogeneous CRL certificate, the new CRL certificate
replaces this certificate.
If the device has multiple homogeneous CRL certificates, the new CRL certificate
preferentially replaces the homogeneous CRL certificate in the local domain. If this
condition is not met, the new CRL certificate replaces the homogeneous CRL
certificate in the non-domain. If both of the preceding conditions are not met, the
new CRL certificate is imported into the non-domain.
Homogeneous certificates refer to certificates with the same issuer and subject.
Local domain refers to the PKI domain where configurations need to be
automatically updated. Non-domain refers to an isolated domain that does not
belong to any PKI domain.
Procedure
Step 1 Enable CRL check.
1. Run the system-view command to enter the system view.
2. Run the pki crl check enable command to enable CRL check.
NOTE
When the system is configured to automatically update the CRL using HTTP or LDAP, note
the following:
● There is sufficient space in the CF card for the CRL file.
If the ssl parameter is specified, you need to bind the SSL policy to the LDAP
client. For details, see optional steps b and d.
This command can be executed only after the crl ldap command is run.
j. Run the crl ldap [ attribute attr-value ] dn dn-value command to
configure the attributes and identifier used to obtain the CRL from the
LDAP server.
This command can be executed only after the crl ldap command is run.
k. Run the commit command to commit the configuration.
● Manually update the CRL.
a. Download a CRL. Select a CRL download mode as needed.
Prerequisites
● Creating an RSA Key Pair
● Obtaining Certificates
● (Optional) Configuring the CRL Function
Context
If IPsec negotiation that is implemented using certificates fails between two
devices, run the pki validate-certificate command to check the signature and
validity period of certificates for fault locating.
If the CRL check function has been enabled (for detailed configuration, see Step 1
in 1.1.16.5.1 Configuring the CRL Function), the system checks whether the
serial number of the peer device's certificate is listed in the CRL and then verify
the signature and validity period information.
The device automatically checks the validity of all installed local certificates and
CA certificates periodically. The default check period is 5 minutes. If a fault is
detected, an alarm is generated. For certificate validity check, the default
expiration pre-warning period is 90 days. That is, an alarm is generated 90 days
before the certificate expires, prompting a user to prepare to obtain a new
certificate in advance.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Manually verify certificates.
NOTE
The pki validate-certificate ca command verifies only root CA certificates but not
subordinate certificates. If a NE9000 device imports multiple CA certificates, run the pki
validate-certificate local command to verify subordinate certificates.
If an imported CA file contains multiple certificates, only the first certificate is verified.
● Run pki validate-certificate ca { domain domainName | filename file-
name }
The root certificate is verified.
● Run pki validate-certificate local { domain domainName | filename file-
name }
The local certificate or subordinate certificate is verified.
● Run pki validate-certificate peer { domain domainName | filename file-
name }
----End
Context
In the application scenario where the certificate verification mechanism is used to
establish an IPsec tunnel, there is a possibility that only the certificates meeting
specific requirements can be authenticated for the establishment of the IPsec
tunnel. For example, only certificates issued by a specific CA can be authenticated.
You can also configure the access control policy that allows only certificates of
specific devices to be authenticated, and these specific devices can establish IPsec
tunnels. This achieves refined control on user access permissions.
If information in a certificate does not match the rules in the access control policy,
the default action permit in the access control policy is performed on the NE9000.
As a result, the certificate can be authenticated.
Procedure
● Configure the access control policy based on certificate attributes.
NOTE
The access control policy based on certificate attributes is created and the
PKI access configuration view is displayed.
f. Run rule id { permit | deny } group-name
----End
NOTICE
A device runs a version earlier than and has PKI configured. A PKI key is changed
after the device is upgraded from a version earlier than V800R011C10 to the
current version. After the device is rolled back to a version earlier than
V800R011C10, the new key does not take effect. In this case, you need to create a
certificate again.
NOTICE
Context
NOTICE
Certificates cannot be restored after being deleted. Exercise caution when running
the deletion command.
Procedure
● Delete the CA certificate and local certificate with specific names.
a. Run the system-view command to enter the system view.
b. Run the pki delete-certificate { ca | crl | local | peer } [ domain
domainName ] filename file-name command to delete a CA certificate
or local certificate with a specific name from the memory. It is not
deleted from the CF card.
NOTE
Context
NOTICE
After you delete the RSA key pair used by a certificate, the certificate cannot be
updated, and the RSA key pair cannot be restored. Exercise caution when deleting
an RSA key pair.
Procedure
● Run the rsa pki local-key-pair [ key-name ] destroy command to delete a
local RSA pair.
----End
Context
NOTE
CMP session statistics cannot be restored after they are cleared. Exercise caution when
running the reset pki cmp statistics command. Before running the reset pki cmp
statistics command, run the display pki cmp statistics session session-name command to
check whether the CMP session statistics to be cleared are still required.
Procedure
Step 1 Run the reset pki cmp statistics session session-name command to clear CMP
session statistics.
----End
Context
A local certificate has a validity period and has a specific start date and end date.
During certificate verification, the system checks whether the certificate is within
the validity period. If the certificate is not within the validity period, the certificate
verification fails. The CRL certificate has a validity period. If the validity period
expires, the CRL certificate cannot be used for verification, causing security risks.
NOTE
The local certificate and CRL certificate must be updated before they expire. Otherwise,
service loss or security risks may occur.
Procedure
● Update an expired local certificate in offline mode.
a. Run the system-view command to enter the system view.
b. Run the pki delete-certificate local [ domain domainName ] filename
file-name command to configure the device to delete the expired local
certificate file with the specified name from the memory.
c. Obtain the certificate. For details, see 1.1.16.4.3 Obtaining a Certificate.
● Configure CMP to update the expired local certificate.
a. Run the system-view command to enter the system view.
b. Run the pki delete-certificate local [ domain domainName ] filename
file-name command to configure the device to delete the expired local
certificate file with the specified name from the memory.
c. Configure CMP certificate application. For details, see 1.1.16.3.4
Configuring CMP-based Certificate Management.
● Configure CMP-based update of expired certificates for device identity
verification.
a. Manually apply for a new device identity certificate file from the CA
server of the CMP. For details, see 1.1.16.4.3 Obtaining a Certificate.
b. Upload the new license file to cfcard:/.
c. Run the system-view command to enter the system view.
d. Run the pki domain domain-name command to enter the view of the
PKI domain in which the certificate is to be replaced.
e. Run the pki cmp session session-name command to create a CMP
session and enter the PKI CMP session view.
f. Run the cmp request authentication-cert cert-name command to
update the certificate in a specified certificate request file.
g. Run the commit command to commit the configuration. The new
identity certificate is replaced.
● Update expired CRL certificates.
a. Run the system-view command to enter the system view.
b. Run the pki delete-certificate crl [ domain domainName ] filename
file-name command to configure the device to delete expired CRL files
with specified names from the memory.
c. Configure the CRL certificate. For details, see 1.1.16.5.1 Configuring the
CRL Function.
----End
Context
NOTE
The mirroring feature may be used to analyze the communication information of terminal
customers for a maintenance purpose. Before enabling the mirroring function, ensure that
it is performed within the boundaries permitted by applicable laws and regulations.
Effective measures must be taken to ensure that information is securely protected.
Mirroring can be classified into the following types according to the conditions
that the packets to be copied meet:
● Port mirroring: The packets sent and received by a mirroring interface are
completely copied to a specific observing port.
● Flow mirroring: On the basis of traffic classification, only the packets that
match specific rules are copied and the other packets are filtered out. By
filtering out packets that the system does not concern about, the system to
control packets with fine granularity and improving the efficiency for the
packet analyzer.
Mirroring can also be classified into the following types according to the direction
in which the packets are copied:
● Upstream mirroring: All packets or packets that match specific rules received
by a mirroring interface are copied to a specific observing port.
● Downstream mirroring: All packets or the packets that match specific rules to
be sent by a mirroring interface are copied to a specific observing port.
Usage Scenario
Port mirroring applies to scenarios where you want to observe and analyze the
traffic status of a port on the network device directly connected to a router. In
such scenarios, you can configure port mirroring for the router to mirror the traffic
of that port to a dedicated packet analyzer for analysis, thereby avoiding
complicated analysis on the port.
NOTE
Pre-configuration Tasks
Before configuring port mirroring, complete the following task:
● Connect interfaces and configure physical parameters for them to ensure that
their physical status is up.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run port-observing observe-index observe-index [ without-filter ]
The interface is configured as an observing port.
An observing port sends the traffic obtained from the mirrored port to a packet
analyzer without filtering or modifying frames. On the input side, frames are
mirrored before having their headers removed. On the output side, frames are
mirrored after being modified.
----End
Context
Local mirroring can be implemented in both common mode and mirroring
instance mode. The characteristics of the two modes are as follows:
● The common mode supports interface-based mirroring, whereas the mirroring
instance mode supports board-based mirroring.
● Both modes allow you to limit the rate of mirrored traffic. In common mode,
the rate limit needs to be configured on a specified interface. In mirroring
instance mode, a shared CAR can be configured for a specified mirroring
instance and then applied to different interfaces bound to the mirroring
instance. As such, the mirroring instance mode offers simpler configuration
and higher forwarding performance.
● The mirroring instance mode supports instance sharing, so that multiple
interfaces can share the same mirroring instance. This enables more interfaces
to support port mirroring in scenarios with limited mirroring specifications.
Procedure
● Mirroring in common mode
a. Run system-view
The system view is displayed.
b. (Optional) Run observe user-defined-filter id { offset offset-value value
value value-mask } &<1-4>
A user-defined any-byte matching rule is configured for mirrored packets.
c. Run interface interface-type interface-number
The interface view is displayed.
d. According to observation requirements, run the corresponding command
for configuration.
NOTE
If cpu-packet is specified, only the packets sent from the interface to the
CPU are mirrored.
i. Run system-view
The system view is displayed.
ii. Run mirror instance instance-name location
A mirroring instance is created.
iii. Run commit
The configuration is committed.
iv. Run bridge-domain bd-id
The BD view is displayed.
v. Run port-mirroring instance instance-name { inbound | outbound }
[ group group-name ]
The traffic in the BD is observed.
vi. Run commit
The configuration is committed.
----End
Context
You can use either of the following methods to specify an observing port for
mirroring:
● Specify an observing port for board-based mirroring.
With this method, the mirrored traffic of the entire interface board on the
NE9000 is sent to only the same observing port.
NOTE
The observing port specified for board-based mirroring can be configured on either
the local or non-local interface board.
The mirroring instance mode supports only board-based mirroring.
● Specify an observing port for interface-based mirroring.
With this method, the mirrored traffic of an interface on the NE9000 is sent
to the specified observing port.
NOTE
Procedure
Step 1 Run system-view
The upstream and downstream packets of the mirrored port can be mirrored to either
the same observing port or different observing ports. If observing ports for upstream
and downstream packets are not both specified, the observing port specified for
board-based mirroring is used for the packets whose observing port is not specified.
----End
Context
To simplify port mirroring configuration, you can configure port mirroring in
integrated mode.
NOTE
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run port-mirroring to { null0 | interface interface-type interface-number
observe-index observe-index } { inbound | cpu-packet | outbound } [ user-
defined-filter user-defined-filter-id ]
Port mirroring is configured in integrated mode.
----End
Context
The mirrored port and observing port required for mirroring must be configured
before you configure the CAR function for mirrored traffic.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number if the mirrored port is not an EVC
Layer 2 sub-interface
The interface view is displayed.
In this case, the interface functions as the mirrored port. The CAR function takes
effect only when the corresponding observing port is a logical interface.
To limit the rate of mirrored traffic in a scenario where the mirrored port is an EVC
Layer 2 sub-interface or a BD, enter the corresponding view to configure the CAR
function. The view varies according to the scenario.
----End
Context
The mirrored port and observing port required for mirroring must be configured
before you configure the function to mirror packet content of a specified length.
Procedure
Step 1 Run system-view
Step 2 Run interface interface-type interface-number if the mirrored port is not an EVC
Layer 2 sub-interface
● If the mirrored port is configured in mirroring instance mode, run the mirror
instance instance-name location command to enter the mirroring instance
view.
Step 3 Run port-mirroring slice-size slice-size-value
The length of packet content to be mirrored is specified.
----End
Context
To enable mirroring statistics collection, perform the following operations.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run mirror statistic enable
Mirroring statistics collection is enabled.
Step 3 Run commit
The configuration is committed.
----End
Procedure
● Run the display port-mirroring interface [ interface-type interface-number |
slot slot-id ] command to check the configuration of the mirrored port.
● Run the display port-observing interface [ interface-type interface-number |
slot slot-id ] command to check the configuration of the observing port.
● Run the display port-observing observe-index [ observe-index ] command
to check the index of the observing port.
● Run the display mirror instance [ instance-name ] location command to
check the configuration of the specified mirroring instance on an EVC Layer 2
sub-interface.
● Run the display observe user-defined-filter [ id ] command to check user-
defined mirroring filter rules.
● Run the display port-mirroring integration [ interface interface-type
interface-number ] command to check the configuration of port mirroring
configured in integrated mode.
● Run the display port-observing slot [slotid] command to check the mapping
between the observing port for board-based mirroring and the slot ID of the
associated interface board.
----End
Context
When disabling port mirroring, you can delete the observing port configuration of
the involved board, the observing port configuration of the involved interface, and
the mirrored-port configuration of the involved interface in any sequence.
Procedure
Step 1 Run system-view
----End
Usage Scenario
If refined control is required for the packets sent to a packet analyzer, you can use
flow mirroring. In this manner, only the packets that meet specific conditions are
copied and the other packets are filtered out, improving the efficiency of the
analyzer.
NOTE
Although you can configure an observing port, specify the observing port for board-based
mirroring, and apply a traffic policy to a mirrored port in any sequence, you need to
perform all these operations. Otherwise, flow mirroring cannot take effect. When the
mirroring function is not required, you are advised to disable it so that it does not adversely
affect other services.
Pre-configuration Tasks
Before configuring flow mirroring, complete the following task:
● Connect interfaces and configure physical parameters for them to ensure that
their physical status is up.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run port-observing observe-index observe-index [ without-filter ]
The interface is configured as an observing port.
An observing port sends the traffic obtained from the mirrored port to a packet
analyzer without filtering or modifying frames. On the input side, frames are
mirrored before having their headers removed. On the output side, frames are
mirrored after being modified.
Step 4 (Optional) Run port-observing with-linklayer-header
Local mirroring is configured to mirror packets from their link layer headers.
Step 5 (Optional) Run port-observing dest-mac dest-mac-address
A destination MAC address is configured for mirrored packets of the observing
port.
The port-observing dest-mac dest-mac-address and port-observing pop-label
commands are mutually exclusive.
Step 6 Run commit
The configuration is committed.
----End
Context
You can use either of the following methods to specify an observing port for
mirroring:
The observing port specified for board-based mirroring can be configured on either
the local or non-local interface board.
● Specify an observing port for interface-based mirroring.
With this method, the mirrored traffic of an interface on the NE9000 is sent
to the specified observing port.
NOTE
Procedure
Step 1 Run system-view
Step 2 Specify an observing port for board-based flow mirroring or interface-based flow
mirroring as required.
----End
Procedure
● Define a traffic classifier.
a. Run system-view
h. Run return
Return to the user view.
● Define a traffic policy to associate the traffic classifier with the traffic
behavior.
a. Run system-view
The system view is displayed.
b. Run traffic policy policy-name
A traffic policy is defined and its view is displayed.
c. Run classifier classifier-name behavior behavior-name
A traffic behavior is specified for the traffic classifier in the traffic policy.
d. Run commit
The configuration is committed.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
This interface functions as the mirrored port.
Step 3 Run traffic-policy policy-name { inbound | outbound } [ all-layer | link-layer |
mpls-layer ]
A traffic policy is applied to the interface.
Step 4 Run commit
The configuration is committed.
----End
Context
To enable mirroring statistics collection, perform the following operations.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run mirror statistic enable
Mirroring statistics collection is enabled.
Step 3 Run commit
The configuration is committed.
----End
Procedure
● Run the display traffic behavior { system-defined | user-defined }
[ behavior-name ] command to check the traffic behavior configuration.
● Run the display traffic classifier { system-defined | user-defined }
[ classifier-name ] command to check the traffic classifier configuration.
● Run the display traffic policy { system-defined | user-defined } [ policy-
name [ classifier classifier-name ] ] command to check the configurations of
a specified or all traffic classifiers in a specified or all traffic policies as well as
the configurations of the traffic behaviors associated with the traffic
classifiers.
● Run the display port-observing interface [ interface-type interface-number |
slot slot-id ] command to check the observing port configuration of a
specified interface or interface board.
----End
Context
When disabling flow mirroring, you can delete the observing port configuration of
the specified interface, the observing port configuration for mirroring, and the
traffic policy applied to the corresponding interface in any sequence.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
----End
Procedure
● Run the display port-mirroring interface interface-type interface-number
traffic-policy policy-name verbose command to check statistics about a
specified mirrored port.
----End
Context
NOTICE
Statistics cannot be restored after being cleared. Exercise caution when you run
the reset command.
Procedure
● Run the reset mirror counters interface interface-type interface-number
command to clear mirroring statistics about a specified interface.
----End
Networking Requirements
NOTE
This example uses the method of specifying an observing port for board-based mirroring.
To specify an observing port for interface-based mirroring, see Step 1.2 in 1.1.17.3.3
Specifying an Observing Port for Mirroring.
In Figure 1-50, to monitor the packets sent from DeviceA to GE3/0/0 on DeviceB,
specify GE1/0/0 on DeviceB as an observing port and configure board-based
mirroring on GE3/0/0. In this way, all the packets received by GE3/0/0 are copied
to GE1/0/0 for analysis by HostD (the analyzer).
The configurations in this example are performed on DeviceA, DeviceB, and DeviceC, all of
which can be HUAWEI NetEngine9000 devices.
DeviceB GE1/0/0 - -
Configuration Notes
Do not configure an interface as both an observing port and a mirrored port.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure GE1/0/0 on DeviceB as an observing port.
2. Configure GE3/0/0 on DeviceB as a mirrored port and enable board-based
mirroring.
Data Preparation
To complete the configuration, you need the following data:
● IP address of each interface
● Types and numbers of the observing port and mirrored port
Procedure
Step 1 Configure IP addresses for interfaces and ensure that the corresponding routes are
reachable. For configuration details, see Configuration Files in this section.
Step 2 Configure GE1/0/0 as an observing port.
<DeviceB> system-view
[~DeviceB] interface gigabitethernet1/0/0
[~DeviceB-GigabitEthernet1/0/0] port-observing observe-index 1
[*DeviceB-GigabitEthernet1/0/0] commit
[~DeviceB-GigabitEthernet1/0/0] quit
After the preceding configuration is complete, all packets received by GE3/0/0 and
packets to be sent to the CPU are mirrored to GE1/0/0.
Step 5 Verify the configuration.
Check mirroring information through the ping command or another traffic
generation method. For example, if DeviceA sends 10 ping packets to GE3/0/0 on
DeviceB, HostD is expected to receive all the packets sent by DeviceA.
Check statistics about GE1/0/0 on DeviceB.
<DeviceB> display interface gigabitethernet1/0/0
GigabitEthernet1/0/0 current state : UP
Line protocol current state : UP
Description:XXXXXX, GigabitEthernet1/0/0 Interface
Route Port,The Maximum Transmit Unit is 1500
Internet protocol processing : disabled
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc7d-a497
The Vendor PN is HFBR-5710L
Port BW: 1G, Transceiver max BW: 1G, Transceiver Mode: MultiMode
WaveLength: 850nm, Transmission Distance: 550m
Loopback:none, full-duplex mode, negotiation: disable, Pause Flowcontrol:Send and Receive Enable
Statistics last cleared:never
Last 300 seconds input rate: 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bits/sec, 0 packets/sec
Input: 107628 bytes, 1016 packets
Output: 107628 bytes, 1016 packets
Input:
Unicast: 0, Multicast: 0
Broadcast: 0, JumboOctets: 0
CRC: 0, Symbol: 0
Overrun: 0 , InRangeLength: 0
LongPacket: 0 , Jabber: 0, Alignment: 0
----End
Configuration Files
● DeviceA configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0
ip address 1.1.1.1 255.255.255.0
#
return
Networking Requirements
In Figure 1-51, to monitor the packets sent from DeviceA to interface 2 on
DeviceB, specify interface 1 on DeviceB as an observing port and configure port
mirroring on interface 2. In this way, all the packets received by interface 2 are
copied to interface 1 for analysis by HostD (the analyzer).
The configurations in this example are performed on DeviceA, DeviceB, and DeviceC, all of
which can be HUAWEI NetEngine9000 devices.
Configuration Notes
Do not configure an interface as both an observing port and a mirrored port.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Configure IP addresses for interfaces and ensure that the corresponding routes are
reachable. For configuration details, see Configuration Files in this section.
After the preceding configuration is complete, all packets received by GE3/0/0 are
mirrored to GE1/0/0.
Step 5 Verify the configuration.
Check mirroring information through the ping command or another traffic
generation method. For example, if DeviceA sends 10 ping packets to GE3/0/0 on
DeviceB, HostD is expected to receive all the packets sent by DeviceA.
Check statistics about GE1/0/0 on DeviceB.
<DeviceB> display interface gigabitethernet1/0/0
GigabitEthernet1/0/0 current state : UP
Line protocol current state : UP
Description:XXXXXX, GigabitEthernet1/0/0 Interface
Route Port,The Maximum Transmit Unit is 1500
Internet protocol processing : disabled
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is xxxx-xxxx-xxxx
The Vendor PN is XXXX-XXXXX
Port BW: 1G, Transceiver max BW: 1G, Transceiver Mode: MultiMode
WaveLength: 850nm, Transmission Distance: 550m
Loopback:none, full-duplex mode, negotiation: disable, Pause Flowcontrol:Send and Receive Enable
Statistics last cleared:never
Last 300 seconds input rate: 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bits/sec, 0 packets/sec
Input: 107628 bytes, 1016 packets
Output: 107628 bytes, 1016 packets
Input:
Unicast: 0, Multicast: 0
Broadcast: 0, JumboOctets: 0
CRC: 0, Symbol: 0
Overrun: 0 , InRangeLength: 0
LongPacket: 0 , Jabber: 0, Alignment: 0
Fragment: 0, Undersized Frame: 0
RxPause: 0
Output:
Unicast: 10, Multicast: 0
Broadcast: 0, Jumbo: 0
Lost: 0, Overflow: 0, Underrun: 0
TxPause: 0
----End
Configuration Files
● DeviceA configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
return
1.1.17.6.3 Example for Configuring Observing Ports for the Upstream and
Downstream Packets of a Mirrored Port
Networking Requirements
As shown in Figure 1-52, SwitchA forwards user packets from VLAN 10 and VLAN
20 to DeviceB. To monitor the upstream and downstream packets forwarded by
SwitchA from VLAN 10 to interface 2 on DeviceB, specify interface 1 on DeviceB as
the observing port for the upstream VLAN packets of interface 2, and specify
interface 4 on DeviceB as the observing port for the downstream VLAN packets of
interface 2. Then, configure port mirroring on interface 2. In this way, all the
packets received by interface 2 are copied to interface 1 for analysis by HostD, and
all the downstream packets sent by interface 2 are copied to interface 4 for
analysis by HostE.
Figure 1-52 Networking diagram for configuring observing ports for the upstream
and downstream packets of a mirrored port
NOTE
● The configurations in this example are performed on DeviceB and DeviceC, both of
which can be HUAWEI NetEngine9000 devices.
● Interfaces 1 through 4 in this example represent GE1/0/0, GE3/0/0, GE3/0/1, and
GE1/0/1, respectively.
DeviceB GE3/0/0 - -
Configuration Notes
Do not configure an interface as both an observing port and a mirrored port.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure GE1/0/0 and GE1/0/1 on DeviceB as the observing ports for the
upstream and downstream packets of the mirrored port, respectively.
2. Configure GE3/0/0 on DeviceB as a mirrored port and enable port mirroring.
Data Preparation
To complete the configuration, you need the following data:
● Types and numbers of the observing ports and mirrored port
Procedure
Step 1 Configure IP addresses for interfaces and ensure that the corresponding routes are
reachable. For configuration details, see Configuration Files in this section.
Step 2 Configure GE1/0/0 as one observing port.
<DeviceB> system-view
[~DeviceB] interface gigabitethernet1/0/0
[~DeviceB-GigabitEthernet1/0/0] port-observing observe-index 1
[*DeviceB-GigabitEthernet1/0/0] commit
[~DeviceB-GigabitEthernet1/0/0] quit
Step 5 Specify observing ports for the upstream and downstream packets of the mirrored
port.
[~DeviceB] interface gigabitethernet3/0/0
[~DeviceB-GigabitEthernet3/0/0] port-mirroring to observe-index 1 inbound
[*DeviceB-GigabitEthernet3/0/0] port-mirroring to observe-index 2 outbound
[*DeviceB-GigabitEthernet3/0/0] commit
[~DeviceB-GigabitEthernet3/0/0] quit
----End
Configuration Files
● DeviceB configuration file
#
sysname DeviceB
vlan 10
#
interface GigabitEthernet3/0/0
portswitch
port default vlan 10
port-mirroring inbound vlan 10
port-mirroring outbound vlan 10
port-mirroring to observe-index 1 inbound
port-mirroring to observe-index 2 outbound
#
interface GigabitEthernet3/0/1
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet1/0/0
ip address 10.10.1.1 255.255.255.0
port-observing observe-index 1
#
interface GigabitEthernet1/0/1
ip address 10.20.1.1 255.255.255.0
port-observing observe-index 2
#
return
Networking Requirements
As shown in Figure 1-53, the switch forwards user packets from VLAN 10 and
VLAN 20 to the Device. To monitor the packets forwarded by the switch to
interface 1 on the Device, specify interface 2 and interface 3 on the Device as
observing ports. In addition, specify interface 1 as a mirrored port and enable the
port mirroring function for the traffic of VLAN 10. Then, map the mirrored port to
the observing ports. In this way, all the packets of VLAN 10 received by interface 1
are copied to interface 2 and interface 3.
Figure 1-53 Networking diagram for configuring port mirroring in a 1:N scenario
NOTE
● The configurations in this example are performed on the Device. The HUAWEI
NetEngine9000 can function as a Device.
● Interfaces 1 through 3 in this example represent GE1/0/0, GE2/0/0, and GE3/0/0,
respectively.
Device GE1/0/0 -
Configuration Notes
Do not configure an interface as both an observing port and a mirrored port.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Configure IP addresses for interfaces and ensure that the corresponding routes are
reachable. For configuration details, see Configuration Files in this section.
Step 4 Map the mirrored port GE1/0/0 to the observing ports GE2/0/0 and GE3/0/0.
[~Device] interface gigabitethernet1/0/0
[~Device-GigabitEthernet1/0/0] port-mirroring to observe-index 1 2
[*Device-GigabitEthernet1/0/0] commit
[~Device-GigabitEthernet1/0/0] quit
For example, if the switch sends 10 packets with the VLAN ID being 10 to the
mirrored port GE1/0/0 of the Device, check that the observing ports GE2/0/0 and
GE3/0/0 can forward all the packets with the VLAN ID being 10 received by the
mirrored port GE1/0/0. Run the display interface command to check packet
statistics about GE2/0/0.
<Device> display interface gigabitethernet2/0/0
GigabitEthernet2/0/0 current state : UP
Line protocol current state : UP
Description:XXXXXX, GigabitEthernet2/0/0 Interface
Route Port,The Maximum Transmit Unit is 1500
Internet protocol processing : disabled
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc7d-a497
The Vendor PN is HFBR-5710L
Port BW: 1G, Transceiver max BW: 1G, Transceiver Mode: MultiMode
WaveLength: 850nm, Transmission Distance: 550m
Loopback:none, full-duplex mode, negotiation: disable, Pause Flowcontrol:Send and Receive Enable
Statistics last cleared:never
Last 300 seconds input rate: 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bits/sec, 0 packets/sec
Input: 560 bytes, 10 packets
Output: 560 bytes, 10 packets
Input:
Unicast: 0, Multicast: 0
Broadcast: 0, JumboOctets: 0
CRC: 0, Symbol: 0
Overrun: 0 , InRangeLength: 0
LongPacket: 0 , Jabber: 0, Alignment: 0
Fragment: 0, Undersized Frame: 0
RxPause: 0
Output:
Unicast: 10, Multicast: 0
Broadcast: 0, Jumbo: 0
Lost: 0, Overflow: 0, Underrun: 0
TxPause: 0
----End
Configuration Files
● Device configuration file
#
sysname Device
vlan 10
#
interface GigabitEthernet1/0/0
portswitch
port default vlan 10
port-mirroring inbound vlan 10
port-mirroring to observe-index 1 2
#
interface GigabitEthernet2/0/0
ip address 10.10.1.1 255.255.255.0
port-observing observe-index 1
#
interface GigabitEthernet3/0/0
ip address 10.1.1.2 255.255.255.0
port-observing observe-index 2
#
return
Networking Requirements
This section provides an example for configuring port mirroring for the traffic of
an EVC Layer 2 sub-interface through the EVC model.
On the network shown in Figure 1-54, services such as Internet, IPTV, and VoIP
services are deployed in communities 1 and 2. To facilitate management, network
administrators allocate the same services to the same VLAN, and allocate different
services to different VLANs. In addition, an EVC model is used to achieve service
interworking between the two communities.
For security purposes, VLAN 10 traffic transmitted from CE1 to PE1 through sub-
interface 1.1 needs to be monitored and analyzed. This can be achieved by
specifying interface 2 on PE1 as an observing port and configuring port mirroring
on sub-interface 1.1. In this way, all the packets received through sub-interface 1.1
are copied to interface 2 for analysis by the analyzer.
● The configurations in this example are performed on CE1, CE2, PE1, and PE2. The
HUAWEI NetEngine9000 functions only as PE1.
● Interface 1, sub-interface 1.1, sub-interface 1.2, interface 2, interface 3, and interface 4
in this example represent GE1/0/1, GE1/0/1.1, GE1/0/1.2, GE2/0/1, GE1/0/2, and
GE1/0/3, respectively.
Configuration Notes
Services in all VLANs are on the same subnet.
Configuration Roadmap
Deploy EVC port mirroring to configure the EVC Layer 2 sub-interface GE1/0/1.1 as
a mirrored port and GE2/0/1 as an observing port. In this way, the inbound traffic
of GE1/0/1.1 is copied to GE2/0/1 for analysis by the analyzer.
Data Preparation
To complete the configuration, you need the following data:
● Numbers of interfaces connecting devices to the user side
● Numbers of interfaces interconnecting devices
● IDs of VLANs to which services belong
● BD IDs
● Mirroring instance name
● Number of the mirrored port
● Number of the observing port
Procedure
Step 1 Deploy an EVC model to achieve service interworking between communities 1 and
2.
# Configure CE1.
<HUAWEI> system-view
[~HUAWEI] sysname CE1
[*HUAWEI] commit
[~CE1] vlan 10
[*CE1-vlan10] quit
[*CE1] interface gigabitethernet 1/0/1
[*CE1-GigabitEthernet1/0/1] undo shutdown
[*CE1-GigabitEthernet1/0/1] portswitch
[*CE1-GigabitEthernet1/0/1] port link-type access
[*CE1-GigabitEthernet1/0/1] port default vlan 10
[*CE1-GigabitEthernet1/0/1] quit
[*CE1] interface gigabitethernet 1/0/2
[*CE1-GigabitEthernet1/0/2] undo shutdown
[*CE1-GigabitEthernet1/0/2] portswitch
[*CE1-GigabitEthernet1/0/2] port link-type trunk
[*CE1-GigabitEthernet1/0/2] port trunk allow-pass vlan 10
[*CE1-GigabitEthernet1/0/2] quit
[*CE1] commit
# Configure CE2.
<HUAWEI> system-view
[~HUAWEI] sysname CE2
[*HUAWEI] commit
[~CE2] vlan batch 10 30
[*CE2] interface gigabitethernet 1/0/1
[*CE2-GigabitEthernet1/0/1] undo shutdown
[*CE2-GigabitEthernet1/0/1] portswitch
[*CE2-GigabitEthernet1/0/1] port link-type access
[*CE2-GigabitEthernet1/0/1] port default vlan 30
[*CE2-GigabitEthernet1/0/1] quit
[*CE2] interface gigabitethernet 1/0/3
[*CE2-GigabitEthernet1/0/3] undo shutdown
[*CE2-GigabitEthernet1/0/3] portswitch
[*CE2-GigabitEthernet1/0/3] port link-type access
[*CE2-GigabitEthernet1/0/3] port default vlan 10
[*CE2-GigabitEthernet1/0/3] quit
[*CE2] interface gigabitethernet 1/0/2
[*CE2-GigabitEthernet1/0/2] undo shutdown
[*CE2-GigabitEthernet1/0/2] portswitch
[*CE2-GigabitEthernet1/0/2] port link-type trunk
[*CE2-GigabitEthernet1/0/2] port trunk allow-pass vlan 10 30
[*CE2-GigabitEthernet1/0/2] quit
[*CE2] commit
# Configure PE1.
<HUAWEI> system-view
[~HUAWEI] sysname PE1
[*HUAWEI] commit
[~PE1] bridge-domain 10
[~PE1-bd10] quit
[*PE1] interface gigabitethernet 1/0/1
[*PE1-GigabitEthernet1/0/1] undo shutdown
[*PE1-GigabitEthernet1/0/1] quit
[*PE1] interface gigabitethernet 1/0/1.1 mode l2
[*PE1-GigabitEthernet1/0/1.1] encapsulation dot1q vid 10
[*PE1-GigabitEthernet1/0/1.1] bridge-domain 10
[*PE1-GigabitEthernet1/0/1.1] quit
[~PE1] interface gigabitethernet 1/0/2
[*PE1-GigabitEthernet1/0/2] undo shutdown
[*PE1-GigabitEthernet1/0/2] quit
[*PE1] interface gigabitethernet 1/0/2.1 mode l2
[*PE1-GigabitEthernet1/0/2.1] encapsulation dot1q vid 10
[*PE1-GigabitEthernet1/0/2.1] bridge-domain 10
[*PE1-GigabitEthernet1/0/2.1] commit
[~PE1-GigabitEthernet1/0/2] quit
# Configure PE2.
<HUAWEI> system-view
[~HUAWEI] sysname PE2
[*HUAWEI] commit
[~PE2] bridge-domain 10
[~PE2-bd10] quit
[*PE2] interface gigabitethernet 1/0/1
[*PE2-GigabitEthernet1/0/1] undo shutdown
[*PE2-GigabitEthernet1/0/1] quit
[*PE2] interface gigabitethernet 1/0/1.1 mode l2
[*PE2-GigabitEthernet1/0/1.1] encapsulation dot1q vid 10
[*PE2-GigabitEthernet1/0/1.1] bridge-domain 10
[*PE2-GigabitEthernet1/0/1.1] quit
[*PE2] interface gigabitethernet 1/0/1.2 mode l2
[*PE2-GigabitEthernet1/0/1.2] encapsulation dot1q vid 30
[*PE2-GigabitEthernet1/0/1.2] rewrite map 1-to-1 vid 10
[*PE2-GigabitEthernet1/0/1.2] bridge-domain 10
[*PE2-GigabitEthernet1/0/1.2] quit
[~PE2] interface gigabitethernet 1/0/2
[*PE2-GigabitEthernet1/0/2] undo shutdown
[*PE2-GigabitEthernet1/0/2] quit
[*PE2] interface gigabitethernet 1/0/2.1 mode l2
[*PE2-GigabitEthernet1/0/2.1] encapsulation dot1q vid 10
[*PE2-GigabitEthernet1/0/2.1] bridge-domain 10
[*PE2-GigabitEthernet1/0/2.1] commit
[~PE2-GigabitEthernet1/0/2] quit
[*PE1-slot1] commit
[~PE1-slot1] quit
Run the display ethernet uni information command. The command output
shows the traffic encapsulation and traffic behavior information configured on
each EVC Layer 2 sub-interface. The following example uses the command output
on PE2.
[~PE2] display ethernet uni information
GigabitEthernet1/0/1.1
Total encapsulation number: 1
encapsulation dot1q vid 10
No action
GigabitEthernet1/0/1.2
Total encapsulation number: 1
encapsulation dot1q vid 30
Rewrite map 1-to-1 vid 10
GigabitEthernet1/0/2.1
Total encapsulation number: 1
encapsulation dot1q vid 10
No action
Through the EVC model, the users in community 1 and community 2 can
communicate with each other.
Run the display mirror instance [ instance-name ] location command to check
the configuration of the specified mirroring instance on an EVC Layer 2 sub-
interface.
[~PE1] display mirror instance location
instance evcto201
car :-
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
mirror instance evcto201 location
#
slot 1
mirror to observe-index 1
#
interface GigabitEthernet1/0/1
undo shutdown
#
interface GigabitEthernet1/0/1.1 mode l2
encapsulation dot1q vid 10
bridge-domain 10
port-mirroring instance evcto201 inbound vid 10 identifier none
#
interface GigabitEthernet1/0/2
undo shutdown
#
interface GigabitEthernet1/0/2.1 mode l2
encapsulation dot1q vid 10
bridge-domain 10
#
interface GigabitEthernet2/0/1
port-observing observe-index 1
#
return
● PE2 configuration file
#
sysname PE2
#
interface GigabitEthernet1/0/1
undo shutdown
#
interface GigabitEthernet1/0/1.1 mode l2
encapsulation dot1q vid 10
bridge-domain 10
#
interface GigabitEthernet1/0/1.2 mode l2
encapsulation dot1q vid 30
rewrite map 1-to-1 vid 10
bridge-domain 10
#
interface GigabitEthernet1/0/2
undo shutdown
#
interface GigabitEthernet1/0/2.1 mode l2
encapsulation dot1q vid 10
bridge-domain 10
#
return
● CE1 configuration file
#
sysname CE1
#
vlan 10
#
interface GigabitEthernet1/0/1
portswitch
undo shutdown
port link-type access
port default vlan 10
#
interface GigabitEthernet1/0/2
portswitch
undo shutdown
port link-type trunk
port trunk allow-pass vlan 10
#
return
● CE2 configuration file
#
sysname CE1
#
vlan batch 10 30
#
interface GigabitEthernet1/0/1
portswitch
undo shutdown
port link-type access
port default vlan 30
#
interface GigabitEthernet1/0/2
portswitch
undo shutdown
port link-type trunk
port trunk allow-pass vlan 10 30
#
interface GigabitEthernet1/0/3
portswitch
undo shutdown
port link-type access
port default vlan 10
#
return
Networking Requirements
On the network shown in Figure 1-55, to monitor the packets sent from DeviceA
to interface 3 on DeviceB, specify interface 5 on DeviceB as an observing port and
configure flow mirroring on interface 3. To improve the working efficiency of
HostD, configure a traffic policy on interface 3 of DeviceB. In this way, only the
packets with the source address of 2.2.2.2 are copied to interface 5.
● The configurations in this example are performed on DeviceA, DeviceB, and DeviceC, all
of which can be HUAWEI NetEngine9000 devices.
● Interfaces 1 through 5 in this example represent GE1/0/0, GE2/0/0, GE1/0/1, GE1/0/2,
and GE1/0/3, respectively.
Configuration Notes
● Do not configure an interface as both an observing port and a mirrored port.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Configure IP addresses for interfaces and ensure that the corresponding routes are
reachable. For configuration details, see Configuration Files in this section.
Step 2 Configure GE1/0/3 as an observing port.
<DeviceB> system-view
[~DeviceB] interface gigabitethernet1/0/3
[~DeviceB-GigabitEthernet1/0/3] port-observing observe-index 3
[*DeviceB-GigabitEthernet1/0/3] commit
# After the configuration is complete, run the display traffic classifier user-
defined command to check the traffic classifier configuration.
[~DeviceB] display traffic classifier user-defined
User Defined Classifier Information:
Classifier: a
Operator: OR
Rule(s) : if-match acl 2001 precedence 2
# Define a traffic policy to associate the traffic classifier with the traffic behavior.
[~DeviceB] traffic policy 1
[*DeviceB-trafficpolicy-1] classifier a behavior e
[*DeviceB-trafficpolicy-1] commit
[~DeviceB-trafficpolicy-1] quit
address of 10.20.2.2/32 and another 10 ping packets with the source address of
10.1.1.0/32 to GE1/0/1, HostD is expected to receive the packets with the source
address of 10.20.2.2/32 from DeviceA, not the packets with the source address of
10.1.1.0/32.
----End
Configuration Files
● DeviceA configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.70.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet1/0/1
undo shutdown
ip address 10.20.2.2 255.255.255.0
#
return
● DeviceB configuration file
#
sysname DeviceB
#
acl number 2001
rule 5 permit source 10.20.2.2 0
#
traffic classifier a operator or
if-match acl 2001
#
traffic behavior e
port-mirroring enable
#
traffic policy 1
classifier a behavior e
#
interface GigabitEthernet1/0/1
undo shutdown
ip address 10.70.1.2 255.255.255.0
traffic-policy 1 inbound
#
interface GigabitEthernet1/0/2
undo shutdown
ip address 10.80.1.2 255.255.255.0
#
interface GigabitEthernet1/0/3
undo shutdown
port-observing observe-index 3
#
slot 1
mirror to observe-index 3
#
return
● DeviceC configuration file
#
sysname DeviceC
#
interface GigabitEthernet1/0/0
undo shutdown
To ensure the transmission of unicast traffic, the NE9000 can limit the bandwidth
for forwarding broadcast, multicast, and unknown unicast traffic.
Traffic Suppression
Most Layer 2 network scenarios require unicast traffic to be much heavier than
broadcast traffic. This is also a requirement for networking. If broadcast traffic is
not suppressed, forwarding a large volume of such traffic consumes numerous
bandwidth resources, reducing network performance and even causing a
communication interruption.
In this case, you can configure broadcast traffic suppression on the NE9000 to
ensure that the device can reserve some bandwidth for forwarding unicast traffic
when broadcast traffic bursts.
Usage Scenario
In addition to user traffic management and bandwidth allocation, an Ethernet
requires broadcast, multicast, and unknown unicast traffic to be suppressed to
ensure the secure transmission of unicast traffic and properly utilize bandwidth
resources.
Most networks require unicast traffic to be much heavier than broadcast traffic. If
broadcast traffic is not suppressed, forwarding a large volume of such traffic
consumes numerous bandwidth resources, reducing network performance and
even causing a communication interruption.
Pre-configuration Tasks
Before configuring Layer 2 traffic suppression, complete the following task:
● Connect interfaces and set their physical parameters to ensure that the
interfaces are physically up.
Context
Traffic suppression can be implemented only on a Layer 2 interface.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run portswitch
The interface is configured to work in Layer 2 mode.
Step 4 Run broadcast-suppression { percent-value | value bw-value } { inbound |
outbound }
Broadcast traffic suppression is configured on the interface.
Step 5 Run multicast-suppression { percent-value | value bw-value } { inbound |
outbound }
Multicast traffic suppression is configured on the interface.
Step 6 Run unknown-unicast-suppression { percent-value | value bw-value } { inbound
| outbound }
Unknown unicast traffic suppression is configured on the interface.
Step 7 Run commit
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run vsi vsi-name [ static ]
A VSI is created.
Step 3 Run suppression { inbound | outbound } enable
Traffic suppression is enabled for the VSI.
Step 4 Run pwsignal ldp
A signaling mode is configured for the VSI.
Step 5 Run vsi-id vsi-id
An ID is configured for the VSI.
Step 6 Run quit
Return to the VSI view.
Step 7 Run quit
Return to the system view.
Step 8 Run interface interface-type interface-number.subinterface-number
The sub-interface view is displayed.
Step 9 Run vlan-type dot1q vlan-id
The sub-interface is associated with a VLAN, and a VLAN encapsulation mode is
configured for the sub-interface.
Step 10 Run l2 binding vsi vsi-name [ access-port ]
The sub-interface is bound to the VSI.
Step 11 Run broadcast-suppression cir cir-value [ cbs cbs-value ] { inbound | outbound }
Broadcast traffic suppression is configured on the sub-interface.
Step 12 Run multicast-suppression cir cir-value [ cbs cbs-value ] { inbound | outbound }
Multicast traffic suppression is configured on the sub-interface.
Step 13 Run unknown-unicast-suppression cir cir-value [ cbs cbs-value ] { inbound |
outbound }
----End
Context
Traffic suppression can be implemented only on a Layer 2 interface.
If you configure broadcast packet suppression on an interface for multiple times,
the latest configuration overrides the previous one. However, if you reconfigure
traffic suppression on an interface that is added to a VLAN, the previous
configuration needs to be deleted before the reconfiguration.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run portswitch
The interface is configured to work in Layer 2 mode.
Step 4 Run quit
Return to the system view.
Step 5 Run vlan batch { vlan-id1 [ to vlan-id2 ] } &<1-10>
A VLAN is created.
Step 6 Run port interface-type { interface-number1 [ to interface-number2 ] } &<1-10>
The interface is added to the VLAN.
Step 7 Run suppression { inbound | outbound } enable
Traffic suppression is enabled for the VLAN.
Step 8 Run unknown-multicast discard
Interfaces in the VLAN are disabled from forwarding unknown multicast packets.
Step 9 Run unknown-unicast discard
Interfaces in the VLAN are disabled from forwarding unknown unicast packets.
Step 10 Run quit
----End
Procedure
Step 1 Run the display interface { interface-name | interface-type interface-num }
suppression vsi vsi-name or display traffic-statistics suppression interface
{ interface-name | interface-type interface-num } vsi vsi-name command to check
Layer 2 traffic suppression statistics about specified VPLS services on the specified
interface.
Step 3 Run the display traffic-statistics vsi vsi-name suppression peer peer-address
[ negotiation-vc-id vcIdValue ] command to check PW traffic suppression
statistics.
----End
Applicable Environment
On an Ethernet network, to manage user traffic, user bandwidth must be
assigned. In addition, to ensure secure transmission of unicast traffic and proper
bandwidth utilization, unknown unicast, multicast, and broadcast traffic must be
suppressed.
On most networks, the unicast traffic volume is far higher than the broadcast
traffic volume. If broadcast traffic is not suppressed, in case of heavy broadcast
traffic, a great amount of network bandwidth is consumed, causing the network
performance to deteriorate and even communication interruption.
Pre-configuration Tasks
Before configuring traffic suppression, connect interfaces and configure their
physical parameters so that they can go Up physically.
Procedure
Step 1 Run system-view
----End
Prerequisites
Before configuring Layer 2 traffic suppression, complete the following task:
Connect interfaces and set their physical parameters to ensure that the physical
status of the interfaces is up.
Context
As broadcast, multicast, and unknown unicast packets increase on a network,
more network resources are consumed, adversely affecting network services.
When the rates of broadcast, multicast, and unknown unicast packets exceed the
configured committed information rate (CIR), the system discards excess packets
to control the packet rate within a proper range.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 The bridge-domain bd-id
The BD view is displayed.
Step 3 Run broadcast-suppression cir cir-value [ cbs cbs-value ] { uni-inbound | uni-
outbound }
The maximum broadcast traffic rate allowed by the BD is configured.
Step 4 Run multicast-suppression cir cir-value [ cbs cbs-value ] { uni-inbound | uni-
outbound }
The maximum multicast traffic rate allowed by the BD is configured.
Step 5 Run unknown-unicast-suppression cir cir-value [ cbs cbs-value ] { uni-inbound |
uni-outbound }
The maximum unknown unicast traffic rate allowed by the BD is configured.
Step 6 Run commit
The configuration is committed.
----End
Follow-up Procedure
After the configuration is complete, perform the following operation to verify the
configuration:
Run the display traffic-statistics suppression bd bd-id command to check Layer
2 traffic suppression statistics about the specified BD.
Usage Scenario
In addition to user traffic management and bandwidth allocation, an Ethernet
requires broadcast, multicast, and unknown unicast traffic to be suppressed to
ensure the secure transmission of unicast traffic and properly utilize bandwidth
resources.
Pre-configuration Tasks
Before configuring Layer 2 traffic suppression, complete the following tasks:
● Connect interfaces and set their physical parameters to ensure that the
interfaces are physically up.
● Enable the MPLS L2VPN function.
Procedure
Step 1 Run system-view
Step 4 Configure VSI PW-based LDP interface traffic suppression in the VSI-LDP-PW view,
VSI PW-based BGP interface traffic suppression in the VSI-BGP-PW view, or VSI
PW-based BGP AD interface traffic suppression in the VSI-BGP AD-PW view.
● Configure VSI PW-based LDP interface traffic suppression in the VSI-LDP-PW
view.
a. Run pwsignal ldp
The VSI-LDP view is displayed.
b. Run vsi-id vsi-id
A VSI ID is configured.
----End
Procedure
Step 1 Run the display interface { interface-name | interface-type interface-num }
suppression vsi vsi-name or display traffic-statistics suppression interface
Step 3 Run the display traffic-statistics vsi vsi-name suppression peer peer-address
[ negotiation-vc-id vcIdValue ] command to check PW traffic suppression
statistics.
----End
Usage Scenario
A growing number of special reserved multicast group packets in the broadcast
domain consume a large amount of network resources, which severely affects
service running. To address this issue, you can configure traffic suppression for
such packets, thereby reducing the multicast traffic volume to a proper range.
Procedure
Step 1 Run system-view
----End
Procedure
Step 1 To clear Layer 2 traffic suppression statistics about specified VPLS services on the
specified interface, run the reset traffic-statistics suppression interface
{ interface-name | interface-type interface-number } vsi vsi-name or reset
----End
Networking Requirements
In addition to user traffic management and bandwidth allocation, an Ethernet
requires broadcast, multicast, and unknown unicast traffic to be suppressed to
ensure the secure transmission of unicast traffic and properly utilize bandwidth
resources. If these types of traffic are not suppressed, forwarding a large volume
of such traffic consumes numerous bandwidth resources, reducing network
performance and even causing a communication interruption.
On the network shown in Figure 1-56, CE1 and CE2 belong to the same LDP VPLS
network and can communicate with each other. If you configure broadcast traffic
suppression on an interface, the broadcast traffic of all PWs created on the
interface is suppressed. In this case, you can configure broadcast traffic
suppression for only the PW in a specified VSI. This makes traffic suppression more
convenient and flexible.
Figure 1-56 Networking diagram for configuring VSI PW-based broadcast traffic
suppression
NOTE
P Loopback1 2.2.2.2/32 -
P GE1/0/0 172.16.1.2/24 -
P GE2/0/0 192.168.1.1/24 -
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
● Peer IP address and tunnel policy used for establishing the peer relationship
● Interfaces to be bound to the VSIs
● Committed information rate (CIR) for broadcast traffic
Procedure
Step 1 Configure an IGP.
OSPF is used in this example. The configuration details are not provided here.
After the configuration is complete, run the display ip routing-table command
on PE1, the P, and PE2. The command output shows that the devices have learned
routes from their peers.
Configure addresses for interfaces on PE1, the P, and PE2, as shown in Figure
1-56. During OSPF configuration, enable the devices to advertise their 32-bit
loopback addresses (LSR-IDs).
Step 2 Configure basic MPLS functions and LDP.
The configuration details are not provided here.
After the configuration is complete, run the display mpls ldp session command
on PE1, the P, and PE2. The command output shows that the status of the peer
relationship between PE1 and the P and the status of the peer relationship
between PE2 and the P are both Operational. This means that the peer
relationships have been established. To check information about LSP
establishment, run the display mpls lsp command.
Step 3 Establish a remote LDP session between the PEs.
# Configure PE1.
[~PE1] mpls ldp remote-peer 3.3.3.3
[*PE1-mpls-ldp-remote-3.3.3.3] remote-ip 3.3.3.3
[*PE1-mpls-ldp-remote-3.3.3.3] quit
[*PE1] commit
# Configure PE2.
[~PE2] mpls ldp remote-peer 1.1.1.1
[*PE2-mpls-ldp-remote-1.1.1.1] remote-ip 1.1.1.1
[*PE2-mpls-ldp-remote-1.1.1.1] quit
[*PE2] commit
After the configuration is complete, run the display mpls ldp session command
on PE1 or PE2. The command output shows that the status of the peer
relationship between PE1 and PE2 is Operational. This means that the remote
peer relationship has been established.
Step 4 Enable MPLS L2VPN on the PEs.
# Configure PE1.
[~PE1] mpls l2vpn
[*PE1-l2vpn] quit
[*PE1] commit
# Configure PE2.
[~PE2] mpls l2vpn
[*PE2-l2vpn] quit
[*PE2] commit
Step 5 Configure a VSI on each PE and configure VSI PW-based traffic suppression.
# Configure VSI PW-based broadcast, multicast, and unknown unicast traffic
suppression on PE1.
[~PE1] vsi a2 static
[*PE1-vsi-a2] suppression inbound enable
[*PE1-vsi-a2] pwsignal ldp
[*PE1-vsi-a2-ldp] vsi-id 2
[*PE1-vsi-a2-ldp] peer 3.3.3.3
[*PE1-vsi-a2-ldp] peer 3.3.3.3 pw 1
[*PE1-vsi-a2-ldp-pw-1] broadcast-suppression cir 1000
[*PE1-vsi-a2-ldp-pw-1] multicast-suppression cir 1000
[*PE1-vsi-a2-ldp-pw-1] unknown-unicast-suppression cir 1000
[*PE1-vsi-a2-ldp-pw-1] quit
[*PE1-vsi-a2-ldp] quit
[*PE1-vsi-a2] quit
[*PE1] commit
# Configure PE2.
[~PE2] interface gigabitethernet2/0/0.1
[*PE2-GigabitEthernet2/0/0.1] shutdown
[*PE2-GigabitEthernet2/0/0.1] vlan-type dot1q 10
[*PE2-GigabitEthernet2/0/0.1] l2 binding vsi a2
[*PE2-GigabitEthernet2/0/0.1] undo shutdown
[*PE2-GigabitEthernet2/0/0.1] quit
[*PE2] commit
# Configure CE2.
<HUAWEI> sysname CE2
<HUAWEI> commit
[~CE2] interface gigabitethernet1/0/0.1
[*CE2-GigabitEthernet1/0/0.1] shutdown
[*CE2-GigabitEthernet1/0/0.1] vlan-type dot1q 10
[*CE2-GigabitEthernet1/0/0.1] ip address 10.1.1.2 255.255.255.0
[*CE2-GigabitEthernet1/0/0.1] undo shutdown
[*CE2-GigabitEthernet1/0/0.1] quit
[*CE1] commit
After the configuration is complete, run the display vsi name a2 verbose
command on PE1. The command output shows that a PW to PE2 has been
established for the VSI a2 and the VSI state is up.
[PE1] display vsi name a2 verbose
***VSI Name : a2
Administrator VSI : no
Isolate Spoken : disable
VSI Index :0
PW Signaling : ldp
Member Discovery Style : static
PW MAC Learn Style : unqualify
Encapsulation Type : vlan
MTU : 1500
Diffserv Mode : uniform
Service Class : --
Color : --
DomainId : 255
Domain Name :
Ignore AcState : disable
Multicast Fast Switch : disable
Create Time : 0 days, 3 hours, 30 minutes, 31 seconds
VSI State : up
VSI ID :2
*Peer Router ID : 3.3.3.3
primary or secondary : primary
ignore-standby-state : no
VC Label : 18
Peer Type : dynamic
Session : up
Tunnel ID : 0x0000000001004c4b82
Broadcast Tunnel ID : --
Broad BackupTunnel ID : --
CKey :6
NKey :5
StpEnable :0
PwIndex :0
Interface Name : GigabitEthernet1/0/0.1
State : up
Last Up Time : 2012/10/10 10:14:46
Total Up Time : 0 days, 0 hours, 1 minutes, 2 seconds
**PW Information:
*Peer Ip Address : 3.3.3.3
PW State : up
Local VC Label : 18
Remote VC Label : 18
PW Type : label
Tunnel ID : 0x0000000001004c4b82
Broadcast Tunnel ID : --
Broad BackupTunnel ID : --
Ckey :1
Nkey : 1610612838
Main PW Token : 0x0
Slave PW Token : 0x0
Tnl Type : LdP
OutInterface : LDP LSP
Backup OutInterface :
Stp Enable :0
PW Last Up Time : 2012-10-10 10:15:59
PW Total Up Time : 0 days, 0 hours, 1 minutes, 3 seconds
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
undo shutdown
#
interface GigabitEthernet1/0/0.1
undo shutdown
vlan-type dot1q 10
ip address 10.1.1.1 255.255.255.0
#
return
vsi a2 static
pwsignal ldp
vsi-id 2
peer 3.3.3.3
peer 3.3.3.3 pw 1
broadcast-suppression cir 1000
multicast-suppression cir 1000
unknown-unicast-suppression cir 1000
suppression inbound enable
#
mpls ldp
#
mpls ldp remote-peer 3.3.3.3
remote-ip 3.3.3.3
#
interface GigabitEthernet1/0/0
undo shutdown
#
interface GigabitEthernet1/0/0.1
undo shutdown
vlan-type dot1q 10
l2 binding vsi a2
#
interface GigabitEthernet2/0/0
undo shutdown
ip address 172.16.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 172.16.1.0 0.0.0.255
#
return
● P configuration file
#
sysname P
#
mpls lsr-id 2.2.2.2
#
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 172.16.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
undo shutdown
ip address 192.168.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 172.16.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
network 2.2.2.2 0.0.0.0
#
return
for its interfaces (including the loopback interface) directly to the CPU without any
filtering. As a result, CPU and system resources are wasted and the system comes
under DoS attacks.
To prevent such attacks, define an MPAC policy to filter packets.
Usage Scenario
MPAC can be configured to filter packets destined for the CPU, thereby helping
protect network devices against Denial of Service (DoS) attacks.
Pre-configuration Tasks
Before configuring MPAC, configure link layer protocol parameters and IP
addresses for interfaces to ensure that the link layer protocol on the interfaces is
in the Up state.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run service-security policy ipv4 security-policy-name
An IPv4 MPAC policy is created, and the IPv4 MPAC policy view is displayed.
Step 3 Add a rule to the IPv4 MPAC policy. See the following table.
Protocol Command
Remarks
Type
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run service-security policy ipv6 security-policy-name
An IPv6 MPAC policy is created, and the IPv6 MPAC policy view is displayed.
Step 3 Add a rule to the IPv6 MPAC policy.
----End
Prerequisites
An MPAC policy has been configured.
Procedure
● Run the display service-security policy { ipv4 | ipv6 } [ security-policy-name
[ slot slot-id ] ] command to check information about all MPAC policies.
● Run the display service-security binding { ipv4 | ipv6 } [ interface interface-
type interface-number [ slot slot-id ] ] command to check information about
MPAC policies on interfaces.
● Run the display service-security statistics { ipv4 | ipv6 } [ security-policy-
name ] command to check statistics about all matched MPAC rules.
----End
Context
NOTICE
MPAC statistics cannot be restored after being cleared. Exercise caution when
running the reset service-security counters { ipv4 | ipv6 } [ security-policy-
name ] command.
Procedure
● Run the reset service-security counters { ipv4 | ipv6 } [ security-policy-
name ] command to clear MPAC statistics.
----End
Networking Requirements
To prevent an attacker from sending various types of TCP/IP attack packets to
paralyze Device A, MPAC is deployed on Device A, as shown in Figure 1-57.
Configuration Notes
None.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Configure an IP address and routes for each interface to ensure network
connectivity. For configuration details, see "Configuration Files" in this section.
Step 4 Apply the IPv4 MPAC policy named test to GE 1/0/0 on Device A.
[~DeviceA] interface gigabitethernet 1/0/0
[~DeviceA-GigabitEthernet1/0/0] service-security binding ipv4 test
[*DeviceA-GigabitEthernet1/0/0] commit
[~DeviceA-GigabitEthernet1/0/0] quit
----End
Configuration Files
● Device A configuration file
#
sysname DeviceA
#
service-security global-binding ipv4 test
#
service-security policy ipv4 test
description rule 10 is deny ip packet which from 10.10.1.1
step 10
rule 10 deny protocol ip source-ip 10.10.1.1 0
#
interface GigabitEthernet1/0/0
undo shutdown
ip address 10.10.1.2 255.255.255.0
service-security binding ipv4 test
#
Generally, most data is transmitted in plaintext on LAN links, which brings security
risks. For example, the bank account information may be stolen or tampered with.
After MACsec is deployed on the network, Ethernet data frames can be protected,
reducing information leak and malicious network attack risks.
MACsec uses the Layer 2 encryption technology to provide secure data
transmission for hop-by-hop devices. It is applicable to scenarios that require high
data confidentiality. For example, if optical transmission devices are used between
two routers, the MACSec encryption technology can be used to ensure secure data
transmission on intermediate transmission devices.
Pre-configuration Tasks
The license file has been loaded for MACsec.
1. The license file on the main control board has been activated by running the
license active file-name command.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run license
The license view is displayed.
Step 3 Run active port-macsec slot slotid card cardid port port-list
The MACsec license of interfaces is activated.
Step 4 Run commit
The configuration is committed.
----End
Context
The key used by MACsec to encrypt and decrypt data packets is generated and
distributed by the key server based on the encryption algorithm in the MKA
protocol and the configured static CAK. Therefore, you need to configure the CKN
and corresponding CAK on the interface.
Procedure
Step 1 Run system-view
Step 3 Run mka cak-mode static ckn ckn cak { simple cak-simple | cipher cak-cipher }
----End
Procedure
Step 1 Run the display macsec statistics interface { interface-name | interface-type
interface-number } command to check statistics about data packets protected by
MACsec.
----End
Context
When data packets sent by an interface are encrypted using MACsec, you can
configure an encryption mode for the interface.
● normal: implements both integrity check and data encryption.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number [ .subinterface-number ]
The interface view is displayed.
Step 3 Run macsec mode { normal | integrity-only }
The MACsec encryption mode is configured.
Step 4 Run commit
The configuration is committed.
----End
Context
When data packets sent by an interface are encrypted using MACsec, you can
configure an encryption algorithm for the interface. When the interface rate
reaches 100 Gbit/s or higher, using the gcm-aes-xpn-128 algorithm is
recommended.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number [ .subinterface-number ]
The interface view is displayed.
Step 3 Run macsec cipher-suite { gcm-aes-128 | gcm-aes-xpn-128 | gcm-aes-256 |
gcm-aes-xpn-256 | gcm-aes-xpn-128-compatible }
----End
Context
The MACsec encryption offset indicates that encryption starts after the specified
offset bytes from the MACsec TAG field. Some applications (such as load
balancing) that need to identify the IPv4/IPv6 header require that the packet
header not be encrypted. In this case, the encryption offset must be configured.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number [ .subinterface-number ]
The interface view is displayed.
Step 3 Run macsec confidentiality-offset offset-value
The MACsec encryption offset is configured.
Step 4 Run commit
The configuration is committed.
----End
Context
When MACsec is used to encrypt and decrypt data packets, the local device
interface and the peer device interface must use the same security key to establish
MKA sessions. The key server is responsible for generating and distributing the key.
Therefore, you need to configure the priority of the key server on the interfaces of
both ends. A smaller value indicates a higher priority. The interface with a higher
priority is elected as the key server. If the key servers of the two interfaces have
the same priority, the interface with a smaller Secure Channel Identifier (SCI)
value is elected as the key server. The SCI is formed based on the MAC address
and Port ID.
Procedure
Step 1 Run system-view
The system view is displayed.
----End
Context
When MACsec is used for secure communication, the SAK is used to encrypt and
decrypt data packets. To ensure the security of data packets, if the number of
packets encrypted using one SAK exceeds a certain value or one SAK is used for a
certain period of time, replace the SAK.
Procedure
Step 1 Run system-view
----End
Context
To prevent against attacks based on repeatedly sent data packets, the receiver
discards duplicate or out-of-order data packets. In some cases, however, because
the priorities of data packets are different, the packets are reordered in the
forwarding process. When the packets arrive at the receive end, they are in
disorder. To ensure that these out-of-order data packets can be received normally,
configure the replay protection window.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number [ .subinterface-number ]
The interface view is displayed.
Step 3 Run macsec replay-window window-size
The MACsec replay window size is configured.
Step 4 Run commit
The configuration is committed.
----End
Context
The MACsec VLAN tag in the clear function allows MACsec not to encrypt VLAN
tags. The hub site router uses a Layer 3 (IP) sub-interface of each VLAN that is
associated with each remote site branch. The result is a highly flexible MACsec
hub/spoke design that eliminates the older solutions that require a physical
interface "per remote site" on the hub router.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number.subinterface-number
The sub-interface view is displayed.
Step 3 Run macsec { dot1q-in-clear | qinq-in-clear }
The MACsec VLAN tag in the clear function is configured.
Step 4 Run commit
The configuration is committed
----End
Context
By default, if MACsec negotiation fails, traffic is still forwarded, and data packets
are not encrypted. This poses security risks in scenarios that require high data
confidentiality. To address this issue, configure the strict MACsec mode on a
device, allowing it to discard all packets except MKA, LLDP, and Pause packets if
MACsec negotiation fails.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run macsec strict-mode
The strict MACsec mode is configured.
Step 3 Run commit
The configuration is committed.
----End
Procedure
Step 1 Run the display macsec statistics interface { interface-name | interface-type
interface-number } command to check statistics about data packets protected by
MACsec.
Step 2 Run the display mka interface { interface-name | interface-type interface-
number } command to check MKA session information.
----End
Context
NOTICE
Statistics cannot be restored after being cleared. Therefore, you must use the
following command with caution.
Procedure
Step 1 Run the reset macsec statistics interface { interface-name | interface-type
interface-number } command to clear statistics about data packets protected by
MACsec.
Step 2 Run the reset mka statistics interface { interface-name | interface-type interface-
number } command to clear MKA session information.
----End
Networking Requirements
As shown in Figure 1-58, routerDeviceA and routerDeviceB are directly connected,
and MACsec data packets are encrypted and decrypted on GE 1/0/0 of DeviceA
and DeviceB.
● The configurations in this example are performed on DeviceA and DeviceB. The HUAWEI
NetEngine9000 can function as DeviceA and DeviceB.
● Interface1 in this example represents GE 1/0/0.
Configuration Roadmap
The configuration roadmap is as follows:
Configure the same static CKN and CAK on GE 1/0/0 of DeviceA and DeviceB.
Data Preparation
To complete the configuration, you need the following data:
● CKN and CAK values of the interface
● The MACsec encryption algorithm gcm-aes-xpn-128, which is to be
configured on the interface of DeviceA
Procedure
Step 1 Configure DeviceA.
# Configure CKN and CAK in ciphertext on GE 1/0/0.
<DeviceA> system-view
[~DeviceA] interface gigabitethernet1/0/0
NOTE
----End
Configuration Files
● DeviceA configuration file
sysname DeviceA
#
interface GigabitEthernet1/0/0
undo shutdown
mka cak-mode static ckn a1 cak cipher %^%#C1ad()KRM~r1ZmJ:K09&H]R=<*0^A,H.fZE"<WxS%^%#
macsec replay-window 512
macsec mode integrity-only
macsec confidentiality-offset 50
Networking Requirements
As shown in Figure 1-59, routerDevice A and routerDevice B are directly
connected, and MACsec data packets are encrypted and decrypted on GE 1/0/0.1
of Device A and Device B.
● The operations in this example are performed on the Device A and Device B, which can
be HUAWEI NetEngine9000s.
● Interface 1 in this example represents GE 1/0/0.1
Configuration Roadmap
The configuration roadmap is as follows:
Configure the same vlan id on GE 1/0/0.1 of Device A and Device B.
Configure the same static CKN and CAK on GE 1/0/0.1 of Device A and Device B.
Configure MACsec VLAN tag in the clear on GE 1/0/0.1 of Device A and Device B.
Data Preparation
To complete the configuration, you need the following data:
● CKN and CAK values of the interface
Procedure
Step 1 Configure Device A.
# Configure the dot1q encapsulation type on GE 1/0/0.1 and associate GE 1/0/0.1
with VLAN 10.
<DeviceA> system-view
[~DeviceA] interface gigabitethernet1/0/0.1
[~DeviceA-GigabitEthernet1/0/0.1] vlan-type dot1q 10
[*DeviceA-GigabitEthernet1/0/0.1] commit
----End
Configuration Files
● Device A configuration file
#
sysname DeviceA
#
interface GigabitEthernet1/0/0.1
undo shutdown
vlan-type dot1q 10
mka cak-mode static ckn a1 cak cipher %^
%#C1ad()KRM~r1ZmJ:K09&H]R=<*0^A,H.fZE"<WxS%^%#
macsec dot1q-in-clear
● Device B configuration file
#
sysname DeviceB
#
interface GigabitEthernet1/0/0.1
undo shutdown
vlan-type dot1q 10
mka cak-mode static ckn a1 cak cipher %^
%#C1ad()KRM~r1ZmJ:K09&H]R=<*0^A,H.fZE"<WxS%^%#
macsec dot1q-in-clear
Context
Protocols have different security performances, and some protocols may have
security risks. Run the display security risk command to identify security risks in
the system. Then clear the security risks according to the repair action in the
command output. For example, if SNMPv1 is configured, the display security risk
command output will prompt for the use of SNMPv3.
Procedure
Step 1 Run display security risk [ [ feature feature-name ] | [ level level-para ] | [ type
type-para ] ]*
The security risks that are displayed vary with user levels. The system administrators can view all
security risks in the system. Other users can only view the security risks whose level is lower
than or equal to their levels.
----End
Example
Run the display security risk command to view security risks in the system.
<HUAWEI> display security risk
Risk level : high
Feature name : SNMP
Risk Type : insecure-protocol
Risk information : SNMP V1/V2c is enabled.
Repair action : Disable SNMP V1/V2c and enable SNMP V3 only.
Context
Security performance of different protocols differs, and using some protocols may
pose security risks. You can run the display security configuration command to
check security configurations in the system.
Procedure
Step 1 Run the display security configuration [ feature feature-name ] command in the
user view to check security configurations.
----End
Example
Run the display security configuration command to view security configurations.
<HUAWEI> display security configuration
Feature Name : FTPS
Security Item : ftp security configuration
Item content : Ftp server is disabled.Ftp Ipv6 server is disabled.IP block feature is disabled.The FTP server
does not bind all interface.
Background Information
In an actual network environment, the network and devices are provided and
maintained by network providers, and the data belongs to tenants. To provide
secure data transmission and storage on the network, ensure that keys are under
complete control of the specific user and cannot be obtained by network providers
or other tenants. To be specific, users need to have their own key management
schemes.
Users can manually modify the system master key based on actual requirements
to enhance data security and reliability.
Procedure
Step 1 Run the set master-key command in the user view to set the system master key.
NOTE
To delete historical system master key, run the clear master-key command.
● A user needs to input the new master key twice. The system proceeds to the
next operation only when the two input master keys are identical.
If an error occurs during master key modification, the system prompts a message
indicating a master key modification failure and instructs the user to retry it. If the
failure persists, contact Huawei technical support personnel.
After the master key is modified, devices cannot share the configuration files.
After a configuration file is copied from another device to the local device for next
startup, if the master key on the source device is not the default master key and
does not exist on the local device, the configuration fails. To resolve this problem,
perform one of the following operations:
● Change the master key on the device to be configured to be the same as that
on the device that provides the configuration file.
● Change the master key on the device that provides the configuration file to be
the same as that on the device to be configured. After that, save and export
the configuration file, upload it to the device to be configured, and specify the
configuration file for next startup.
● Specify the default master key as the master key on the device that provides
the configuration file. After that, save and export the configuration file,
upload it to the device to be configured, and specify the configuration file for
next startup.
After the master key is changed and a configuration file is copied from another
device to the local device for next startup, if the master key on the source device is
not the default master key and does not exist on the local device, the local device
cannot decrypt the copied file due to master key mismatch. To resolve this
problem, perform one of the following operations:
● Change the master key on the local device to be the same as that on the
device that provides the encrypted file.
● Change the master key on the device that provides the encrypted file to be
the same as that on the local device. After that, export the encrypted file and
upload it to the local device.
● Specify the default master key as the master key on the device that provides
the encrypted file. After that, export the encrypted file and upload it to the
local device for decryption.
Step 2 (Option) Run the set master-key auto-update interval interval-time command in
the system view to enable the automatic update function of the system master
key and set the interval for automatic update.
The system master key can be the default master key or a manually configured
master key.
If the default master key is used for a long time, it may be stolen or cracked. The
master key that is manually configured needs to be periodically changed and
maintained.
To reduce manual maintenance workload, run the set master-key auto-update
interval interval-time command to enable automatic update of the master key.
The system then periodically generates a new master key that is a string of 32
characters.
To disable the automatic update function, run the undo set master-key auto-
update [ interval interval-time ] command. After the automatic update function
is disabled, the latest master key of the system is maintained and will not be
automatically updated.
----End
Definition
You can use the trusted system to view and manage the digital signature, trusted
boot, secure boot, and remote attestation functions on a device to implement
system trustworthiness.
A trusted system indicates that system hardware and software are running as
designed. The prerequisite for a trusted system is that the system software
integrity is high and free of intrusion or unauthorized modification.
Purpose
Global communications service providers, enterprises, and government networks
depend on the running of communications networks. The integrity of data and IT
infrastructure is the basis for maintaining these networks and users' trust. In
addition, the threat environment is changing. Protecting networks from intrusion,
forgery, and tampering becomes critical.
Benefits
A trusted system consists of digital signature, trusted boot, secure boot, and
remote attestation and offers the following benefits:
● Use the device hardware capability and initial boot code to establish
trustworthiness on the trusted boot platform.
● Trusted boot provides software integrity measurement, trusted status query,
and trusted status warning.
● Secure boot allows only trusted devices to start.
● RA allows users to remotely check device trustworthiness.
Context
A communication device is composed of multiple embedded computer systems.
The software of a device may be attacked by viruses, or may be tampered with or
attacked by Trojan horses by means of vulnerabilities.
After the system is upgraded from a version that does not support secure boot to
a version that supports secure boot, if secure boot is not enabled on the device,
the system prompts users to enable secure boot during their Telnet login.
NOTE
For details about the boards that support secure boot, contact Huawei engineers for
product specifications.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run display boot status
The status of the secure boot function is displayed.
If RoT is displayed as -, the device hardware does not support secure boot. If RoT
is displayed as Flash/Locked or CPU, the device is in secure boot mode. If RoT is
displayed as Flash/Unlocked, the device is not in secure boot mode. In this case,
go to the next step.
Step 3 Run set flash-lock { immediately | delay day days }
Secure boot is enabled.
Step 4 Run commit
The configuration is committed.
----End
Pre-configuration Tasks
In a trusted environment, after the RA function is enabled on a device that
supports trusted boot, the device sends information to a remote RA server. The
remote RA server then compares the information it receives with locally stored
information to determine whether the device is trustworthy. Therefore, RA
provides users with a method of remotely checking device trustworthiness.
● Configure the device to communicate with the RA server, and configure the
RA function on the RA server.
● Create a public key infrastructure (PKI) domain on the device to implement
PKI certificate management between the Certificate Authority (CA) and device
through the Certificate Management Protocol (CMP).
Procedure
Step 1 Run system-view
RA is enabled.
Step 6 (Optional) If the PKI certificate is ineffective, run remote-attestation pki update-
request { all | slot slotID }
NOTE
If the device needs to be rolled back to a version that does not support the configuration of
the TPM password, run the set tpm password { slot slotId | all }command to restore the
default TPM password Changeme_123 before the rollback.
After the set tpm password { slot slotId | all } command is run, the device must be
restarted. Otherwise, the TPM cannot be accessed and the remote attestation function is
unavailable.
----End