No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

NE40E V800R010C10SPC500 Configuration Guide - IP Routing 01

This is NE40E V800R010C10SPC500 Configuration Guide - IP Routing
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Controlling BGP4+ Route Selection

Controlling BGP4+ Route Selection

The policy on BGP4+ route selection can be changed by configuring BGP4+ route attributes.

Usage Scenario

BGP4+ has many route attributes. These attributes are used to define the routing policy and describe the BGP4+ route prefix. Configuring these attributes can change the policy used by BGP4+ for route selection.

Pre-configuration Tasks

Before controlling BGP4+ route selection, configure basic BGP4+ functions.

Configuration Procedures

Perform one or more of the following configurations as required.

Setting the BGP4+ Priority

Setting the BGP4+ priority can control route selection between BGP routes and routes of another routing protocol.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run bgp as-number

    The BGP view is displayed.

  3. Run ipv6-family unicast

    The IPv6 unicast address family view is displayed.

  4. Run preference { external internal local | route-policy route-policy-name | route-filter route-filter-name }

    The BGP4+ priority is set.

    BGP4+ has the following types of routes:

    • EBGP routes learned from peers in other ASs

    • IBGP routes learned from peers in the same AS

    • Routes generated locally using the aggregate command

    You can set different priorities for the three types of routes.

    You can also apply routing policies to set priorities for the specified routes that meet the requirements. You can set default preferences for the routes that do not meet the requirements.

    NOTE:

    At present, the peer route-policy or peer route-filter command cannot be used to set the BGP4+ priority.

  5. Run commit

    The configuration is committed.

Setting the Preferred Value for BGP4+ Routes

After the preferred value is set for BGP4+ routes, the route with the greatest value is preferred when multiple routes to the same destination exist in the BGP4+ routing table.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run bgp as-number

    The BGP view is displayed.

  3. Run ipv6-family unicast

    The IPv6 unicast address family view is displayed.

  4. Run peer { ipv4-address | ipv6-address | group-name } preferred-value value

    A preferred value is set for all the routes learned from a specified peer.

    After the peer preferred-value command is run, all the routes learned from a specified peer have the same preferred value.

  5. Run commit

    The configuration is committed.

Setting the Default Local_Pref Attribute for the Local Device

After the Local_Pref attribute is set for BGP4+ routes, the route with the greatest attribute value is preferred when multiple routes to the same destination exist in the BGP4+ routing table. The preferred value takes precedence over the Local_Pref attribute.

Context

The Local_Pref attribute is used to determine the optimal route for the traffic that leaves an AS. If a BGP device obtains multiple routes from different IBGP peers and these routes have different next hops to the same destination, the BGP device will select the route with the greatest Local_Pref value.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run bgp as-number

    The BGP view is displayed.

  3. Run ipv6-family unicast

    The IPv6 unicast address family view is displayed.

  4. Run default local-preference local-preference

    The default Local_Pref attribute is set for the local device.

  5. Run commit

    The configuration is committed.

Setting the MED Attribute

The MED attribute is equal to the metric used in IGP. After the MED attribute is set for routes, an EBGP peer can select a route with the smallest MED value for the traffic that enters an AS.

Context

The MED serves as the metric used by an IGP. It is used to determine the optimal route when traffic enters an AS. When a BGP4+ router obtains multiple routes to the same destination address but with different next hops through EBGP peers, the route with the smallest MED value is selected as the optimal route.

Procedure

  • Set the default MED value on the local device.
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run ipv6-family unicast

      The IPv6 unicast address family view is displayed.

    4. Run default med med

      The default MED value is set.

    5. Run commit

      The configuration is committed.

  • Compare the MED values of the routes from different ASs.
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run ipv6-family unicast

      The IPv6 unicast address family view is displayed.

    4. Run compare-different-as-med

      The MED values of routes from different ASs are compared.

    5. Run commit

      The configuration is committed.

  • Configure the method used by BGP4+ when there is no MED attribute in the route attributes.
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run ipv6-family unicast

      The IPv6 unicast address family view is displayed.

    4. Run bestroute med-none-as-maximum

      The maximum MED value is used for a route when there is no MED attribute in the route attributes.

      If this command is not run, BGP4+ uses 0 as the MED value for a route when there is no MED attribute in the route attributes.

    5. Run commit

      The configuration is committed.

Setting the Next_Hop Attribute

