Você está na página 1de 79

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:
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).
It uses TCP as the transport layer protocol (the port number is 179) to enhance
the reliability of the protocol.
Supports Classless Inter-Domain Routing (CIDR).
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.
Eliminates route loops completely by adding AS path information to BGP routes
It provides abundant route policies to implement flexible filtering and route
selection.
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:
Interior BGP (IBGP)
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:
Marker: used for calculation in BGP authentication. If there is no authentication,
it is all 1s.
Length: indicates the total length of the BGP message (including packet header)
in bytes.
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 Identifier
Opt Parm Len
Optional Parameters
0 7 15 31
Version
My Autonomous System
Hold 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
Version: indicates BGP version number. For BGP-4, it is 4.
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.
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.
BGP Identifier: identifies a BGP router. It is in the form of an IP address.
Opt Parm Len (Optional Parameters Length): indicates the length of the
Optional Parameters field. The value 0 indicates no optional parameters.
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:
Unfeasible Routes Length: indicates the length of the Withdrawn Routes field in
bytes. The value 0 represents no Withdrawn Routes field.
Withdrawn Routes: contains a list of unfeasible routes.
Total Path Attribute Length: indicates the length of the Path Attributes field in
bytes. The value 0 represents no Path Attributes or NLRI field.
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).
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 Subcode
0 7 15 31
Error Code
Data

Figure 6-4 The format of Notification messages
The main fields are explained as follows:
Error Code: specifies the error type
Error Subcode: specifies the details of the error type
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:
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.
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.
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.
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:
IGP: has the highest priority. For example, the routes generated by the network
command, their Origin attribute is IGP.
EGP: has the second highest priority. For example, the routes generated
through EGP, their Origin attribute is EGP.
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)
AS20
AS40
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.
AS100
8.0.0.0
AS200
1.1.2.1/24
D=8.0.0.0
Next_Hop=1.1.1.1
1.1.1.1/24
EBGP
EBGP
D=8.0.0.0
Next_Hop=1.1.2.1
IBGP
D=8.0.0.0
Next_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.0
Next_Hop=2.1.1.1
MED=0
RouterA
D=9.0.0.0
Next_Hop=3.1.1.1
MEd=100
AS10
2.1.1.1
EBGP
MED=0
RouterB
IBGP
RouterD
9.0.0.0
IBGP
RouterC
MED=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.0
Next_Hop=2.1.1.1
Local_Pref=100
RouterA
> D=8.0.0.0
Next_Hop=3.1.1.1
Local_Pref=200
AS10
2.1.1.1
EBGP
Local_Pref-100
RouterB
IBGP
RouterD
8.0.0.0
IBGP
RouterC
Local_Pref=200
EBGP
3.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:
Internet: By default, all routes belong to the Internet community. The routes with
this attribute can be advertised to all BGP peers.
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.
No_Advertise: When a router receives a route with this attribute, it does not
advertise the route to other BGP peers.
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:
discarding the routes with the unreachable Next_Hop
preferring the route with the highest Local_Pref
preferring the route originated by the local router
preferring the route with the shortest AS_Path
selecting in turn the routes whose Origin can be IGP, EGP or Incomplete
preferring the route with the lowest MED
preferring the route learned from EBGP
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-10
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)
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:
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.
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:
BGP only performs load sharing on the routes with the same AS_Path attribute.
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:
When there are multiple valid routes, the BGP speaker only advertises the
optimum route to its peer.
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
The BGP speaker advertises the routes obtained from EBGP to all of its BGP
peers (including EBGP peers and IBGP peers).
The BGP speaker does not advertise the routes obtained from IBGP to its IBGP
peers.
The BGP speaker advertises the routes obtained from IBGP to its EBGP peers
(when BGP and IGP are not synchronous).
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
AS10
EBGP
RouterB
IGP
IGP
RouterC
AS20
RouterD
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:
The local AS is not a transitive AS (The AS20 in Figure 6-9 is a transitive AS).
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
Route
Reflector
IBGP
IBGP IBGP
IBGP IBGP
Cluster
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.
Router
Reflector1
Router
Reflector2
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.
AS65002
AS65003
AS65001
AS100
AS200
EBGP
EBGP
EBGP IBGP
IBGP
IBGP

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:
MP_REACH_NLRI (Multiprotocol Reachable NLRI): used to advertise the
reachable routes and the next hop information.
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:
RFC1771: A Border Gateway Protocol 4 (BGP-4)
RFC2858: Multiprotocol Extensions for BGP-4
RFC3392: Capabilities Advertisement with BGP-4
RFC2918: Route Refresh Capability for BGP-4
RFC2439: BGP Route Flap Damping
RFC1997: BGP Communities Attribute
RFC2796: BGP Route Reflection
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:
The BGP and MP-BGP have no strict distinction in this section. For the suitable
conditions of the command, refer to the related view.
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:
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:
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.
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:
Configuring the network layer addresses of the interface to keep the network
layers of the adjacent nodes reachable
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:
routes learned from external peers (EBGP)
routes learned from internal peers (IBGP)
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:
Keeping the network layers of the adjacent nodes reachable
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&<1-32>

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/0
8.1.1.1/8
POS2/0/0
200.1.1.2/24
RouterA
AS65008 POS2/0/0
200.1.1.1/24
POS3/0/0
9.1.3.2/24
POS3/0/0
9.1.3.1/24
POS1/0/0
9.1.1.1/24
POS1/0/0
9.1.1.2/24
POS2/0/0
9.1.2.2/24
POS2/0/0
9.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. Router C has learned the route to the destination 8.0.0.0 in AS65008,
but the next hop 200.1.1.2 is unreachable. Thus, this route is not valid.

