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

ME60 V800R010C10SPC500 Configuration Guide - IP Routing 01

This is ME60 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).
Configuring Basic BGP Functions

Configuring Basic BGP Functions

Before building a BGP network, you must configure basic BGP functions.

Usage Scenario

BGP can be configured on a network to implement communication among ASs. To build a BGP network, configure basic BGP functions, including the following steps:

  • Start a BGP process. This step is a prerequisite for configuring basic BGP functions.

  • Establish BGP peer relationships. Devices can exchange BGP routing information only after peer relationships are established.

  • Import routes. BGP itself cannot discover routes. Instead, it imports routes discovered by other protocols to implement communication between ASs.

NOTE:
  • The commands in the BGP-IPv4 unicast address family view can be run in the BGP view. These commands are described in the BGP-IPv4 unicast address family view in configuration files.

Pre-configuration Tasks

Before configuring basic BGP functions, configure parameters of the link layer protocol and IP addresses for interfaces to ensure that the link layer protocol on the interfaces is Up.

Configuration Procedures

Figure 10-2 Configuring basic BGP functions

Starting a BGP Process

Starting a BGP process is a prerequisite for configuring basic BGP functions. When starting a BGP process on a device, you need to specify the number of the AS to which the device belongs.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run bgp { as-number-plain | as-number-dot }

    A BGP process is enabled (the local AS number is specified) and the BGP view is displayed.

  3. (Optional) Run router-id ipv4-address

    A router ID is set.

    Configuring or changing the router ID will reset the BGP peer relationship between routers.

    NOTE:

    By default, BGP automatically selects the router ID in the system view. If the IP address of a physical interface is used as the router ID, route flapping occurs when the IP address of the physical interface changes. To enhance network stability, configuring the address of a loopback interface as the router ID is recommended. For Router ID selection rules in the system view, see descriptions in Command Reference about the router-id command.

    By default, Cluster_List takes precedence over Router ID during BGP route selection. To enable Router ID to take precedence over Cluster_List during BGP route selection, run the bestroute routerid-prior-clusterlist command.

  4. (Optional) Run shutdown

    All sessions between the device and its BGP peers are terminated.

    During the system upgrade, or maintenance, you can run the shutdown command to terminate all sessions between a device and its BGP peers to prevent possible BGP route flapping from affecting the network.

    After the upgrade or maintenance, run the undo shutdown command to restore the BGP peer sessions; otherwise, BGP functions will be affected.

  5. Run commit

    The configuration is committed.

Configuring a BGP Peer

Devices can exchange BGP routing information only after the BGP peer relationship is established.

Context

Because BGP uses TCP connections, you need to configure the IP addresses of peers when configuring BGP. A BGP peer may not be a neighboring node, and the BGP peer relationship can be created through logical links. To enhance the stability of BGP connections, establish connections by using loopback interface addresses.

The devices in the same AS establish IBGP peer relationships, and the devices of different ASs establish EBGP peer relationships.