BGP route selection can be flexibly controlled by setting the Next_Hop attribute.

Context

The Next_Hop attribute of BGP4+ is different from that of an IGP because it is not necessarily the IPv6 address of a neighboring router.

Procedure

  • Change the next-hop address when advertising a route to an IBGP peer.

    Perform the following steps on the IBGP router:

    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run ipv6-family unicast

      The IPv6 unicast address family view is displayed.

    4. Run peer { ipv6-address | group-name } next-hop-local

      The local address is configured as the next hop address for route advertisement.

      To ensure that an IBGP peer can find the correct next hop, you can configure the local router to change the next hop of a route to its local address when the local router advertises the route to the IBGP peer.

      NOTE:

      If BGP load balancing is configured, the local router changes the next hop address to be its own address when advertising routes to IBGP peer groups, regardless of whether the peer next-hop-local command is used.

    5. Run commit

      The configuration is committed.

  • Prevent an ASBR from changing the next hop address when advertising routes to an EBGP peer.

    Perform the following steps on a PE:

    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run ipv6-family vpnv6 [ unicast ]

      The BGP-VPNv6 sub-address family view is displayed.

    4. Run peer { ipv6-address | group-name } next-hop-invariable

      The PE is prevented from changing the next hop address when advertising routes to an EBGP peer.

    5. Run commit

      The configuration is committed.

Setting the AS_Path Attribute

The AS_Path attribute is used to prevent routing loops and control route selection.

Procedure

  • Set the AS_Path attribute in the IPv6 address family view.

    Perform the following steps on a BGP4+ device:

    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run ipv6-family unicast

      The IPv6 unicast address family view is displayed.

    4. Run the following commands as required:

      • To allow repeated local AS numbers, run peer { ipv6-address | group-name } allow-as-loop [ number ]

      • To exclude the AS_Path attribute from being used as a route selection rule, run bestroute as-path-ignore

      • To allow the AS_Path attribute to carry only the public AS number, run peer { ipv6-address | group-name } public-as-only [ force [ replace ] [ include-peer-as ] | limited [ replace ] [ include-peer-as ] ]

      The commands in Step 4 are optional and can be used in random order.

    5. Run commit

      The configuration is committed.

  • Configure a fake AS number.

    Perform the following steps on a BGP4+ device:

    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run peer { ipv6-address | group-name } fake-as fake-as-number [ dual-as ] [ prepend-global-as ] [ prepend-fake-as ]

      A fake AS number is configured.

      The actual AS number can be hidden by using this command. EBGP peers in other ASs can only learn this fake AS number of the BGP4+ device. This means that the fake AS number is used for the BGP4+ device when it is being specified on the peers in other ASs.

      NOTE:

      This command is applicable to EBGP peers only.

    4. Run commit

      The configuration is committed.

  • Replace the AS number in the AS_Path attribute.

    If the AS_Path attribute of a route contains the AS number of the peer, this number needs to be replaced with the local AS number before the route is advertised. On a BGP network, two devices have the same AS number and the same EBGP peer. After one of the two devices learns a route of the other device from the EBGP peer, the route is discarded because it carries an AS number that is the same as the local one. To address this problem, run the peer substitute-as command on the EBGP peer.

    Exercise caution when running the peer substitute-as command because improper use of the command may cause routing loops.

    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run ipv6-family { vpn-instance vpn-instance-name | unicast }

      The BGP-VPN instance IPv6 address family view or BGP-IPv6 unicast address family view is displayed.

    4. Run peer { ipv6-address | group-name } substitute-as

      The AS number in the AS_Path attribute is replaced.

    5. Run commit

      The configuration is committed.

  • Enable the device to check or disable the device from checking the first AS number in the AS_Path attribute contained in the update messages received from a specified EBGP peer or peer group.
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run ipv6-family vpn-instance vpn-instance-name

      The BGP-VPN instance IPv6 address family view is displayed.

    4. Run peer { group-name | ipv6-address } check-first-as { enable | disable }

      The device is enabled to check or disabled from checking the first AS number in the AS_Path attribute contained in the update messages received from a specified EBGP peer or peer group.

      If the peer check-first-as enable command is run, the device checks whether the first AS number in the AS_Path attribute contained in the update messages received from the specified EBGP peer or peer group is the number of the AS where the EBGP peer or peer group resides. If the two AS numbers are different, the local device discards the update messages and disconnects the EBGP connection. If the peer check-first-as disable command is run, the device accepts all update messages received from the specified EBGP peer or peer group, regardless whether the two AS numbers are the same. If the undo peer check-first-as disable command is run, the default configuration takes effect.

      The check function can be configured for a specified EBGP peer, peer group, or for BGP as a whole. If the function is not configured for a specified EBGP peer, the device checks whether the function is configured for the related peer group; if the function is not configured for the peer group, the device checks whether the function is configured in the BGP view.

    5. Run commit

      The configuration is committed.

      After the configuration is complete, run the refresh bgp command to check the received routes again.