4) Configuring BGP to import directly-connected routes
# Configure Router B.
[RouterA] bgp 65008
[RouterA-bgp] ipv4-family unicast
[RouterA-bgp-af-ipv4] import-route direct
# Display the routing table of Router A.
[RouterA] display bgp routing-table

Total Number of Routes: 7

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

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

Huawei Technologies Proprietary
6-49
*> 8.0.0.0 0.0.0.0 0 0 i
*> 9.1.1.0/24 200.1.1.1 0 0 65009?
*> 9.1.1.2/32 200.1.1.1 0 0 65009?
*> 9.1.3.0/24 200.1.1.1 0 0 65009?
*> 9.1.3.2/32 200.1.1.1 0 0 65009?
* 200.1.1.0 200.1.1.1 0 0 65009?
* 200.1.1.2/32 200.1.1.1 0 0 65009?
# Display the BGP routing table of Router C.
[RouterC] display bgp routing-table

Total Number of Routes: 7

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
*>i 9.1.1.0/24 9.1.3.1 0 100 0 ?
*>i 9.1.1.2/32 9.1.3.1 0 100 0 ?
* i 9.1.3.0/24 9.1.3.1 0 100 0 ?
* i 9.1.3.2/32 9.1.3.1 0 100 0 ?
*>i 200.1.1.0 9.1.3.1 0 100 0 ?
*>i 200.1.1.2/32 9.1.3.1 0 100 0 ?
You can see that the route to 8.0.0.0 becomes valid, and the next hop is the address
of Router A.
# Verify the configuration using the ping command.
[RouterC] ping 8.1.1.1
PING 8.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 8.1.1.1: bytes=56 Sequence=1 ttl=254 time=31 ms
Reply from 8.1.1.1: bytes=56 Sequence=2 ttl=254 time=47 ms
Reply from 8.1.1.1: bytes=56 Sequence=3 ttl=254 time=31 ms
Reply from 8.1.1.1: bytes=56 Sequence=4 ttl=254 time=16 ms
Reply from 8.1.1.1: bytes=56 Sequence=5 ttl=254 time=31 ms

--- 8.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 16/31/47 ms
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-50

[RouterC]
IV. Configuration Files
1) Configuration file of Router A
#
sysname RouterA
#
interface Ethernet1/0/0
ip address 8.1.1.1 255.0.0.0
#
interface Pos2/0/0
link-protocol ppp
ip address 200.1.1.2 255.255.255.0
#
bgp 65008
router-id 1.1.1.1
peer 200.1.1.1 as-number 65009
#
ipv4-family unicast
network 8.0.0.0
peer 200.1.1.1 enable
quit
#
return
2) Configuration file of Router B
#
sysname RouterB
#
interface Pos1/0/0
link-protocol ppp
ip address 9.1.1.1 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
ip address 200.1.1.1 255.255.255.0
#
interface Pos3/0/0
link-protocol ppp
ip address 9.1.3.1 255.255.255.0
#
bgp 65009
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-51
router-id 2.2.2.2
peer 9.1.1.2 as-number 65009
peer 200.1.1.2 as-number 65008
peer 9.1.3.2 as-number 65009
#
ipv4-family unicast
import-route direct
peer 9.1.1.2 enable
peer 200.1.1.2 enable
peer 9.1.3.2 enable
quit
#
return
3) Configuration file of Router C
#
sysname RouterC
#
interface Pos2/0/0
link-protocol ppp
ip address 9.1.2.1 255.255.255.0
#
interface Pos3/0/0
link-protocol ppp
ip address 9.1.3.2 255.255.255.0
#
bgp 65009
router-id 3.3.3.3
peer 9.1.2.2 as-number 65009
peer 9.1.3.1 as-number 65009
#
ipv4-family unicast
peer 9.1.2.2 enable
peer 9.1.3.1 enable
quit
#
return
4) Configuration file of Router D
#
sysname RouterD
#
interface Pos1/0/0
link-protocol ppp
ip address 9.1.1.2 255.255.255.0
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-52
#
interface Pos2/0/1
link-protocol ppp
ip address 9.1.2.2 255.255.255.0
#
bgp 65009
router-id 4.4.4.4
peer 9.1.1.1 as-number 65009
peer 9.1.2.1 as-number 65009
#
ipv4-family unicast
peer 9.1.1.1 enable
peer 9.1.2.1 enable
quit
#
return
6.8.2 Configuring BGP to Interact with IGP
I. Networking Requirements
As shown in Figure 6-15, OSPF is used inside the AS65009 as the IGP. EBGP is
used between Router A and Router B. Router C is a non-BGP router inside the AS.
II. Networking Diagram
Ethernet1/0/0
8.1.1.1/24
POS2/0/0
3.1.1.2/24
RouterA
AS 65008
POS2/0/0
3.1.1.1/24
RouterB
POS1/0/0
9.1.1.1/24
POS1/0/0
9.1.1.2/24
Ethernet1/0/0
9.1.2.1/24
RouterC
AS 65009

