Using XPL to Filter the BGP Routes to Be Received
A BGP device can use a route-filter to filter the routes to be received and modify route attributes to control the network traffic forwarding path.
Usage Scenario
BGP is used to transmit routing information between ASs, and route advertisement directly affects traffic forwarding.
A BGP device may receive multiple routes to the same destination network from different peers. To control the network traffic forwarding path, filter the routes to be received.
In addition, a BGP device may receive a large number of routes during an attack, which may consume lots of device resources. In this case, the administrator must limit the resource consumption based on the network planning and device performance.
You can use XPL route-filters to control the BGP routes to be received from all peers or peer groups or from a specified peer or peer group.
Pre-configuration Tasks
Before using XPL to filter the BGP routes to be received, configure basic BGP functions.
Procedure
- Use XPL to filter the BGP routes to be received from all
peers or peer groups.
Perform the following steps on the BGP device:
- Use XPL to filter the BGP routes to be received from a
specific peer or peer group.
Perform the following steps on the BGP device:
Checking the Configuration
Run the following commands to check configurations:
- Run the display xpl route-filter state [ attached | unattached ] command to check information about the configured route-filter.
- Run the display bgp routing-table [ peer ipv4-address received-routes [ statistics ] ] command to check the routes in the BGP routing table.
# Run the display xpl route-filter state command to view information about the configured route-filter.
<HUAWEI> display xpl route-filter state
Attached :Applied by at least one attach point
Unattached : Not applied by any attach point
Attached
---------------------------------------------------------------
r1
Unattached
---------------------------------------------------------------
# Run the display bgp routing-table peer ipv4-address received-routes command to view routes in the BGP routing table.
<HUAWEI> display bgp routing-table peer 1.1.1.2 received-routes
BGP Local router ID is 1.1.1.1
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
Total Number of Routes: 2
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 1.3.1.0/30 11.1.1.2 0 0 200?
*> 1.3.1.1/32 11.1.1.2 0 0 200?