Configuring AIGP Attributes for Routes

The Accumulated Interior Gateway Protocol Metric (AIGP) attribute allows devices in an AIGP administrative domain to use the optimal routes to forward data.

Context

An AIGP administrative domain is a set of autonomous systems (ASs) in a common administrative domain.

Routing protocols that have been designed to run within a single administrative domain, such as various IGPs, generally assign a metric to each link, and then choose the path for which the total distance (sum of the metric of each link along the path) is minimized as the optimal path between two nodes. BGP, designed to provide routing over a large number of independent administrative domains, does not select paths based on metrics. If a single administrative domain runs several contiguous BGP networks, it is desirable for BGP to select paths based on metrics, just as an IGP does.

The AIGP attribute enables BGP to select routes based on metrics in an AIGP administrative domain. As a result, all devices in the AIGP administrative domain can use the optimal routes to forward data.

Procedure

  1. Enable AIGP capability for a BGP peer or peer group.
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run the ipv6-family unicast command to enter the BGP-IPv6 unicast address family view, or run the ipv6-family vpnv6 command to enter the BGP-VPNv6 address family view.
    4. Run peer { group-name | ipv6-address } aigp

      The AIGP capability is enabled for a BGP peer or peer group.

      BGP allows you to enable the AIGP capability for either a BGP peer or a BGP peer group. If a BGP peer with the AIGP capability joins a BGP peer group that does not have the AIGP capability, the BGP peer still retains the AIGP capability. If a BGP peer without the AIGP capability joins a BGP peer group that has the AIGP capability, the BGP peer inherits the AIGP capability of the BGP peer group. After a BGP peer inherits the AIGP capability of a BGP peer group, you can run the undo peer aigp command to delete the AIGP configuration from the BGP peer.

    5. Run commit

      The configuration is committed.

  2. (Optional) Allow VPN routes to participate in route selection using the AIGP attribute of the BGP LSP through which they are transmitted.
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. Run ipv6-family vpn-instance vpn-instance-name

      The BGP-VPN instance IPv6 address family view is displayed.

    4. Run bestroute nexthop-resolved aigp

      VPN routes are allowed to participate in route selection using the AIGP attribute of the BGP LSP through which they are transmitted.

    5. Run commit

      The configuration is committed.

Verifying the Configuration of BGP4+ Route Attributes

After configuring BGP4+ route attributes, verify information about the route attributes.

Prerequisites

BGP4+ route attributes have been configured.

Procedure

  • Run the display bgp ipv6 routing-table different-origin-as command to check the routes that have the same destination address but different source ASs.
  • Run the display bgp ipv6 routing-table regular-expression as-regular-expression command to check the routes that match the AS regular expression.
  • Run the display bgp ipv6 routing-table community [ aa:nn &<1-13> ] [ internet | no-advertise | no-export | no-export-subconfed ] * [ whole-match ] command to check the routes carrying the specified BGP4+ community attribute in the routing table.
  • Run the display bgp ipv6 routing-table community-filter { { community-filter-name | basic-community-filter-number } [ whole-match ] | advanced-community-filter-number } command to check the routes that meet the specified BGP4+ community filtering conditions.

Example

# Run the display bgp ipv6 routing-table command to view information about BGP4+ routes.

<HUAWEI> display bgp ipv6 routing-table
 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: 1
 *>  Network  : 2001:db8:7::                             PrefixLen : 64
     NextHop  : 2001:db8:10::2                           LocPrf    :
     MED      : 150                                      PrefVal   : 0
     Label    :
     Path/Ogn : 200  i
Translation
Download
Updated: 2019-01-03

Document ID: EDOC1100055018

Views: 49065

Downloads: 201

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next