Figure 6-15 Networking diagram of configuring the interaction between BGP and
IGP
III. Configuration Procedures
1) Configuring the IP addresses of the interfaces (omitted)
2) Configuring OSPF (omitted)
3) Configuring EBGP connections
# Configure Router A.
[RouterA] bgp 65008
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-53
[RouterA-bgp] router-id 1.1.1.1
[RouterA-bgp] peer 3.1.1.1 as-number 65009
# Configure Router B.
[RouterB] bgp 65009
[RouterB-bgp] peer 3.1.1.2 as-number 65008
4) Configuring BGP to interact with IGP
# Configure BGP on Router B to import OSPF routes.
[RouterB] bgp 65009
[RouterB-bgp] ipv4-family unicast
[RouterB-bgp-af-ipv4] import-route ospf 1
# Display the routing table of Router A.
[RouterA] display bgp routing-table

Total Number of Routes: 3

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.1.1.0/24 0.0.0.0 0 0 i
*> 9.1.1.0/24 3.1.1.1 0 0 65009?
*> 9.1.2.0/24 3.1.1.1 1563 0 65009?
# Configure OSPF on Router B to import BGP routes.
[RouterB] ospf
[RouterB-ospf-1] import-route bgp
# Display the routing table of Router C.
[RouterC] display ip routing-table
Routing Tables: Public
Destinations : 8 Routes : 8

Destination/Mask Proto Pre Cost NextHop Interface

8.1.1.0/24 O_ASE 150 10 9.1.1.1 Pos1/0/0
9.1.1.0/24 Direct 0 0 9.1.1.2 Pos1/0/0
9.1.1.1/32 Direct 0 0 9.1.1.1 Pos1/0/0
9.1.1.2/32 Direct 0 0 127.0.0.1 InLoopBack0
9.1.2.0/24 Direct 0 0 9.1.2.1 Ethernet1/0/0
9.1.2.1/32 Direct 0 0 127.0.0.1 InLoopBack0
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-54
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoopBack0

[Quidway]
5) Configuring automatic route summary
# Configure Router B.
[RouterB] bgp 65009
[RouterB-bgp] ipv4-family unicast
[RouterB-bgp-af-ipv4] summary automatic
# Display the routing table of Router A.
[RouterA] display bgp routing-table

Total Number of Routes: 2

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.1.1.0/24 0.0.0.0 0 0 i
*> 9.0.0.0 3.1.1.1 0 65009?
[RouterA]
# Verify the configuration using the ping command.
[RouterA] ping -a 8.1.1.1 9.1.2.1
PING 9.1.2.1: 56 data bytes, press CTRL_C to break
Reply from 9.1.2.1: bytes=56 Sequence=1 ttl=254 time=15 ms
Reply from 9.1.2.1: bytes=56 Sequence=2 ttl=254 time=31 ms
Reply from 9.1.2.1: bytes=56 Sequence=3 ttl=254 time=47 ms
Reply from 9.1.2.1: bytes=56 Sequence=4 ttl=254 time=46 ms
Reply from 9.1.2.1: bytes=56 Sequence=5 ttl=254 time=47 ms

--- 9.1.2.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 15/37/47 ms

[RouterA]
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-55
IV. Configuration Files
1) Configuration file of Router A
#
sysname RouterA
#
interface Ethernet1/0/0
ip address 8.1.1.1 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
ip address 3.1.1.2 255.255.255.0
#
bgp 65008
router-id 1.1.1.1
peer 3.1.1.1 as-number 65009
#
ipv4-family unicast
network 8.1.1.0 255.255.255.0
peer 3.1.1.1 enable
quit
#
return
2) Configuration file of Router B
#
sysname RouterB
#
interface Pos1/0/0
link-protocol ppp
ip address 9.1.1.1 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
ip address 3.1.1.1 255.255.255.0
#
bgp 65009
router-id 2.2.2.2
peer 3.1.1.2 as-number 65008
#
ipv4-family unicast
summary automatic
default-route imported
import-route ospf 1
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-56
peer 3.1.1.2 enable
quit
#
ospf 1
import-route bgp
area 0.0.0.0
network 9.1.1.0 0.0.0.255
return
3) Configuration file of Router C
#
sysname RouterC
#
interface Ethernet1/0/0
ip address 9.1.2.1 255.255.255.0
#
interface Pos1/0/0
link-protocol ppp
ip address 9.1.1.2 255.255.255.0
#
ospf 1
area 0.0.0.0
network 9.1.1.0 0.0.0.255
network 9.1.2.0 0.0.0.255
#
return
6.8.3 Configuring BGP Load Balancing and MED Attribute
I. Networking Requirements
This section illustrates how to configure BGP load balancing, and how to affect BGP
route selection using the MED attribute.
All routers are configured with BGP. Router A is in AS65008. Both Router B and
Router C are in AS65009. EBGP runs among Router A, Router B and Router C.
IBGP runs between Router B and Router C.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-57
II. Networking Diagram
Ethernet3/0/0
8.1.1.1/8
POS1/0/0
200.1.1.2/24
POS2/0/0
200.1.2.2/24
POS2/0/0
200.1.1.1/24
RouterB
Ethernet1/0/0
9.1.1.1/24
AS 65009
Ethernet1/0/0
9.1.1.2/24
RouterC
POS2/0/0
200.1.2.1/24
RouterA
AS 65008
EBGP
EBGP
IBGP

