06-Chapter6 BGP Configuration

download 06-Chapter6 BGP Configuration

of 79

description

BGP Configuration

Transcript of 06-Chapter6 BGP Configuration

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Table of Contents

    Huawei Technologies Proprietary

    i

    Table of Contents

    Chapter 6 BGP Configuration ...................................................................................................... 6-1 6.1 Introduction ........................................................................................................................ 6-1

    6.1.1 BGP Overview......................................................................................................... 6-1 6.1.2 BGP Message Types .............................................................................................. 6-2 6.1.3 BGP Route Attributes.............................................................................................. 6-4 6.1.4 Route Selection Principles ...................................................................................... 6-9 6.1.5 Synchronizing IBGP and IGP................................................................................ 6-11 6.1.6 Issues in Large-Sized BGP Networks................................................................... 6-12 6.1.7 MP-BGP ................................................................................................................ 6-16 6.1.8 Protocols and Specifications ................................................................................. 6-17

    6.2 Configuring Basic BGP Functions ................................................................................... 6-17 6.2.1 Establishing the Configuration Task...................................................................... 6-17 6.2.2 Configuring Basic BGP Functions......................................................................... 6-18 6.2.3 Configuring BGP to Advertise Local Routes ......................................................... 6-19 6.2.4 Configuring the Local Interfaces Used for BGP Connections............................... 6-19 6.2.5 Configuring the Maximum Number of Hops in EBGP Connections...................... 6-19 6.2.6 Entering BGP Extended Address Family View ..................................................... 6-20

    6.3 Controlling the Advertising and Receiving of Routing Information .................................. 6-21 6.3.1 Establishing the Configuration Task...................................................................... 6-21 6.3.2 Configuring BGP to Import IGP Routes ................................................................ 6-22 6.3.3 Configuring BGP to Filter the Imported Routing Information ................................ 6-23 6.3.4 Configuring BGP Route Aggregation .................................................................... 6-23 6.3.5 Configuring a Router to Advertise Default Routes to Its Peer .............................. 6-24 6.3.6 Configuring Related Access Lists ......................................................................... 6-25 6.3.7 Configuring the Policies for Advertising BGP Routing Information ....................... 6-25 6.3.8 Configuring the Policies for Receiving BGP Routing Information ......................... 6-26 6.3.9 Configuring BGP Route Dampening ..................................................................... 6-27

    6.4 Configuring BGP Route Attributes................................................................................... 6-28 6.4.1 Establishing the Configuration Task...................................................................... 6-28 6.4.2 Configuring the BGP Preference........................................................................... 6-29 6.4.3 Configuring the Default Local Pref Attribute.......................................................... 6-29 6.4.4 Configuring the MED Attributes............................................................................. 6-30 6.4.5 Configuring the Next_Hop Attribute ...................................................................... 6-31 6.4.6 Configuring the AS_Path Attribute ........................................................................ 6-32

    6.5 Adjusting and Optimizing BGP Networks ........................................................................ 6-34 6.5.1 Establishing the Configuration Task...................................................................... 6-34 6.5.2 Configuring BGP Timers ....................................................................................... 6-35

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Table of Contents

    Huawei Technologies Proprietary

    ii

    6.5.3 Configuring the Interval of Sending Update Packets ............................................ 6-36 6.5.4 Configuring to Soft Reset BGP ............................................................................. 6-36 6.5.5 Enabling to Quick Reset EBGP Connections ....................................................... 6-37 6.5.6 Configuring MD5 Authentication ........................................................................... 6-37 6.5.7 Configuring the Maximum Number of Equal-Cost Routes.................................... 6-38

    6.6 Building Large-Sized BGP Networks............................................................................... 6-38 6.6.1 Establishing the Configuration Task...................................................................... 6-38 6.6.2 Configuring a BGP Peer Group............................................................................. 6-39 6.6.3 Configuring the BGP Community .......................................................................... 6-41 6.6.4 Configuring the BGP Route Reflector ................................................................... 6-42 6.6.5 Configuring the BGP Confederation...................................................................... 6-43

    6.7 Maintaining BGP.............................................................................................................. 6-43 6.7.1 Displaying BGP ..................................................................................................... 6-43 6.7.2 Resetting BGP Connections ................................................................................. 6-44 6.7.3 Clearing BGP Information ..................................................................................... 6-45 6.7.4 Debugging BGP .................................................................................................... 6-45

    6.8 Configuration Examples................................................................................................... 6-46 6.8.1 Configuring Basic BGP Functions......................................................................... 6-46 6.8.2 Configuring BGP to Interact with IGP ................................................................... 6-52 6.8.3 Configuring BGP Load Balancing and MED Attribute........................................... 6-56 6.8.4 Configuring the BGP Community .......................................................................... 6-61 6.8.5 Configuring the BGP Route Reflector ................................................................... 6-65 6.8.6 Configuring the BGP Confederation...................................................................... 6-70

    6.9 Troubleshooting ............................................................................................................... 6-77

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-1

    Chapter 6 BGP Configuration

    6.1 Introduction

    6.1.1 BGP Overview Border Gateway Protocol (BGP) is an inter-Autonomous System dynamic routing protocol.

    BGP has three early versions, BGP-1 (defined in RFC1105), BGP-2 (defined in RFC1163) and BGP-3 (defined in RFC1267). The current version of BGP is BGP-4 (defined in RFC1771).

    The Internet Service Providers (ISPs).widely use BGP-4 as a virtually exterior routing protocol standard on the Internet.

    The following BGPs refer to BGP-4 unless otherwise stated.

    The characteristics of BGP are as follows: z It focuses on route propagation control and selection of optimal routes rather

    than discovery and calculation of routes. This separates it from the Interior Gateway Protocols (IGPs) such as OSPF and RIP, BGP is an Exterior Gateway Protocol (EGP).

    z It uses TCP as the transport layer protocol (the port number is 179) to enhance the reliability of the protocol.

    z Supports Classless Inter-Domain Routing (CIDR). z Transmits only the updated routes whenever the routes are updated. This

    occupies less bandwidth and is suitable for propagating large amount of routing information on the Internet.

    z Eliminates route loops completely by adding AS path information to BGP routes z It provides abundant route policies to implement flexible filtering and route

    selection. z Extends easily to support new developments of the network

    The BGP speaker is a router which transmits BGP messages. The speaker continuously receives and generates new routing information. It advertises the routing information to the other BGP speakers.

    When a BGP speaker receives a new route from another AS, it compares the route with the current route. If the learned route is better or it is a new route, the speaker advertises the route to all the other BGP speakers in the AS.

    The peer of a BGP speaker is a BGP speaker with which it exchanges information. Multiple related peers compose a peer group.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-2

    BGP runs on a router in any of the following modes: z Interior BGP (IBGP) z Exterior BGP (EBGP)

    The BGP is called an IBGP when it runs within an AS. It is called an EBGP when it runs among different ASs.

    6.1.2 BGP Message Types

    I. Message Header Format

    BGP is driven by messages of the following five types. These messages have the same packet header, as shown in Figure 6-1.

    Marker

    Length Type

    0 7 15 31

    Figure 6-1 The packet header of BGP messages

    The main fields are explained as follows: z Marker: used for calculation in BGP authentication. If there is no authentication,

    it is all 1s. z Length: indicates the total length of the BGP message (including packet header)

    in bytes. z Type: indicates the message type. It can be 1 to 5, representing Open, Update,

    Notification, Keepalive and Route-refresh messages respectively. The first four message types are defined in RFC1771 and the last one is defined in RFC2918.

    II. Open Message

    The open message is the first message sent after the creation of a TCP connection, which is used to connect BGP peers. Its format is shown in Figure 6-2.

    BGP IdentifierOpt Parm Len

    Optional Parameters

    0 7 15 31Version

    My Autonomous SystemHold Time

    Figure 6-2 The format of Open messages

    The main fields are explained as follows:

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-3

    z Version: indicates BGP version number. For BGP-4, it is 4. z My Autonomous System: indicates the local AS number. You can determine

    whether it is an EBGP connection or an IBGP connection by comparing the AS numbers of the BGP peers.

    z Hold time: the BGP peers need to negotiate the hold-time when establishing the peer relationship and keep it consistent. If one side does not receive Keepalive or Update messages from its peer in this time, it considers the BGP connection as closed.

    z BGP Identifier: identifies a BGP router. It is in the form of an IP address. z Opt Parm Len (Optional Parameters Length): indicates the length of the

    Optional Parameters field. The value 0 indicates no optional parameters. z Optional Parameters: indicates the optional parameters used for BGP

    authentication or multiprotocol extensions.

    III. Update Message

    The Update messages are used to exchange routing information between BGP peers. It can advertise one feasible route, or withdraw multiple unfeasible routes. The message format is shown in Figure 6-3.

    Path Attributes (variable)Network Layer Reachability Information (variable)

    Unfeasible Routes Length (2 octets)Withdrawn Routes (variable)

    Total Path Attribute Length (2 octets)

    Figure 6-3 The format of Update messages

    The main fields are explained as follows: z Unfeasible Routes Length: indicates the length of the Withdrawn Routes field in

    bytes. The value 0 represents no Withdrawn Routes field. z Withdrawn Routes: contains a list of unfeasible routes. z Total Path Attribute Length: indicates the length of the Path Attributes field in

    bytes. The value 0 represents no Path Attributes or NLRI field. z Path Attributes: contains a list of all path attributes related to Network Layer

    Reachability Information (NLRI). Each path attribute is a triple Type-Length-Value (TLV).

    z NLRI: indicates the prefix of a feasible route and the length of the prefix.

    IV. Notification Message

    The notification message is used for one side to notify errors to its peer. After that, the BGP connection is closed. The message format is shown in Figure 6-4.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-4

    Error Subcode0 7 15 31

    Error CodeData

    Figure 6-4 The format of Notification messages

    The main fields are explained as follows: z Error Code: specifies the error type z Error Subcode: specifies the details of the error type z Data: used to diagnose the reason for the error. Its length is variable

    V. Keepalive Message

    The keepalive message is used to check the validity of a connection. It only contains the packet header without any other fields.

    VI. Route-refresh Message

    The Route-refresh message notifies the route refreshment capability.

    6.1.3 BGP Route Attributes

    I. Route Attribute Classification

    The BGP route attributes is a set of parameters. They further describe a specific route for BGP to filter and select routes.

    Actually, all BGP route attributes fall into the following categories: z Well-known mandatory: can be identified by all BGP routers. The attributes are

    mandatory and must be included in each Update message. Without them, errors occur in routing information.

    z Well-known discretionary: can be identified by all BGP routers. The attributes are discretionary and may not be included in each Update message. They can be selected according to practical conditions.

    z Optional transitive: indicates the transitive attributes among ASs. A BGP router may not support this attribute, but it still receives the routes with this attribute and advertises them to other peers.

    z Optional non-transitive: If a BGP router does not support this attribute, the Update messages with this attribute are ignored and are not advertised to other peers.

    The BGP route attributes and their corresponding types are shown in Table 6-1.

    Table 6-1 Route attributes and their types

    Attribute name Type

    Origin Well-known mandatory

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-5

    Attribute name Type

    As_Path Well-known mandatory

    Next_Hop Well-known mandatory

    Local_Pref Well-known discretionary

    Atomic_Aggregate Well-known discretionary

    Aggregator Optional transitive

    Community Optional transitive

    Multi_Exit_Disc(MED) Optional non-transitive

    Originatior_ID Optional non-transitive

    Cluster_List Optional non-transitive

    II. Several Main Route Attributes

    1) Origin

    The Origin attribute defines the origin of one route. It marks the paths of one BGP route. It falls into the following three types:

    z IGP: has the highest priority. For example, the routes generated by the network command, their Origin attribute is IGP.

    z EGP: has the second highest priority. For example, the routes generated through EGP, their Origin attribute is EGP.

    z Incomplete: has the lowest priority. It indicates that the route origin cannot be determined. For example, the routes imported by BGP.

    2) AS_Path

    The AS_Path attribute records all ASs that a route passes from the local area to the destination in a certain order. When BGP advertises a route to other ASs, it adds the local AS number at the beginning of the AS_Path list. The BGP router receiving this route learns the ASs which the route passes through before reaching the destination. It learns this on the basis of the AS_Path attribute. The number of the adjacent AS nearest to the local AS is at the top of the list, and the other AS numbers are arranged in ascending order of their distance from the AS, as shown in Figure 6-5.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-6

    8.0.0.0

    AS10

    D=8.0.0.0(10)

    D=8.0.0.0(10)

    D=8.0.0.0(20,10)

    AS20AS40

    D=8.0.0.0(40,10)

    D=8.0.0.0(30,20,10)AS30 AS50

    Figure 6-5 AS_Path attribute

    The AS_Path attribute can avoid route loops. Usually, a BGP router does not accept the routes containing its own AS number.

    Note: In the NE20 implementation, you can configure the peer allow-as-loop command to allow repetitive AS numbers.

    The AS_Path attribute is also used for selecting and filtering routes. When all other factors are the same, BGP selects the shortest route. For example, in Figure 6-5, the BGP router in AS50 selects the route passing AS40 as the optimum route to the destination 8.0.0.0.

    In some applications, you can prolong the AS route by route policies to control the route selection more flexibly.

    After the list of the AS_Path attributes is configured, you can filter routes based on the AS numbers contained in the AS_Path attribute.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-7

    Note: An IBGP router advertises routes to its peers without changing the AS_Path attribute.

    3) Next_Hop

    The Next_Hop attribute of BGP is different from that of IGP. It may not be the IP address of the neighbor.

    As shown in Figure 6-6, when the BGP speaker advertises a certain route to EBGP peers, it configures the next_hop as the address of the local interface connected with the peer. When the BGP speaker advertises this route to IBGP peers, it does not change the next_hop attribute.

    AS1008.0.0.0

    AS200

    1.1.2.1/24

    D=8.0.0.0Next_Hop=1.1.1.1

    1.1.1.1/24EBGP

    EBGP

    D=8.0.0.0Next_Hop=1.1.2.1

    IBGP

    D=8.0.0.0Next_Hop=1.1.2.1

    AS300

    Figure 6-6 The Next_Hop attribute

    4) Muti-Exit-Disc

    The Multi-Exit-Disc (MED) attribute is only exchanged between two adjacent ASs. The AS that receives this attribute does not advertise it to any other ASs.

    The MED attribute is equivalent to the metrics used by IGP. It determines the optimum route for the traffic entering the AS. When a BGP router obtains multiple routes to the same destination address but with different next hops through EBGP peers, the route with the lowest MED attribute is the optimum route. This is considered if all the other conditions are same. As shown in Figure 6-7, the traffic from AS10 to AS20 selects Router B as the ingress.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-8

    > D=9.0.0.0Next_Hop=2.1.1.1MED=0

    RouterA

    D=9.0.0.0Next_Hop=3.1.1.1MEd=100

    AS10

    2.1.1.1

    EBGP

    MED=0RouterB

    IBGP

    RouterD

    9.0.0.0

    IBGP

    RouterCMED=100

    EBGP

    3.1.1.1

    IBGP

    AS20

    Figure 6-7 The MED attribute

    Usually, BGP only compares the MED attributes of the routes from the same AS.

    Note: In NE20 implementation, you can configure the compare-different-as-med command. Thus, BGP is forced to compare the MED attributes of the routes from different ASs.

    5) Local_Pref

    The Local_Pref attribute is only exchanged between IBGP peers and is not advertised to other ASs. It indicates the preference of the BGP router.

    The Local_Pref attribute determines the optimum route for the traffic to leave the AS. When a BGP router obtains multiple routes to the same destination address but with different next hops through IBGP peers, the route with the highest Local_Pref attribute is selected. As shown in Figure 6-8, the traffic from AS20 to AS10 selects Router C as the egress.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-9

    D=8.0.0.0Next_Hop=2.1.1.1Local_Pref=100

    RouterA> D=8.0.0.0Next_Hop=3.1.1.1Local_Pref=200

    AS10

    2.1.1.1EBGP

    Local_Pref-100RouterB

    IBGP

    RouterD

    8.0.0.0

    IBGP

    RouterCLocal_Pref=200

    EBGP3.1.1.1

    IBGP

    AS20

    Figure 6-8 The Local_Pref attribute

    6) Community

    The community attribute simplifies the application of the route policies. It is an aggregation of the destination addresses which has the same attribute. The addresses have no physical boundary and they are independent of ASs.

    The following are the well-known community attributes: z Internet: By default, all routes belong to the Internet community. The routes with

    this attribute can be advertised to all BGP peers. z No_Export: When a router receives a route with this attribute, it does not

    advertise the route outside the local AS. If there is a confederation, this route cannot be advertised outside the confederation, but it be advertised to other sub-ASs in the confederation (For details of the Confederation, refers to 6.1.6 Issues in Large-Sized BGP Networks.

    z No_Advertise: When a router receives a route with this attribute, it does not advertise the route to other BGP peers.

    z No_Export_Subconfed: When a router receives a route with this attribute, it does not advertise the route outside the local AS or to other sub-ASs in the confederation.

    6.1.4 Route Selection Principles

    I. Routing Policies

    In NE20 implementation, BGP selects routes based on the following policies: z discarding the routes with the unreachable Next_Hop z preferring the route with the highest Local_Pref z preferring the route originated by the local router z preferring the route with the shortest AS_Path z selecting in turn the routes whose Origin can be IGP, EGP or Incomplete z preferring the route with the lowest MED z preferring the route learned from EBGP

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-10

    z performing load sharing on multiple routes according to the configured number of routes (in case load sharing is configured and there are multiple external routes to the same AS)

    z preferring the route advertised by the router with the smallest router ID

    II. Routing Policies for Load Sharing Applications

    In BGP, the next hop address of the generated route may not be the address of the peer connected directly with the local router. A common reason is that the next hop is not changed when routing information is advertised between IBGP routers. In this case, the router must find a directly reachable address first to correctly forward the packet. Then, it can reach the next hop specified in the routing table. In this process, the route to the directly reachable address is called the dependent route.

    BGP routers depend on the route to guide packet forwarding. The process to find the dependent route based on the next hop address is called route iterative.

    NE20 supports BGP load sharing based on iteration. If the dependent route is configured for load sharing (suppose there are three next hop addresses), BGP generates the same number of next hop addresses to guide packet forwarding. The iteration based BGP load sharing need not be configured using commands. This feature is always enabled in NE20.

    BGP load sharing is different from IGP load sharing with respect to the following implementations: z For different routes to a same destination address, IGP calculates the route

    metric based on its own routing algorithm. The load sharing is performed on the routes with the same metric.

    z BGP does not have its own routing algorithm. Thus, it cannot determine whether to perform load sharing on routes based on explicit metrics. However, abundant route selection rules can be used to select the routes for load sharing, namely, adding load sharing to the route selection rules.

    Note: z BGP only performs load sharing on the routes with the same AS_Path attribute. z BGP load sharing can also be applied to the ASs inside the confederation.

    III. Routing Policies for Route Advertisement

    In NE20 implementation, BGP advertises routes based on the following policies: z When there are multiple valid routes, the BGP speaker only advertises the

    optimum route to its peer. z The BGP speaker only sends the routes used by its own to its peer.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-11

    z The BGP speaker advertises the routes obtained from EBGP to all of its BGP peers (including EBGP peers and IBGP peers).

    z The BGP speaker does not advertise the routes obtained from IBGP to its IBGP peers.

    z The BGP speaker advertises the routes obtained from IBGP to its EBGP peers (when BGP and IGP are not synchronous).

    z Once the connection is created, the BGP speaker advertises all of its BGP routes to the new peers.

    6.1.5 Synchronizing IBGP and IGP

    The synchronization of IBGP and IGP is to avoid misleading the external AS routers.

    If there is a non-BGP router in one AS to provide forwarding service, the IP packets forwarded by this AS may be discarded because the destination address is unreachable. As shown in Figure 6-9, Router E learns a route 8.0.0.0/8 of Router A from Router D through BGP, and then it forwards this packet to Router D. Router D queries the routing table and finds that the next hop is Router B. Because Router D learns the route to Router B through IGP, Router D forwards the packet to Router C based on route iteration. However, Router C does not know the route to 8.0.0.0/8 and so discards the packet.

    8.0.0.0/8

    RouterA

    AS10EBGP

    RouterB

    IGP

    IGPRouterC

    AS20RouterD

    EBGP

    RouterE

    AS30

    IBGP

    Figure 6-9 Synchronizing IBGP and IGP

    If the synchronization feature is configured, the IGP routing table is checked before the IBGP route is added to the routing table and advertised to the EBGP peers. Only when IGP knows this IBGP route, the IBGP route is added to the routing table and advertised to the EBGP peers.

    The synchronization feature needs to be disabled in the following situations: z The local AS is not a transitive AS (The AS20 in Figure 6-9 is a transitive AS). z All routers in the local AS establish an IBGP full connection.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-12

    6.1.6 Issues in Large-Sized BGP Networks

    I. Routes Aggregation

    In a large sized network, the BGP routing table is rather large. You can use routes aggregation to reduce the size of the routing table.

    Routes aggregation is to aggregate multiple routes. BGP only advertises the aggregated route rather than all the specific routes to its peers.

    NE20 supports automatic aggregation and manual aggregation. The latter can also control the attribute of the aggregated route and determine whether to advertise the specific routes.

    II. Route Dampening

    The route dampening is to solve the problem of unstable routes or route flaps. A route flap occurs when a route is present in the routing table at one time and not there at other times.

    When a route flaps, the routing protocol sends an Update packet to its neighbors. The routers receiving this Update packet recalculate routes and modifies the routing tables. Frequent route flaps consume a lot of bandwidth and CPU resources. It thus affects the normal work of the network.

    In most cases, BGP is applied to complicated network environments and the routes change frequently. To avoid the disadvantages caused by the frequent route flaps, BGP uses route dampening to suppress the unstable routes.

    The route dampening measures the stability of one route using the punishment value. The higher is the punishment value, the more unstable is the route. When the route flaps once, BGP adds the punishment value (1000) to this route. When the punishment value exceeds the suppression threshold, the route is suppressed. Thus, the route is not added to the routing table nor it advertises update packets to other BGP peers.

    The punishment value of the suppressed route decreases to a half after a period of time. This period is called Half-life. When the punishment value decreases to the recovery threshold, the route is usable again and is added to the routing table. It also advertises update packets to other BGP peers.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-13

    Figure 6-10 Schematic diagram of BGP route dampening

    III. Peer Group

    A peer group is a group of peers with the same attribute. When a peer is added to the peer group, this peer is configured the same as this group. The configurations of the peers in the group also change when the configuration of the peer group changes.

    In a large sized BGP network, there are many peers and most of them have the same policies. Thus, there are some repetitive commands in the configurations. In most cases, you can simplify the configurations using the peer group.

    Besides, adding peers to a peer group also improves the efficiency of route advertisement.

    IV. Community

    Peer group allows only a group of peers to enjoy the same policies. While the community allows a group of BGP routers in multiple ASs to enjoy the same policies. The community is a route attribute. It is transmitted among BGP peers regardless of ASs.

    Before a BGP router advertises the route with the community attribute to other peers, it can change all the community attributes of this route.

    Except using the public community attribute, you can define the extended community attribute using the community attribute list to control route policies more flexibly.

    V. Route Reflector

    To ensure the connectivity among IBGP peers, you need to establish a full connection among IBGP peers. Suppose there are n routers inside an AS, then n

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-14

    (n-1)/2 IBGP connections need to be established. When there are a lot of IBGP peers, it needs to consume many network and CPU resources.

    Route reflection solves this problem. In an AS, one router severs as the Router Reflector (RR) and the other routers serve as the Clients. The clients establish IBGP connections with the RR. The RR transmits (reflects) routing information among clients, and the clients need not establish BGP connections.

    A BGP router which is neither the RR nor a client is a Non-Client. A non-client must establish a full connection with the RR and all other non-clients, as shown in Figure 6-11.

    Client

    RouteReflector

    IBGP

    IBGPIBGP

    IBGPIBGPCluster

    Non-Client

    Non-Client

    Client

    Client

    IBGP

    AS65000

    Figure 6-11 Schematic diagram of the route reflector

    The route reflector and its clients compose a Cluster. To enhance the reliability of the network and avoid single node failure, you can configure one more route reflectors in a cluster. Then, each route reflector in the same cluster must be configured with the same Cluster_ID to avoid route loops, as shown in Figure 6-12.

    RouterReflector1

    RouterReflector2

    IBGP

    Cluster

    Client

    IBGP IBGP IBGP

    Client Client

    AS65000

    Figure 6-12 Multiple route reflectors

    In some networks, the clients of a route reflector have established a full connection and they can exchange routing information with each other directly. Thus, the route

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-15

    reflection between clients is unnecessary, and occupies the bandwidth resources. NE20 supports to disable route reflection between clients by configuring related commands.

    Note: After the route reflection is disabled between clients, the routes between a client and a non-client can still be reflected.

    VI. Confederation

    The Confederation is another method of handling too many IBGP connections in an AS. It divides an AS into several sub-ASs. A full connection is established among the IBGP peers in each sub-AS, and the EBGP connection is established among sub-ASs, as shown in Figure 6-13.

    AS65002AS65003

    AS65001

    AS100

    AS200

    EBGP EBGP

    EBGP IBGP

    IBGPIBGP

    Figure 6-13 Schematic diagram of the confederation

    For the BGP speakers not in the confederation, the multiple sub-ASs in the same confederation are integral. The outside needs not know the internal sub-AS situations. The confederation ID is the AS number identifying the whole confederation. For example, the AS200 in the above figure is the confederation ID.

    The confederation has some disadvantages. The routers need to be reconfigured when the non-confederation networking plan shifts to the confederation plan. The logical typology also needs to be changed.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-16

    In a large sized BGP network, the route reflector and the confederation can be used at the same time.

    6.1.7 MP-BGP

    I. Introduction to MP-BGP

    The traditional BGP-4 manages the IPv4 routing information only. The inter-AS transmissions is limited for the applications using other network layer protocols (for example, IPv6),

    To support multiple network layer protocols, the Internet Engineering Task Force (IETF) extends BGP-4 to form MP-BGP. The current MP-BGP standard is RFC2858 (Multiprotocol Extensions for BGP-4).

    MP-BGP is backward compatible. That is, the routers supporting BGP extensions can communicate with the routers not supporting BGP extensions.

    II. Extended Attributes of MP-BGP

    Three IPv4 related attributes are carried by Update packets. They are NLRI, Next_Hop and Aggregator in the path attribute. Among them, Aggregator contains the IP address of the BGP speaker after route aggregation.

    To support multiple network layer protocols, BGP-4 needs to reflect the network layer protocol information to NLRI and Next_Hop. MP-BGP introduces two path attributes: z MP_REACH_NLRI (Multiprotocol Reachable NLRI): used to advertise the

    reachable routes and the next hop information. z MP_UNREACH_NLRI (Multiprotocol Unreachable NLRI): used to withdraw the

    unreachable routes.

    Both of the attributes are Optional non-transitive. Thus, the BGP speakers that do not provide the multiprotocol capability ignore the information of the two attributes, and do not advertise them to other neighbors.

    III. Address Family

    BGP uses Address Family to distinguish the different network layer protocols. You can refer to RFC1700 (Assigned Numbers) for the values of the address family.

    NE20 implements multiple MP-BGP extension applications, including extending VPN and IPv6. Different extension applications are configured in each address family view.

    Note: This chapter does not introduce the commands related to a specific application in MP-BGP address family view in details.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-17

    6.1.8 Protocols and Specifications

    The protocols and specifications related to BGP are as follows: z RFC1771: A Border Gateway Protocol 4 (BGP-4) z RFC2858: Multiprotocol Extensions for BGP-4 z RFC3392: Capabilities Advertisement with BGP-4 z RFC2918: Route Refresh Capability for BGP-4 z RFC2439: BGP Route Flap Damping z RFC1997: BGP Communities Attribute z RFC2796: BGP Route Reflection z RFC3065: Autonomous System Confederations for BGP

    The features of Graceful Restart and the extended community attribute are still in the draft phase.

    6.2 Configuring Basic BGP Functions

    Note: z The BGP and MP-BGP have no strict distinction in this section. For the suitable

    conditions of the command, refer to the related view. z For the convenience of configuration, the command in BGP-IPv4 unicast address

    family view can be executed in BGP view. However, the command in the configuration file should be executed in BGP-IPv4 unicast address family view.

    6.2.1 Establishing the Configuration Task

    I. Applicable Environments

    This section introduces the fundamental BGP network configurations.

    Because BGP uses TCP connections, you need to specify the IP address of the peer when configuring BGP. The BGP peer may not be the adjacent router. The BGP peer relationship also can be created using logical links. To enhance the stability of the BGP connections, the Loopback interface addresses are usually used for the connections.

    II. Preconfigured Tasks

    Before configuring basic BGP functions, you need to complete the following tasks: z Keeping the network layers of the adjacent nodes reachable

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-18

    III. Data Preparations

    To configure basic BGP functions, you need the following data.

    No. Data

    1 The local AS number and router ID

    2 IPv4 address of the peer and the AS number

    3 The interface originating the update packet

    IV. Configuration Procedures

    No. Procedure

    1 Configuring basic BGP functions

    2 Configuring BGP to advertise local routes

    3 Configuring the interfaces used for BGP connections

    4 Configuring the maximum number of hops in EBGP connections

    5 Entering the address family view

    6.2.2 Configuring Basic BGP Functions

    Step Action Command

    1 Enter system view. system-view

    2 Enable BGP and enter BGP view.

    bgp as-number

    3 Configure the router ID. router-id ip-address

    4 Configure BGP peers. peer ip-address as-number as-number

    5 Configure the descriptions of BGP peers.

    peer { ip-address | group-name } description description-line

    Step 5 is optional. The descriptions are configured for ease of management.

    Note: Step 3 is optional. To enhance network reliability, you can configure the router ID to the address of the Loopback interface manually. If no router ID is configured, BGP selects one interface address as the router ID automatically.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-19

    6.2.3 Configuring BGP to Advertise Local Routes

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure BGP to advertise local routes.

    network ip-address [ address-mask ] [ route-policy route-policy-name ]

    The local routes to be advertised must be in the local IP routing table. You can use route policies to control the routes to be advertised more flexibly.

    6.2.4 Configuring the Local Interfaces Used for BGP Connections

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Configure the local interfaces used for BGP connections.

    peer { ip-address | group-name } connect-interface interface-type interface-number

    Usually, BGP uses the physical interface connected directly with the peer as the local interface used for TCP connections.

    To make BGP connections more reliable and stable, you can configure the local interface used for BGP connections as the Loopback interface. In this way, when there are redundant links in the network, the BGP connections are not closed due to the failure of a certain interface or a link.

    6.2.5 Configuring the Maximum Number of Hops in EBGP Connections

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Configure the maximum number of hops in EBGP connections.

    peer { ip-address | group-name } ebgp-max-hop [ number ]

    A directly-connected physical link must be available between EBGP peers. If this cannot be satisfied, you must allow them to establish TCP connections through multiple hops using the peer ebgp-max-hop command.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-20

    6.2.6 Entering BGP Extended Address Family View

    I. Entering IPv4 Unicast Address Family View Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter IPv4 unicast address family view. ipv4-family unicast

    II. Entering VPNv4 Address Family View

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter VPNv4 address family view. ipv4-family vpnv4

    III. Entering BGP-VPN Instance View

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP-VPN instance view.

    ipv4-family vpn-instance vpn-instance-name

    If you want to configure BGP MPLS VPN application, enable BGP first. Then, you can enter the corresponding extended address family view for related configurations.

    Note: Most commands in BGP extended address family view are the same as that in BGP view. However, the commands configured in extended address family view are only valid in the related applications.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-21

    6.3 Controlling the Advertising and Receiving of Routing Information

    6.3.1 Establishing the Configuration Task

    I. Applicable Environments 1) Importing external routes

    BGP can send the internal routing information to its neighboring ASs. BGP does not discover the internal routing information by itself. Instead, it imports IGP routing information to the BGP routing table and advertises it to peers. When importing IGP routes, IGP filters the routing information for different routing protocols.

    2) BGP route aggregation

    In medium or large sized BGP networks, route aggregation needs to be configured when routing information is advertised to peers. This reduces the size of the routing table. BGP supports two aggregation modes, namely, automatic aggregation and manual aggregation.

    3) Related access list

    BGP has two private access lists, namely, AS path filtering list and community attribute list. They can be used in displaying BGP running status and route policies.

    AS path filtering list is used to match the AS_Path attribute in the BGP routing information and filter out the routing information not matching the conditions. You can define multiple rules (permit or deny) for the same list number.

    The community attribute list identifies the community information. It is of two types, the standard community access list and the extended community access list. 4) Controlling the received routing information

    BGP can filter the global routing information to be received. In addition, it can filter or perform route policies on only the routing information received from a certain peer (or a peer group).

    5) Controlling the advertised routing information

    BGP can filter or perform route policies on only the routing information advertised by a certain peer (or a peer group).

    6) BGP dampening

    BGP dampening can suppress unstable routing information. Thus, BGP does not this information to the routing table nor advertise it to other BGP peers.

    II. Preconfigured Tasks

    Before controlling the receiving and advertising of BGP routing information, you need to configure the basic BGP functions.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-22

    III. Data Preparations

    To control advertisement and reception of BGP routing information, you need the following data.

    No. Data

    1 Aggregation mode and the aggregated route

    2 Access list number

    3 Filtering direction (advertising or receiving) and the name of the route policy

    4 Dampening parameters: half-life and threshold

    IV. Configuration Procedures

    No. Procedure

    1 Configuring BGP to import IGP routes

    2 Configuring BGP to filter the imported routing information

    3 Configuring BGP route aggregation

    4 Configuring a router to advertise default routes to its peer

    5 Configuring related access lists

    6 Configuring the policy for advertising BGP routing information

    7 Configuring the policy for receiving BGP routing information

    8 Configuring BGP route dampening

    6.3.2 Configuring BGP to Import IGP Routes

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Allow BGP to import default routes.

    default-route imported

    5 Configure BGP to import IGP routes.

    import-route protocol [ process-id ] [ med med-value ] [ route-policy route-policy-name ]

    If the default-route imported command is not configured, using the import-route command cannot import IGP default routes.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-23

    6.3.3 Configuring BGP to Filter the Imported Routing Information

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Filter the imported routing information.

    filter-policy { acl-number | ip-prefix ip-prefix-name } export [ protocol ] [ process-id ]

    After BGP filters the imported routing information, only the routing information that meets certain conditions is advertised (exported) to BGP peers. If the parameter protocol is specified, you can filter the routing information of a specific routing protocol. If not, you can filter all the routing information to be advertised, including the imported routes and the local routes advertised using the network command.

    Note: If the ACL is used in the filter-policy command and no VPN instance is specified in the ACL filtering rules, BGP filters routing information in all address families, including the routing information of public network and private network. If a VPN instance is specified in the ACL filtering rules, BGP filters data traffic from this VPN instance only rather than the routing formation.

    6.3.4 Configuring BGP Route Aggregation

    There are two modes of BGP route aggregation: z Automatic aggregation: aggregates the imported IGP subnet routes. Once it is

    configured, BGP receives the aggregated routes of the natural network segment rather than the subnet routes imported from the IGP.

    z Manual aggregation: aggregates the local BGP routes. In general, the preference of the manual aggregation is higher than that of the automatic aggregation.

    I. Configuring Automatic Summary

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-24

    Step Action Command

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure automatic summary of the subnet routes.

    summary automatic

    II. Configuring Manual Aggregation

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure manual route aggregation.

    aggregate ip-address mask [ as-set ] [ detail-suppressed ] [ suppress-policy route-policy-name ] [ origin-policy route-policy-name ] [ attribute-policy route-policy-name ]

    You can apply multiple policies and configure the route attributes through manual aggregation.

    6.3.5 Configuring a Router to Advertise Default Routes to Its Peer

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Advertise default routes to its peer.

    peer { ip-address | group-name } default-route-advertise [ route-policy route-policy-name ]

    Note: After the command peer default-route-advertise is executed, the router sends a default route with the local address as the next hop to the specified peer, no matter whether there are default routes in the routing table.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-25

    6.3.6 Configuring Related Access Lists

    I. Configuring AS Path Filtering List Step Action Command

    1 Enter system view. system-view

    2 Configure AS path filtering list.

    ip as-path-filter as-path-filter-number { permit | deny } regular-expression

    For the same list number, you can define multiple filtering rules (permit or deny). During the matching, "OR" relationship is available between the rules, that is, when the routing information passes through one rule of the list, it means that the routing information passes through this AS path filtering list identified by this list number.

    II. Configuring Community Attributes List

    Step Action Command

    1 Enter system view. system-view

    2 Configure standard community attributes list.

    ip community-filter basic-comm-filter-num { permit | deny } { aa:nn | internet | no-export-subconfed | no-advertise | no-export }

    Configure extended community attributes list.

    ip community-filter adv-comm-filter-num { permit | deny } regular-expression

    6.3.7 Configuring the Policies for Advertising BGP Routing Information

    I. Apply Route Policies to the Advertised Routing Information Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the export route policies.

    peer { ip-address | group-name } route-policy route-policy-name export

    Note: The routing policy applied in the peer route-policy export command does not support taking a certain interface as one of match rules. That is, the routing policy does not support the if-match interface command.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-26

    II. Filtering the Routing Information Advertised to Peers

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the filtering policies based on ACL.

    peer { ip-address | group-name } filter-policy acl-number export

    Configure the filtering policies based on AS path list.

    peer { ip-address | group-name } as-path-filter as-path-filter-number export

    Configure the filtering policies based on the prefix list.

    peer { ip-address | group-name } ip-prefix ip-prefix-name export

    The export route update polices used by the members in a peer group must be the same as that used by its group. That is, the members in a peer group conform to the same policies when advertising routes outside.

    6.3.8 Configuring the Policies for Receiving BGP Routing Information

    I. Filtering the Received Global Routing Information Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Filter the received global routing information.

    filter-policy { acl-number | ip-prefix ip-prefix-name } import

    The routes received by the BGP can be filtered, and only those routes that meet certain conditions are received by BGP and added to the routing table.

    II. Applying Route Policies to the Received Routing Information

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Apply route policies to the received routing information.

    peer { ip-address | group-name } route-policy route-policy-name import

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-27

    Note: The routing policy applied in the peer route-policy import command does not support taking a certain interface as one of match rules. That is, the routing policy does not support the if-match interface command.

    III. Filtering the Routing Information Received From the Peers

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    3 Configure to filter routes based on ACL.

    peer { ip-address | group-name } filter-policy acl-number import

    Configure to filter routes based on AS path list.

    peer { ip-address | group-name } as-path-filter as-path-filter-number import

    Configure to filter routes based on the address prefix list.

    peer { ip-address | group-name } ip-prefix ip-prefix-name import

    The import route policies used by the members in a peer group can be different from that used by its group. That is, each peer can select its own policies when receiving routes.

    6.3.9 Configuring BGP Route Dampening

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure BGP route dampening parameters.

    dampening [ half-life-reachable half-life-unreachable reuse suppress-limit maximum-ceiling-value ] [ route-policy route-policy-name ]

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-28

    6.4 Configuring BGP Route Attributes

    6.4.1 Establishing the Configuration Task

    I. Applicable Environments

    BGP has many route attributes. You can change the route selection policies using these attributes.

    II. Preconfigured Tasks

    Before configuring BGP route selection policies, you need to complete the following tasks: z Configuring the network layer addresses of the interface to keep the network

    layers of the adjacent nodes reachable z Configuring basic BGP functions

    III. Data Preparations

    To configure BGP route selection policies, you need the following data.

    No. Data

    1 The protocol preference of the BGP

    2 The Local_Pref value

    3 The MED value

    IV. Configuration Procedures

    No. Procedure

    1 Configuring the BGP preference

    2 Configuring the default Local_Pref attribute

    3 Configuring the MED attribute

    4 Configuring the Next_Hop attribute

    5 Configuring the AS_Path attribute

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-29

    6.4.2 Configuring the BGP Preference

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the BGP preference.

    preference external internal local

    preference route-policy route-policy-name

    BGP has three types of routes: z routes learned from external peers (EBGP) z routes learned from internal peers (IBGP) z routes originated locally (Local Originated)

    Using the preference command, you can set the precedence of these three types of routes.

    Using the preference route-policy command, you can apply route policies and set preference for routes meeting conditions. For routes which do not match the conditions, the system uses the default preference.

    Note: At present, the NE20 does not apply route policies to configure the preference of BGP protocol on the peer through the peer route-policy command.

    6.4.3 Configuring the Default Local Pref Attribute

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the default Local_Pref attribute of the local router.

    default local-preference preference-value

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-30

    6.4.4 Configuring the MED Attributes

    I. Configuring the Default MED Vaule of the Local Router Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the default MED value. default med med-value

    II. Comparing the MED Values of the Routes from Different ASs

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Compare the MED values of the routes from different ASs. compare-different-as-med

    In general, the BGP router only compares the MED values of the routes from a same AS (different peers). After this command is configured, you can allow BGP to compare the MED values of the routes from different ASs.

    III. Configuring Disposal Method When the MED Value Is Lost

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the MED value as the maximum when it is lost bestroute med-none-as-maximum

    After this command is configured, once the MED value is lost, the MED value will be taken as the maximum value during BGP routing. Otherwise, the MED is taken as 0.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-31

    IV. Comparing the MED Values of the Routes In a Confederation

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Compare the MED values of the routes in a confederation. bestroute med-confederation

    6.4.5 Configuring the Next_Hop Attribute

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure its own address as the next hop for route advertisement.

    peer { ip-address | group-name } next-hop-local

    In some networking environments, to ensure that the IBGP neighbors can find the correct next hop, you can configure the next hop address as its own address when advertising routes to IBGP peers.

    Note: If BGP load sharing is configured, the local router changes the next hop address as its own address when it advertises routes to IBGP peer groups, no matter whether the peer next-hop-local command is configured.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-32

    6.4.6 Configuring the AS_Path Attribute

    I. Allowing Repetitive Local AS Numbers Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Allow repetitive local AS numbers.

    peer { ip-address | group-name } allow-as-loop [ number ]

    In general, BGP checks the AS_Path attribute of the routes sent from the peers. If the local AS number already exists, BGP ignores this route to avoid route loops.

    In special cases, you can allow the AS_Path attribute of the routes sent from the peers to contain the local AS number using this command. You can also configure the repetitive times of the local AS numbers.

    II. Configuring the AS_Path Attribute Not as One of the Route Selection Rules

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the AS_Path attribute not as one of the route selection rules.

    bestroute as-path-neglect

    III. Configuring Fake AS Number

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Configure fake AS number. peer { ip-address | group-name } fake-as as-number

    You can hide the actual AS number using this command. The EBGP peers in other ASs only see this fake AS number.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-33

    Note: This command only applies to EBGP peers.

    IV. Subsituting the AS Number in the AS_Path Attribute

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Substitute the AS number in the AS_Path attribute.

    peer { ip-address | group-name } substitute-as

    After this command is configured, if the AS_Path attribute contains the AS number of the peer, you can substitute the local AS number for that number before advertisement.

    Note: This command can cause route loops. Use this command with caution.

    V. Configuring the AS_Path Attribute to Carry Only the Public AS Number

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the AS_Path attribute to carry only the public AS number.

    peer { ip-address | group-name } public-as-only

    In general, BGP carries an AS number (either public or private) when it advertises routes. In some cases, the private AS number needs not be transmitted. Then, you can configure the AS_Path attribute to carry only the public AS number using this command.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-34

    6.5 Adjusting and Optimizing BGP Networks

    6.5.1 Establishing the Configuration Task

    I. Applicable Environments 1) BGP timers

    After a BGP connection is created between peers, they periodically send Keepalive messages to each other. This prevents the routers from regarding the BGP connection is closed. If a router does not receive any Keepalive message or any kinds of packets from the peer within the specified hold-time, the BGP connection is regarded as closed.

    When a router creates a BGP connection with its peer, they need negotiation. The hold time of the negotiation is the smaller one between the hold time of the BGP router and that of its peer. If the negotiation result is 0, no Keepalive message is transmitted and the hold-time times out is not detected. 2) Resetting BGP connections

    After changing BGP policies or protocols, you must reset the current BGP connection to validate the new configuration. The BGP connection is thus interrupted temporarily.

    In NE20 implementation, BGP supports the route-refresh capability. When the policies are changed, the system refreshes the BGP routing table automatically. Hence the BGP connections are not interrupted.

    If there are routers not supporting route-refresh in the network, you can configure the peer keep-all-routes command to save all route refreshment locally. Then, you can execute the refresh bgp command to soft reset the BGP connections manually. 3) BGP authentication

    BGP uses TCP as the transport layer protocol. To enhance BGP security, you can perform MD5 authentication when TCP connections are created. However, the MD5 authentication does not authenticate BGP packets. Instead, it configure MD5 authentication password for TCP connections, and the authentication is implemented by TCP. If the authentication fails, TCP connections are not established.

    II. Preconfigured Tasks

    Before adjusting BGP timers, you need to configure basic BGP functions.

    III. Data Preparations

    The following data is necessary for configuring BGP timers and authentication:

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-35

    No. Data

    1 BGP timers

    2 The interval of sending update packets

    3 MD5 authentication password

    IV. Configuration Procedures

    No. Procedure

    1 Configuring BGP timers

    2 Configuring the interval of sending update packets

    3 Configuring to soft reset BGP

    4 Enabling to quick reset EBGP connections

    5 Configuring MD5 authentication

    6 Configuring the maximum number of equal-cost routes

    6.5.2 Configuring BGP Timers

    I. Configuring Global Timers Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Configure BGP timers. timer keepalive keepalive-interval hold holdtime-interval

    II. Configuring Peer Timers

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Configure the interval of sending keepalive messages and the hold time of the peer or the peer group.

    peer { ip-address | group-name } timer keepalive keepalive-interval hold holdtime-interval

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-36

    The reasonable maximum interval of sending a keepalive message is one third of the hold-time and is not less than one second. Thus, if the hold-time is not configured as 0, it is three seconds at least.

    The priority of the peer timers is higher than that of the global timers.

    6.5.3 Configuring the Interval of Sending Update Packets

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Configure the interval of sending update packets.

    peer { ip-address | group-name } route-update-interval interval

    6.5.4 Configuring to Soft Reset BGP

    I. Enabling the Route-refresh Capability Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enable the route-refresh capability.

    peer { ip-address | group-name } capability-advertise { route-refresh | conventional }

    If the route-refresh capability is enabled on all BGP routers, the local router advertises route-refresh messages to its peer if the BGP route policies change. The peer receiving this message sends its routing information to the local router again. In this way, the BGP routing table is updated dynamically and the new policies are applied without interrupting the BGP connections.

    II. Keeping All the Route Updates of the Peers

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Keep all the route updates of the peer.

    peer { ip-address | group-name } keep-all-routes

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-37

    After this command is configured, all route updates of the specified peer are kept no matter whether the filtering policies are used. When BGP connections are soft reset, this information can be used to generate BGP routes.

    III. Soft Resetting BGP Connections

    Step Action Command

    1 Soft reset BGP connections. refresh bgp { ip-address | all | external | group group-name | internal } { export | import }

    Note: Execute the refresh bgp command in user view.

    6.5.5 Enabling to Quick Reset EBGP Connections

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enable to quick reset EBGP connections.

    ebgp-interface-sensitive

    After this function is enabled, BGP can sense the EBGP link failures quickly and reset the BGP connections on the interface immediately.

    6.5.6 Configuring MD5 Authentication

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Configure MD5 authentication password.

    peer { ip-address | group-name } password { cipher | simple } password

    Note: When this command is configured in BGP view, the extensions on VPNv4 of MP-BGP are also valid, because they use the same TCP connections.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-38

    6.5.7 Configuring the Maximum Number of Equal-Cost Routes

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the maximum number of equal-cost routes.

    maximum load-balance maximum-limit

    6.6 Building Large-Sized BGP Networks

    6.6.1 Establishing the Configuration Task

    I. Applicable Environments

    In a large-sized BGP network, there are many peers. This is not convenient for configuration and maintenance. The peer groups can be used to simplify the management and improve the efficiency of route advertisement. According to the AS where the peers reside, you can divide peer groups into IBGP peer groups and EBGP peer groups. For EBGP peer groups, you can divide them into pure EBGP peer groups and mixed EBGP peer groups according to whether the included peers are in the same external AS.

    The community can also simplify the management of the route policies, but it has a wider management scope. It can control route policies of multiple BGP routers.

    To ensure the connectivity between IBGP peers inside an AS, you need to establish a full connection among IBGP peers. When there are many IBGP peers, it costs a lot to establish a full connection network. The route reflector and the confederation can be used to solve this problem. In a large sized AS, the route reflector and the confederation can be used at the same time.

    II. Preconfigured Tasks

    Before building a large sized BGP network, you need to complete the following tasks: z Keeping the network layers of the adjacent nodes reachable z Enabling BGP and configuring the router ID

    III. Data Preparations

    To configure BGP peer groups, you need the following data.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-39

    No. Data

    1 Type, name of the peer group and the included peers

    2 Name of the route policy to be applied if the community is used

    3 The roles of each router (client, non-client) if the route reflector is used

    4 The confederation ID and the sub-AS number if the confederation is used

    IV. Configuration Procedures

    No. Procedure

    1 Creating a BGP peer group

    2 Configuring the BGP community

    3 Configuring the BGP route reflector

    4 Configuring the BGP confederation

    6.6.2 Configuring a BGP Peer Group

    I. Creating an IBGP Peer Group Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Create an IBGP peer group. group group-name [ internal ]

    4 Add a peer to this peer group. peer ip-address group group-name

    You can add multiple peers to the peer group by repeating step 4. The system creates each peer in BGP view automatically, and sets its AS number to the local AS number.

    You need not to specify the AS number when creating an IBGP peer group.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-40

    II. Creating a Pure EBGP Peer Group

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Create an EBGP peer group. group group-name external

    4 Configure the AS number for this peer group. peer group-name as-number as-number

    5 Add peers to this peer group. peer ip-address group group-name

    You can add multiple peers to the peer group by repeating step 5. The system creates each peer in BGP view automatically, and sets its AS number to the local AS number.

    If there are already peers in this peer group, you can neither change the AS number of this peer group nor delete the specified AS number using the undo command.

    III. Creating a Mixed EBGP Peer Group

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Create an EBGP peer group. group group-name external

    4 Create each peer and configure its AS number. peer ip-address as-number as-number

    5 Add peers to the peer group. peer ip-address group group-name

    You can add multiple peers to the peer group by repeating step 4 and step 5.

    In a mixed EBGP peer group, you need to specify the AS number of each peer respectively.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-41

    6.6.3 Configuring the BGP Community

    I. Confiugring to Advertise the Community Attribute to Peers Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure to advertise the community attribute to peers.

    peer { ip-address | group-name } advertise-community

    Or configure to advertise the extended community attribute to the peer group.

    peer { ip-address | group-name } advertise-ext-community

    II. Applying Route Policies to the Advertised Routing Information

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the export route policies.

    peer { ip-address | group-name } route-policy route-policy-name export

    Note: When configuring the BGP community, use the route policies to define the specific community attribute. Then, apply these route policies when advertising the routing information. For route policies configurations,, refer to Chapter 10 Route Policy Configuration.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-42

    6.6.4 Configuring the BGP Route Reflector

    I. Configuring the Route Reflector and Specifying the Clients Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the route reflector and its clients.

    peer { ip-address | group-name } reflect-client

    The router configured with this command serves as the route reflector. Besides, this command specifies the peers that serve as its clients.

    II. Enabling the Route Reflection Between Clients

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Enable the route reflection between clients.

    reflect between-clients

    If the clients of the route reflector are fully connected, you can use the undo reflect between-clients command to disable the route reflection between clients. This reduces a lot of cost.

    III. Configuring the Cluster ID of the Route Reflector

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Enter BGP IPv4 view. ipv4-family unicast

    4 Configure the cluster ID of the route reflector.

    reflector cluster-id cluster-id

    When there are multiple route reflectors in a cluster, you can configure all the route reflectors in this cluster with the same cluster-ID using this command. This avoids route loops.

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-43

    6.6.5 Configuring the BGP Confederation

    I. Configuring Basic BGP Confederation Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Configure the confederation ID.

    confederation id as-number

    4 Configure the other neighboring ASs in the confederation.

    confederation peer-as as-number&

    One confederation includes up to 32 sub-ASs. The as-number used while configuring the sub-AS that belongs to a confederation is valid for that confederation.

    II. Configuring the Compatibility of the Confederation

    Step Action Command

    1 Enter system view. system-view

    2 Enter BGP view. bgp as-number

    3 Configure the compatibility of the confederation.

    confederation nonstandard

    If some routers implement the confederation which does not comply with the RFC standard, you can use this command to make the standard devices compatible with the nonstandard devices.

    6.7 Maintaining BGP

    6.7.1 Displaying BGP

    After the above configuration, execute the display command in any view to display the running of the BGP configuration, and to verify the effect of the configuration.

    Table 6-2 Displaying the running of BGP

    Action Command

    View BGP peer groups. display bgp group [ group-name ]

    View the route information advertised by BGP. display bgp network

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-44

    Action Command

    View AS paths. display bgp paths [ as-regular-expression ]

    View BGP peers. display bgp peer [ ip-address ] [ verbose ]

    View BGP routing tables. display bgp routing-table [ network-number ] [ mask-length ] [ longer-prefixes ]

    View the paths matching the specified AS path ACL.

    display bgp routing-table as-path-filter as-path-filter-number

    View CIDRs. display bgp routing-table cidr

    View the routing information of the specified BGP community.

    display bgp routing-table community [ aa:nn | no-export-subconfed | no-advertise | no-export ] [ whole-match ]

    View the routes matching the specified BGP community list.

    display bgp routing-table community-filter community-filter-number

    View the dampened BGP routes. display bgp routing-table dampened

    View the BGP dampening parameters.

    display bgp routing-table dampening parameter

    View the routes with different origin ASs.

    display bgp routing-table different-origin-as

    View route flap statistics.

    display bgp routing-table flap-info [ { regular-expression as-regular-expression } | { as-path-filter as-path-filter-number } | { network-address [ mask [ longer-match ] ] }]

    View the routing information advertised or received by BGP peers.

    display bgp routing-table peer ip-address { advertised-routes | received-routes }

    View the routing information matching the AS regular expression.

    display bgp routing-tabel regular-expression as-regular-expression

    6.7.2 Resetting BGP Connections

    When the BGP protocol or its route policies change, you need to reset BGP connections to make the new configurations take effect. Perform the following configurations in user view.

    Table 6-3 Resetting BGP connections

    Action Command

    Reset all BGP connections. reset bgp all

    Reset the BGP connection with the specified AS. reset bgp as-number

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-45

    Action Command

    Reset the BGP connection with the specified peer. reset bgp ip-address

    Reset all EBGP connections. reset bgp external

    Reset the BGP connection with the specified peer group. reset bgp group group-name

    Reset all IBGP connections. reset bgp internal

    6.7.3 Clearing BGP Information

    Execute the reset command in user view to clear BGP related information.

    Table 6-4 Clearing BGP information

    Action Command

    Clear route flap statistics. reset bgp flap-info [ regexp regrexp | as-path-filter as-path-filter-number | network-address [ mask ] ]

    Clear route dampening information and release the dampened routes.

    reset bgp dampening [ network-address [ mask ] ]

    6.7.4 Debugging BGP

    Execute the debugging command in user view to debug BGP.

    Table 6-5 Debugging BGP

    Action Command

    Enable all BGP debugging. debugging bgp all

    Enable all BGP event debugging. debugging bgp event

    Enable all BGP packet debugging. debugging bgp { keepalive | open | packet | route-refresh } [ receive | send ] [ verbose ]

    Enable BGP update packet debugging.

    debugging bgp update [ acl acl-number | label-route | vpnv4 | vpn-instance vpn-instance-name ] [ peer { ip-address | group-name } | ip-prefix ip-prefix-name ] [ receive | send ] [ verbose ]

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-46

    6.8 Configuration Examples

    6.8.1 Configuring Basic BGP Functions

    I. Networking Requirements

    As shown in Figure 6-14, all routers are BGP routers. EBGP connection is established between Router A and Router B. A full IBGP connection is created among Router B, Router C and Router D.

    II. Networking Diagram

    Ethernet1/0/08.1.1.1/8

    POS2/0/0200.1.1.2/24

    RouterAAS65008 POS2/0/0

    200.1.1.1/24

    POS3/0/09.1.3.2/24

    POS3/0/09.1.3.1/24

    POS1/0/09.1.1.1/24 POS1/0/0

    9.1.1.2/24

    POS2/0/09.1.2.2/24

    POS2/0/09.1.2.1/24

    RouterB

    AS65009

    RouterD

    RouterC

    Figure 6-14 Networking diagram of basic BGP configurations

    III. Configuration Procedure 1) Configuring the IP addresses of the interfaces (omitted) 2) Configuring IBGP connections

    # Configure Router B.

    [RouterB] bgp 65009

    [RouterB-bgp] router-id 2.2.2.2

    [RouterB-bgp] peer 9.1.1.2 as-number 65009

    [RouterB-bgp] peer 9.1.3.2 as-number 65009

    # Configure Router C.

    [RouterC] bgp 65009

    [RouterC-bgp] router-id 3.3.3.3

    [RouterC-bgp] peer 9.1.3.1 as-number 65009

    [RouterC-bgp] peer 9.1.2.2 as-number 65009

    # Configure Router D.

    [RouterD] bgp 65009

    [RouterD-bgp] router-id 4.4.4.4

    [RouterD-bgp] peer 9.1.1.1 as-number 65009

    [RouterD-bgp] peer 9.1.2.1 as-number 65009

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-47

    3) Configuring EBGP

    # Configure Router A.

    [RouterA] bgp 65008

    [RouterA-bgp] router-id 1.1.1.1

    [RouterA-bgp] peer 200.1.1.1 as-number 65009

    # Configure Router B.

    [RouterB] bgp 65009

    [RouterB-bgp] peer 200.1.1.2 as-number 65008

    # Display the connection status of the BGP peers.

    [RouterB] 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

    9.1.3.2 4 65009 56 56 0 00:40:54 Established 0

    9.1.1.2 4 65009 49 62 0 00:44:58 Established 0

    200.1.1.2 4 65008 49 65 0 00:44:03 Established 1

    You can see that Router B has established BGP connections with other routers.

    # Display the routing table of Router A. [RouterA] display bgp routing-table

    Total Number of Routes: 1

    BGP Local router ID is 1.1.1.1

    Status codes: * - valid, > - best, d - damped,

    h - history, i - internal, s - suppressed, S - Stale

    Origin : i - IGP, e - EGP, ? - incomplete

    Network NextHop MED LocPrf PrefVal Path/Ogn

    *> 8.0.0.0 0.0.0.0 0 0 i

    # Display the routing table of Router B.

    [RouterB] display bgp routing-table

    Total Number of Routes: 1

    BGP Local router ID is 2.2.2.2

    Status codes: * - valid, > - best, d - damped,

  • Operation Manual - IP Routing Volume Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

    Huawei Technologies Proprietary

    6-48

    h - history, i - internal, s - suppressed, S - Stale

    Origin : i - IGP, e - EGP, ? - incomplete

    Network NextHop MED LocPrf PrefVal Path/Ogn

    *> 8.0.0.0 200.1.1.2 0 0 65008i

    # Display the routing table of Router C.

    [RouterC] display bgp routing-table

    Total Number of Routes: 1

    BGP Local router ID is 3.3.3.3

    Status codes: * - valid, > - best, d - damped,

    h - history, i - internal, s - suppressed, S - Stale

    Origin : i - IGP, e - EGP, ? - incomplete

    Network NextHop MED LocPrf PrefVal Path/Ogn

    i 8.0.0.0 200.1.1.2 0 100 0 65008i

    Note: From the routing table, you can see that Router A does not learn any AS65009 internal routes. Ro