Procedure

  • Configure an IBGP peer.
    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 the peer and the number of the AS where the peer resides are specified.

      The number of the AS where the specified peer resides must be the same as that of the local AS.

      The IP address of the specified peer can be one of the following types:

      • IP address of an interface on a directly connected peer

      • IP address of a sub-interface on a directly connected peer

      • Address of a loopback interface on a reachable peer

    4. (Optional) Run peer ipv4-address connect-interface interface-type interface-number [ ipv4-source-address ]

      The source interface and source address are specified for TCP connection establishment.

      NOTE:

      When an IP address of a loopback interface or a sub-interface is used to establish a BGP connection, run the peer connect-interface command at both ends of the connection to ensure that the connection is correctly established. If this command is run on only one end, the BGP connection may fail to be established.

    5. (Optional) Run peer ipv4-address description description-text

      The description of the peer is configured.

      You can simplify network management by configuring the descriptions of peers.

    6. (Optional) Run peer ipv4-address tcp-mss tcp-mss-number

      The TCP MSS value used when the local device establishes TCP connections with a peer or peer group is configured.

      You can run the peer tcp-mss command to configure a TCP MSS value used for TCP connection establishment so that it is used to encapsulate BGP packets when the path MTU is unavailable. Such configuration improves network performance.

    7. Run commit

      The configuration is committed.

  • Configure an EBGP peer.
    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 the peer and the number of the AS where the peer resides are specified.

      The number of the AS where the specified peer resides must be different from that of the local AS.

      The IP address of the specified peer can be one of the following types:

      • IP address of an interface on a directly connected peer

      • IP address of a sub-interface on a directly connected peer

      • Address of a loopback interface on a reachable peer

    4. (Optional)Run peer ipv4-address connect-interface interface-type interface-number [ ipv4-source-address ]

      The source interface and source address are specified for establishing a TCP connection.

      NOTE:

      When an IP address of a loopback interface or a sub-interface is used to establish a BGP connection, run the peer connect-interface command at both ends of the connection to ensure that the connection is correctly established. If this command is run on only one end, the BGP connection may fail to be established.

    5. (Optional) Run peer ipv4-address ebgp-max-hop [ hop-count ]

      The maximum number of hops is set for an EBGP connection.

      In most cases, a directly connected physical link must be available between EBGP peers. If you want to establish EBGP peer relationships between indirectly connected peers, run the peer ebgp-max-hop command. The command also can configure the maximum number of hops for an EBGP connection.

      NOTE:

      When the IP address of loopback interface to establish an EBGP peer relationship, run the peer ebgp-max-hop (of which the value of hop-count is not less than 2) command. Otherwise, the peer relationship fails to be established.

    6. (Optional) Run peer ipv4-address description description-text

      The description of the peer is configured.

      You can simplify network management by configuring the descriptions of peers.

    7. (Optional) Run peer ipv4-address tcp-mss tcp-mss-number

      The TCP MSS value used when the local device establishes TCP connections with a peer or peer group is configured.

      You can run the peer tcp-mss command to configure a TCP MSS value used for TCP connection establishment so that it is used to encapsulate BGP packets when the path MTU is unavailable. Such configuration improves network performance.

    8. Run commit

      The configuration is committed.

Configuring BGP to Import Routes

BGP can import the routes from other routing protocols. When BGP needs to import routes from a dynamic routing protocol, you need to specify the process ID of the protocol.

Context

BGP itself cannot discover routes. Therefore, it needs to import routes from other protocols, such as IGP or static routes and adds the routes to the BGP routing table so that these imported routes can be transmitted within an AS or between ASs.

BGP routes are imported in either of the following modes:

  • The import command imports routes based on protocol types, such as RIP routes, OSPF routes, Intermediate System to Intermediate System (IS-IS) routes, static routes, or direct routes.

  • The network command imports a route with the specified prefix and mask to the BGP routing table, which is more precise than the previous mode.