Figure 6-16 Networking diagram of BGP route selection
III. Configuration Procedures
1) Configuring the IP addresses of the interfaces (omitted)
2) Configuring BGP connections
# Configure Router A.
[RouterA] bgp 65008
[RouterA-bgp] router-id 1.1.1.1
[RouterA-bgp] peer 200.1.1.1 as-number 65009
[RouterA-bgp] peer 200.1.2.1 as-number 65009
[RouterA-bgp] ipv4-family unicast
[RouterA-bgp-af-ipv4] network 8.0.0.0 255.0.0.0
[RouterA-bgp-af-ipv4] quit
# Configure Router B.
[RouterB] bgp 65009
[RouterB-bgp] router-id 2.2.2.2
[RouterB-bgp] peer 200.1.1.2 as-number 65008
[RouterB-bgp] peer 9.1.1.1 as-number 65009
[RouterB-bgp] ipv4-family unicast
[RouterB-bgp-af-ipv4] peer 9.1.1.1 next-hop-local
[RouterB-bgp-af-ipv4] network 9.1.1.0 255.255.255.0
[RouterB-bgp-af-ipv4] quit
# Configure Router C.
[RouterC] bgp 65009
[RouterC-bgp] router-id 3.3.3.3
[RouterC-bgp] peer 200.1.2.2 as-number 65008
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-58
[RouterC-bgp] peer 9.1.1.1 as-number 65009
[RouterC-bgp] ipv4-family unicast
[RouterC-bgp-af-ipv4] peer 9.1.1.1 next-hop-local
[RouterC-bgp-af-ipv4] network 9.1.1.0 255.255.255.0
[RouterC-bgp-af-ipv4] quit
# Display the routing table of Router A.
[RouterA] display bgp routing-table

Total Number of Routes: 3

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
*> 9.1.1.0/24 200.1.1.1 0 0 65009i
* 200.1.2.1 0 0 65009i
As displayed in the routing table, there are two valid routes to the destination
9.1.1.0/24. The route whose next hop is 200.1.1.1 is the optimum route (because the
router ID of Router B is smaller).
3) Configuring load balancing
# Configure Router A.
[RouterA] bgp 65008
[RouterA-bgp] ipv4-family unicast
[RouterA-bgp-af-ipv4] maximum load-balancing 2
# Display the routing table of Router A.
[RouterA] display bgp routing-table

Total Number of Routes: 3

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
*> 9.1.1.0/24 200.1.1.1 0 0 65009i
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-59
*> 200.1.2.1 0 0 65009i
As displayed in the routing table, the BGP route 9.1.1.0/24 has two next hops. They
are 200.1.1.1 and 200.1.2.1. Both of them are optimum routes.
4) Configuring MED attribute
# Configure the default MED value of Router B.
[RouterB] bgp 65009
[RouterB-bgp] ipv4-family unicast
[RouterB-bgp-af-ipv4] default med 100
# Display the routing table of Router A.
[RouterA] display bgp routing-table

Total Number of Routes: 3

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
*> 9.1.1.0/24 200.1.2.1 0 0 65009i
* 200.1.1.1 100 0 65009i
As displayed in the routing table, the MED of the next hop 200.1.1.1 (Router B) is
100, and that of the next hop 200.1.2.1 is 0. Thus, the route with the smaller MED is
selected.
IV. Configuration Files
1) Configuration file of Router A
#
sysname RouterA
#
interface Ethernet3/0/0
ip address 8.1.1.1 255.0.0.0
#
interface Pos1/0/0
link-protocol ppp
ip address 200.1.1.2 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
ip address 200.1.2.2 255.255.255.0
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-60
#
bgp 65008
router-id 1.1.1.1
peer 200.1.1.1 as-number 65009
peer 200.1.2.1 as-number 65009
#
ipv4-famlily unicast
network 8.0.0.0
maximum load-balancing 2
peer 200.1.1.1 enable
peer 200.1.2.1 enable
quit
#
return
2) Configuration file of Router B
#
sysname RouterB
#
interface Ethernet1/0/0
ip address 9.1.1.1 255.255.255.0
#
interface Pos1/0/0
link-protocol ppp
ip address 200.1.1.1 255.255.255.0
#
bgp 65009
router-id 2.2.2.2
peer 9.1.1.2 as-number 65009
peer 200.1.1.2 as-number 65008
#
ipv4-family unicast
network 9.1.1.0 255.255.255.0
peer 9.1.1.2 enable
peer 9.1.1.2 next-hop-local
quit
#
return
3) Configuration file of Router C
#
sysname RouterC
#
interface Ethernet1/0/0
ip address 9.1.1.2 255.255.255.0
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-61
#
interface Pos2/0/0
link-protocol ppp
ip address 200.1.2.1 255.255.255.0
#
bgp 65009
router-id 3.3.3.3
peer 9.1.1.1 as-number 65009
peer 200.1.2.2 as-number 65008
#
ipv4-family unicast
network 9.1.1.0 255.255.255.0
peer 9.1.1.1 enable
peer 9.1.1.1 next-hop-local
peer 200.1.2.2 enable
quit
#
return
6.8.4 Configuring the BGP Community
I. Networking Requirements
Router B creates EBGP connections with Router A and Router C respectively. You
can configure the No_Export community attribute on Router A. Thus, the routes
advertised from AS10 to AS20 are not advertised to other ASs.
II. Networking Diagram
Ethernet1/0/0
9.1.1.1/24
POS2/0/0
200.1.2.1/24
EBGP
AS 10
RouterA
POS2/0/0
200.1.2.2/24
AS 20
RouterB
POS3/0/0
200.1.3.1/24
EBGP
POS3/0/0
200.1.3.2/24
RouterC
AS 30

Figure 6-17 Networking diagram of the BGP community
III. Configuration Procedures
1) Configuring the IP addresses of the interfaces (omitted)
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-62
2) Configuring EBGP
# Configure Router A.
[RouterA] bgp 10
[RouterA-bgp] router-id 1.1.1.1
[RouterA-bgp] peer 200.1.2.2 as-number 20
[RouterA-bgp] ipv4-family unicast
[RouterA-bgp-af-ipv4] network 9.1.1.0 255.255.255.0
[RouterA-bgp-af-ipv4] quit
# Configure Router B.
[RouterB] bgp 20
[RouterB-bgp] router-id 2.2.2.2
[RouterB-bgp] peer 200.1.2.1 as-number 10
[RouterB-bgp] peer 200.1.3.2 as-number 30
[RouterB-bgp] quit
# Configure Router C.
[RouterC] bgp 30
[RouterC-bgp] router-id 3.3.3.3
[RouterC-bgp] peer 200.1.3.1 as-number 100
[RouterC-bgp] quit
# Display the routing table of Router B.
[RouterB] display bgp routing-table 9.1.1.0

BGP local router ID : 2.2.2.2
Local AS number : 20
Paths: 1 available, 1 best

BGP routing table entry information of 9.1.1.0/24:
From: 200.1.2.1 (1.1.1.1)
Original nexthop: 200.1.2.1
AS-path 10, origin igp, MED 0, pref-val 0, valid, external, best, pre 255
Advertised to such 1 peers:
200.1.3.2
You can see that Router B advertises the received routes to Router C in AS30.
# 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,
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-63
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn

*> 9.1.1.0/24 200.1.3.1 0 20 10i
From the routing table, you can confirm that Router C has learned a route to the
destination 9.1.1.0/24 from Router B.
3) Configuring BGP community attribute
# Configure route policies.
[RouterA] route-policy comm_policy permit node 0
New Sequence of this List !!
[RouterA-route-policy] apply community no-export
[RouterA-route-policy] quit
# Apply route policies.
[RouterA] bgp 10
[RouterA-bgp] ipv4-family unicast
[RouterA-bgp-af-ipv4] peer 200.1.2.2 route-policy comm_policy export
[RouterA-bgp-af-ipv4] peer 200.1.2.2 advertise-community
# Display the routing table of Router B.
[RouterB] display bgp routing-table 9.1.1.0

BGP local router ID : 2.2.2.2
Local AS number : 20
Paths: 1 available, 1 best

BGP routing table entry information of 9.1.1.0/24:
From: 200.1.2.1 (1.1.1.1)
Original nexthop: 200.1.2.1
Community: No-Export
AS-path 10, origin igp, MED 0, pref-val 0, valid, external, best, pre 255
Not advertised to any peers yet

You can see the configured community attribute in the routing table of Router B. At
this time, there are no routes to the destination 9.1.1.0/24 in the routing table of
Router C.
IV. Configuration Files
1) Configuration file of Router A
#
sysname RouterA
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-64
#
interface Ethernet1/0/0
ip address 9.1.1.1 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
ip address 200.1.2.1 255.255.255.0
#
bgp 10
router-id 1.1.1.1
peer 200.1.2.2 as-number 20
#
ipv4-family unicast
network 9.1.1.0 255.255.255.0
peer 200.1.2.2 enable
peer 200.1.2.2 route-policy comm_policy export
peer 200.1.2.2 advertise-community
quit
#
route-policy comm_policy permit node 0
apply community no-export
#
return
2) Configuration file of Router B
#
sysname RouterB
#
interface Pos2/0/0
link-protocol ppp
ip address 200.1.2.2 255.255.255.0
#
interface Pos3/0/0
link-protocol ppp
ip address 200.1.3.1 255.255.255.0
#
bgp 20
router-id 2.2.2.2
peer 200.1.2.1 as-number 10
peer 200.1.3.2 as-number 30
#
ipv4-family unicast
peer 200.1.2.1 enable
peer 200.1.3.2 enable
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-65
quit
#
return
3) Configuration file of Router C
#
sysname RouterC
#
interface Pos3/0/0
link-protocol ppp
ip address 200.1.3.2 255.255.255.0
#
bgp 30
router-id 3.3.3.3
peer 200.1.3.1 as-number 20
#
ipv4-family unicast
peer 200.1.3.1 enable
quit
#
return
6.8.5 Configuring the BGP Route Reflector
I. Networking Requirements
As shown in Figure 6-18, Router A is a non-client. Router B is the route reflector of
Cluster1. Router D and Router E are two clients of Cluster1. Because IBGP
connection is created between Router D and Router E, they do not need route
reflector. Router C is the route reflector of Cluster2. Router F, Router G and Router H
are the clients of Cluster2.
It is required to simplify configuration and management using peer groups.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-66
II. Networking Diagram
9.1.1.0/24
RouterA
RouerB
RouterC
RouterD RouterE RouterF
RouterH
RouterG
AS 65010
Cluster1
Cluster2
Ethernet2/0/0
POS1/0/0 POS2/0/0
POS1/0/0
POS2/0/0
PSO3/0/0
POS4/0/0 POS1/0/0
POD1/0/1
POS1/0/2
POS1/0/3
POS2/0/0
POS1/0/0
POS2/0/0
POS2/0/0
POS1/0/0
POS1/0/0
POS2/0/0
POS3/0/0