Procedure

  • Run the import command to import routes.
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. (Optional) Run ipv4-family unicast

      The BGP-IPv4 unicast address family view is displayed.

    4. Run import-route { direct | isis process-id | ospf process-id | rip process-id | static } [ med med | [ route-policy route-policy-name | route-filter route-filter-name ] ] * [ non-relay-tunnel ]

      BGP is configured to import routes from other routing protocols.

      By configuring the parameter med, you can set MED values for the imported routes. The EBGP peer selects the route with the smallest MED for traffic entering an AS.

      By configuring the parameter route-policy route-policy-name or route-filter route-filter-name, you can filter the routes imported from other protocols.

      If non-relay-tunnel is specified, the routes imported by BGP are not iterated to tunnels. In most cases, the routes imported by BGP can be iterated to tunnels. However, in some other cases, if the routes imported by BGP are iterated to tunnels, a problem will occur. For example, in a seamless MPLS scenario, if the egress protection function is configured on egress MASGs between which a tunnel exists and a route imported by BGP on one of the MASGs is iterated to the tunnel, this MASG then iterates the route to another tunnel of a different type. In this case, traffic is directed to the other MASG, which slows down traffic switchover. As a result, the egress protection function does not take effect. To address this problem, specify non-relay-tunnel to prevent the routes imported by BGP from being iterated to tunnels.

      NOTE:

      When BGP needs to import routes from IS-IS, OSPF, or RIP, specify the process ID of the protocol.

    5. (Optional) Run default-route imported

      BGP is configured to import default routes.

      To import default routes, run both the default-route imported command and the import-route command. If only the import-route command is used, no default route can be imported.

    6. Run commit

      The configuration is committed.

  • Run the network command to import routes.
    1. Run system-view

      The system view is displayed.

    2. Run bgp as-number

      The BGP view is displayed.

    3. (Optional) Run ipv4-family unicast

      The BGP-IPv4 unicast address family view is displayed.

    4. Run network ipv4-address [ mask | mask-length ] [ route-policy route-policy-name | route-filter route-filter-name ] [ non-relay-tunnel ]

      BGP is configured to import local routes.

      If the mask or mask length of an IPv4 address is not specified, the IPv4 address is considered as a classful address. The local routes to be imported must be in the local IP routing table.

      By configuring the parameter route-policy route-policy-name, you can use routing policies to control the routes to be imported.

      By configuring the parameter route-filter route-filter-name, you can use routing filters to control the routes to be imported.

      If non-relay-tunnel is specified, the routes imported by BGP are not iterated to tunnels. In most cases, the routes imported by BGP can be iterated to tunnels. However, in some other cases, if the routes imported by BGP are iterated to tunnels, a problem will occur. For example, in a seamless MPLS scenario, if the egress protection function is configured on egress MASGs between which a tunnel exists and a route imported by BGP on one of the MASGs is iterated to the tunnel, this MASG then iterates the route to another tunnel of a different type. In this case, traffic is directed to the other MASG, which slows down traffic switchover. As a result, the egress protection function does not take effect. To address this problem, specify non-relay-tunnel to prevent the routes imported by BGP from being iterated to tunnels.

      NOTE:
      • The destination address and mask specified in the network command must be consistent with the corresponding entries in the local IP routing table. Otherwise, the specified route cannot be imported.

      • When running the undo network command to clear the existing configuration, you need to specify the correct mask.

    5. Run commit

      The configuration is committed.

Verifying the Basic BGP Configuration

After configuring the basic BGP functions, verify BGP peer information.

Prerequisites

Basic BGP functions have been configured.

Procedure

  • Run the display bgp router-id [ vpn-instance [ vpn-instance-name ] ] command to check the router IDs.
  • Run the display bgp peer [ verbose ] command to check the information about all BGP peers.
  • Run the display bgp peer ipv4-address { log-info | verbose } command to check the information about a specified BGP peer.
  • Run the display bgp routing-table command to check the information about BGP routes.

Example

Run the display bgp peer command, and you can view the status of the connection between BGP peers.

<HUAWEI> display bgp peer
<HUAWEI> display bgp peer
BGP local router ID : 2.2.2.2
 Local AS number : 65009
 Total number of peers : 3                 Peers in established state : 3
   
  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State  PrefRcv
  10.1.1.2         4       65009    16636    16639     0 0277h13m Established    0
  10.1.3.2         4       65009    16640    16643     0 0277h17m Established    0
  10.2.1.2       4       65008    16984    16984     0 0282h58m Established    1
   

# Run the display bgp routing-table ipv4-address command to view a specified BGP route.

<HUAWEI> display bgp routing-table 10.1.1.2
 BGP local router ID : 2.2.2.2
 Local AS number : 65009
 Paths:   1 available, 1 best, 1 select
 BGP routing table entry information of 10.1.1.0/24:
 Imported route.
 From: 0.0.0.0 (0.0.0.0)
 Route Duration: 11d12h40m33s
 Direct Out-interface: GigabitEthernet1/0/0
 Original nexthop: 9.1.1.1
 Qos information : 0x0
 AS-path Nil, origin incomplete, MED 0, pref-val 0, valid, local, best, select, pre 0
 Advertised to such 3 peers:
    10.1.3.2
    10.1.1.2
    10.2.1.2
Translation
Download
Updated: 2019-01-04

Document ID: EDOC1100059437

Views: 22463

Downloads: 15

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