Figure 6-18 Networking diagram of configuring BGP route reflector
III. Configuration Procedures
1) Configuring the IP addresses of the interfaces (omitted)
2) Configuring the IBGP connections between the clients and the route reflector
and that between the non-clients and the route reflector (omitted)
3) Configuring the route reflector
# Configure Router B.
[RouterB] bgp 65010
[RouterBbgp] router-id 2.2.2.2
[RouterBbgp] group in_rr internal
[RouterBbgp] peer 10.1.4.2 group in_rr
[RouterBbgp] peer 10.1.5.2 group in_rr
[RouterBbgp] ipv4-family unicast
[RouterBbgp-af-ipv4] peer in_rr reflect-client
[RouterBbgp-af-ipv4] undo reflect between-clients
[RouterBbgp-af-ipv4] quit
# Configure Router C.
[RouterC] bgp 65010
[RouterC-bgp] router-id 3.3.3.3
[RouterC-bgp] group in_rr internal
[RouterC-bgp] peer 10.1.7.2 group in_rr
[RouterC-bgp] peer 10.1.8.2 group in_rr
[RouterC-bgp] peer 10.1.9.2 group in_rr
[RouterC-bgp] ipv4-family unicast
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-67
[RouterC-bgp-af-ipv4] peer in_rr reflect-client
[RouterC-bgp-af-ipv4] quit
# Display the routing table of Router D.
[RouterD] display bgp routing-table 9.1.1.0

BGP local router ID : 4.4.4.4
Local AS number : 65010
Paths: 1 available, 0 best

BGP routing table entry information of 9.1.1.0/24:
From: 10.1.4.1 (2.2.2.2)
Original nexthop: 10.1.1.2
AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, internal, pre 255
Originator: 1.1.1.1
Cluster list: 0.0.0.1
Not advertised to any peers yet

From the routing table, you can see that Router D has learned the route advertised
by Router A from Router B. Besides, you can see the Originator and Cluster_ID
attributes of the route.
IV. Configuration Files
1) Configuration file of Router A
#
sysname RouterA
#
interface Ethernet2/0/0
ip address 9.1.1.1 255.255.255.0
#
interface Pos1/0/0
link-protocol ppp
ip address 10.1.1.2 255.255.255.0
#
bgp 65010
router-id 1.1.1.1
peer 10.1.1.1 as-number 65010
peer 10.1.3.1 as-number 65010
#
ipv4-family unicast
network 9.1.1.0 255.255.255.0
peer 10.1.1.1 enable
peer 10.1.3.1 enable
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-68
quit
#
return
2) Configuration file of Router B
#
sysname RouterB
#
interface Pos1/0/0
link-protocol ppp
ip address 10.1.1.1 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
ip address 10.1.4.1 255.255.255.0
#
interface Pos3/0/0
link-protocol ppp
ip address 10.1.5.1 255.255.255.0
#
bgp 65010
router-id 2.2.2.2
peer 10.1.1.2 as-number 65010
peer 10.1.2.2 as-number 65010
group in_rr internal
peer 10.1.4.2 as-number 65010
peer 10.1.4.2 group in_rr
peer 10.1.5.2 as-number 65010
peer 10.1.5.2 group in_rr
#
ipv4-family unicast
undo reflect between-clients
network 9.1.1.0 255.255.255.0
peer 10.1.1.2 enable
peer 10.1.2.2 enable
peer in_rr enable
peer in_rr reflect-client
peer 10.1.4.2 enable
peer 10.1.4.2 group in_rr
peer 10.1.5.2 enable
peer 10.1.5.2 group in_rr
quit
#
return
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-69
3) Configuration file of Router C
#
sysname RouterC
#
interface Pos1/0/0
link-protocol ppp
ip address 10.1.2.2 255.255.255.0
#
interface Pos1/0/1
link-protocol ppp
ip address 10.1.3.1 255.255.255.0
#
interface Pos1/0/2
link-protocol ppp
ip address 10.1.7.1 255.255.255.0
#
interface Pos1/0/3
link-protocol ppp
ip address 10.1.8.1 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
ip address 10.1.9.1 255.255.255.0
#
bgp 65010
router-id 2.2.2.2
peer 10.1.2.1 as-number 65010
peer 10.1.3.2 as-number 65010
group in_rr internal
peer 10.1.7.2 as-number 65010
peer 10.1.7.2 group in_rr
peer 10.1.8.2 as-number 65010
peer 10.1.8.2 group in_rr
peer 10.1.9.2 as-number 65010
peer 10.1.9.2 group in_rr
#
ipv4-family unicast
peer 10.1.2.1 enable
peer 10.1.3.2 enable
peer in_rr enable
peer in_rr reflect-client
peer 10.1.7.2 enable
peer 10.1.7.2 group in_rr
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-70
peer 10.1.8.2 enable
peer 10.1.8.2 group in_rr
peer 10.1.9.2 enable
peer 10.1.9.2 group in_rr
quit
#
return
4) Configuration file of Router D
#
sysname RouterD
#
interface Pos1/0/0
link-protocol ppp
ip address 10.1.4.2 255.255.255.0
#
interface LoopBack0
ip address 8.1.1.1 255.255.255.0
#
bgp 65010
router-id 4.4.4.4
peer 10.1.4.1 as-number 65010
#
ipv4-family unicast
network 8.1.1.0 255.255.255.0
peer 10.1.4.1 enable
quit
#
return

Note:
The configuration file of other routers is similar to that of Router D and is omitted
here.

6.8.6 Configuring the BGP Confederation
I. Networking Requirements
There are many BGP routers in AS200. To reduce IBGP connections, you can divide
the AS200 into AS65001, AS65002 and AS65003. In addition, the three routers in
AS65003 create a full IBGP connection.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-71
II. Networking Diagram
RouterB
RouterF
AS 100
AS 65002
RouterC
AS 65003
AS 65001
RouterE
RouterD
RouterA
AS 200
POS1/0/0
200.1.1.1/24
POS1/0/1
10.1.1.1/24
POS1/0/2
10.1.2.1/24
POS1/0/3
10.1.3.1/24
POS2/0/0
10.1.4.1/24
POS1/0/0
10.1.1.2/24
POS1/0/0
10.1.2.2/24
POS1/0/0
10.1.3.2/24
POS2/0/0
10.1.5.1/24
POS1/0/0
10.1.4.2/24
POS2/0/0
10.1.5.2/24
Ethernet2/0/0
9.1.1.1/24
POS1/0/0
200.1.1.2/24

Figure 6-19 Networking diagram of configuring the confederation
III. Configuration Procedures
1) Configuring the IP addresses of the interfaces (omitted)
2) Configuring BGP confederation
# Configure Router A.
[RouterA] bgp 65001
[RouterA-bgp] router-id 1.1.1.1
[RouterA-bgp] confederation id 200
[RouterA-bgp] confederation peer-as 65002 65003
[RouterA-bgp] peer 10.1.1.2 as-number 65002
[RouterA-bgp] peer 10.1.2.2 as-number 65003
[RouterA-bgp] ipv4-family unicast
[RouterA-bgp-af-ipv4] peer 10.1.1.2 next-hop-local
[RouterA-bgp-af-ipv4] peer 10.1.2.2 next-hop-local
[RouterA-bgp-af-ipv4] quit
# Configure Router B.
[RouterB] bgp 65002
[RouterB-bgp] router-id 2.2.2.2
[RouterB-bgp] confederation id 200
[RouterB-bgp] confederation peer-as 65001 65003
[RouterB-bgp] peer 10.1.1.1 as-number 65001
[RouterB-bgp] quit
# Configure Router C.
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-72
[RouterC] bgp 65003
[RouterC-bgp] router-id 3.3.3.3
[RouterC-bgp] confederation id 200
[RouterC-bgp] confederation peer-as 65001 65002
[RouterC-bgp] peer 10.1.2.1 as-number 65001
[RouterC-bgp] quit
3) Configuring the IBGP connections inside the AS65001
# Configure Router A.
[RouterA] bgp 65001
[RouterA-bgp] peer 10.1.3.2 as-number 65001
[RouterA-bgp] peer 10.1.4.2 as-number 65001
[RouterA-bgp] ipv4-family unicast
[RouterA-bgp-af-ipv4] peer 10.1.3.2 next-hop-local
[RouterA-bgp-af-ipv4] peer 10.1.4.2 next-hop-local
[RouterA-bgp-af-ipv4] quit
# Configure Router D.
[RouterD] bgp 65001
[RouterD-bgp] router-id 4.4.4.4
[RouterD-bgp] peer 10.1.2.1 as-number 65001
[RouterD-bgp] peer 10.1.5.2 as-number 65001
[RouterD-bgp] quit
# Configure Router E.
[RouterE] bgp 65001
[RouterE-bgp] router-id 5.5.5.5
[RouterE-bgp] peer 10.1.4.1 as-number 65001
[RouterE-bgp] peer 10.1.5.1 as-number 65001
[RouterE-bgp] quit
4) Configuring the EBGP connections between AS100 and AS200
# Configure Router A.
[RouterA] bgp 65001
[RouterA-bgp] peer 200.1.1.2 as-number 100
[RouterA-bgp] quit
# Configure Router F.
[RouterF] bgp 100
[RouterF-bgp] router-id 6.6.6.6
[RouterF-bgp] peer 200.1.1.1 as-number 200
[RouterF-bgp] ipv4-family unicast
[RouterF-bgp-af-ipv4] network 9.1.1.0 255.255.255.0
[RouterF-bgp-af-ipv4] quit
5) Verifying the configuration
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-73
# 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,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn

*>i 9.1.1.0/24 10.1.1.1 0 100 0 (65001)
100i
[RouterB] display bgp routing-table 9.1.1.0

BGP local router ID : 2.2.2.2
Local AS number : 65002
Paths: 1 available, 1 best

BGP routing table entry information of 9.1.1.0/24:
From: 10.1.1.1 (1.1.1.1)
Relay Nexthop: 0.0.0.0
Original nexthop: 10.1.1.1
AS-path (65001) 100, origin igp, MED 0, localpref 100, pref-val 0, valid,
extern
nal-confed, best, pre 255
Not advertised to any peers yet

# Display the routing table of Router D.
[RouterD] display bgp routing-table

Total Number of Routes: 1

BGP Local router ID is 4.4.4.4
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 9.1.1.0/24 10.1.2.1 0 100 0 100i
[RouterD] display bgp routing-table 9.1.1.0

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

Huawei Technologies Proprietary
6-74
BGP local router ID : 4.4.4.4
Local AS number : 65001
Paths: 1 available, 1 best

BGP routing table entry information of 9.1.1.0/24:
From: 10.1.2.1 (1.1.1.1)
Relay Nexthop: 0.0.0.0
Original nexthop: 10.1.2.1
AS-path 100, origin igp, MED 0, localpref 100, pref-val 0, valid, internal,
best, pre 255
Not advertised to any peers yet

IV. Configuration Files
1) Configuration file of Router A
#
sysname RouterA
#
interface Pos1/0/0
link-protocol ppp
ip address 200.1.1.1 255.255.255.0
#
interface Pos1/0/1
link-protocol ppp
ip address 10.1.1.1 255.255.255.0
#
interface Pos1/0/2
link-protocol ppp
ip address 10.1.2.1 255.255.255.0
#
interface Pos1/0/3
link-protocol ppp
ip address 10.1.3.1 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
ip address 10.1.4.1 255.255.255.0
#
bgp 65001
router-id 1.1.1.1
confederation id 200
confederation peer-as 65002 65003
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-75
peer 200.1.1.2 as-number 100
peer 10.1.1.2 as-number 65002
peer 10.1.2.2 as-number 65002
peer 10.1.3.2 as-number 65001
peer 10.1.4.2 as-number 65001
#
ipv4-family unicast
peer 200.1.1.2 enable
peer 10.1.1.2 enable
peer 10.1.1.2 next-hop-local
peer 10.1.2.2 enable
peer 10.1.2.2 next-hop-local
peer 10.1.3.2 enable
peer 10.1.3.2 next-hop-local
peer 10.1.4.2 enable
peer 10.1.4.2 next-hop-local
quit
#
return
2) Configuration file of Router B
#
sysname RouterB
#
interface Pos1/0/0
link-protocol ppp
ip address 10.1.1.2 255.255.255.0
#
bgp 65002
router-id 2.2.2.2
confederation id 200
confederation peer-as 65001 65003
peer 10.1.1.1 as-number 65001
#
ipv4-family unicast
peer 10.1.1.1 enable
quit
#
return

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

Huawei Technologies Proprietary
6-76
Note:
The configuration file of Router C is similar to that of Router B and is omitted here.

3) Configuration file of Router D
#
sysname RouterD
#
interface Pos1/0/0
link-protocol ppp
ip address 10.1.3.2 255.255.255.0
#
interface Pos2/0/0
link-protocol ppp
ip address 10.1.5.1 255.255.255.0
#
bgp 65001
router-id 4.4.4.4
peer 10.1.3.1 as-number 65001
peer 10.1.5.2 as-number 65001
#
ipv4-family unicast
peer 10.1.3.1 enable
peer 10.1.5.2 enable
quit
#
return

Note:
The configuration file of Router E is similar to that of Router D and is omitted here.

4) Configuration file of Router F
#
sysname RouterF
#
interface Ethernet2/0/0
ip address 9.1.1.1 255.255.255.0
#
interface Pos1/0/0
Operation Manual - IP Routing Volume
Quidway NetEngine20 Series Routers Chapter 6 BGP Configuration

Huawei Technologies Proprietary
6-77
link-protocol ppp
ip address 200.1.1.2 255.255.255.0
#
bgp 100
router-id 6.6.6.6
peer 200.1.1.1 as-number 200
#
ipv4-family unicast
network 9.1.1.0 255.255.255.0
peer 200.1.1.1 enable
quit
#
return
6.9 Troubleshooting
I. Fault Description
Display BGP peers using the display bgp peer command. The fault is that the peer
connection between two routers cannot enter the Established state.
II. Analysis
To create BGP peers, you need to establish TCP sessions using the port 179
between two routers. Besides, they can exchange Open messages correctly.
III. Troubleshooting
Step Action
1
Check whether the AS number of the peer is configured correctly using the
display current-configuration command.
2
Check whether the IP address of the peer is correct using the display bgp
peer command.
3
Check whether the connect-interface command is configured if the
Loopback interface is used.
4
Check whether the peer ebgp-max-hop command is configured if the peer
is a non-physically connected EBGP peer.
5 Check whether the route to the peer is available in the routing table.
6
Check whether the TCP connection is normal using the ping -a ip-address
command.
7 Check whether the ACL disabling the TCP port 179 is configured.

Você também pode gostar