05-Layer 3—IP Routing Command Reference

HomeSupportResource CenterSwitchesH3C S6300 Switch SeriesH3C S6300 Switch SeriesTechnical DocumentsCommandCommand ReferencesH3C S6300 Switch Series Command References-Release 243x-6W10005-Layer 3—IP Routing Command Reference
06-BGP commands
Title Size Download
06-BGP commands 470.94 KB

Contents

BGP commands· 1

address-family ipv4· 1

address-family ipv6· 1

advertise-rib-active· 2

aggregate· 3

balance· 5

bestroute as-path-neglect 6

bestroute compare-med· 7

bestroute med-confederation· 8

bgp· 9

bgp update-delay on-startup· 9

compare-different-as-med· 10

confederation id· 11

confederation nonstandard· 12

confederation peer-as· 12

dampening· 13

default local-preference· 14

default med· 15

default-route imported· 16

display bgp dampening parameter ipv4 unicast 17

display bgp dampening parameter ipv6 unicast 18

display bgp group· 19

display bgp network· 21

display bgp non-stop-routing status· 23

display bgp paths· 24

display bgp peer 25

display bgp routing-table dampened ipv4 unicast 31

display bgp routing-table dampened ipv6 unicast 32

display bgp routing-table flap-info ipv4 unicast 34

display bgp routing-table flap-info ipv6 unicast 36

display bgp routing-table ipv4 unicast 37

display bgp routing-table ipv4 unicast advertise-info· 40

display bgp routing-table ipv4 unicast peer 42

display bgp routing-table ipv4 unicast statistics· 43

display bgp routing-table ipv6 unicast 44

display bgp routing-table ipv6 unicast peer 47

display bgp routing-table ipv6 unicast statistics· 49

display bgp update-group· 50

ebgp-interface-sensitive· 52

filter-policy export 52

filter-policy import 54

graceful-restart 55

graceful-restart timer purge-time· 56

graceful-restart timer restart 57

graceful-restart timer wait-for-rib· 58

group· 59

ignore-first-as· 60

import-route· 61

ip vpn-instance (BGP view) 62

log-peer-change· 63

log-route-flap· 64

network· 64

network short-cut 66

non-stop-routing· 67

peer advertise-community· 67

peer advertise-ext-community· 69

peer allow-as-loop· 70

peer as-number (for a BGP peer) 71

peer as-number (for a BGP peer group) 73

peer bfd· 74

peer capability-advertise conventional 75

peer capability-advertise route-refresh· 76

peer capability-advertise suppress-4-byte-as· 77

peer connect-interface· 78

peer default-route-advertise· 80

peer description· 81

peer ebgp-max-hop· 82

peer enable· 83

peer fake-as· 85

peer filter-policy· 86

peer group· 87

peer ignore· 89

peer ignore-originatorid· 90

peer ipsec-profile· 91

peer keep-all-routes· 93

peer low-memory-exempt 94

peer next-hop-local 95

peer password· 96

peer preferred-value· 98

peer public-as-only· 99

peer reflect-client 100

peer route-limit 101

peer route-update-interval 103

peer substitute-as· 104

peer timer 105

peer ttl-security· 107

pic· 108

preference· 109

primary-path-detect bfd· 109

reflect between-clients· 110

reflector cluster-id· 111

refresh bgp· 112

reset bgp· 113

reset bgp all 115

reset bgp dampening ipv4 unicast 115

reset bgp dampening ipv6 unicast 116

reset bgp flap-info ipv4 unicast 117

reset bgp flap-info ipv6 unicast 118

router id (system view) 118

router-id (BGP view) 119

router-id (BGP-VPN instance view) 120

snmp-agent trap enable bgp· 121

summary automatic· 121

timer 122

 


BGP commands

address-family ipv4

Use address-family ipv4 to create the BGP IPv4 unicast address family or BGP-VPN IPv4 unicast address family and enter its view.

Use undo address-family ipv4 to remove the BGP IPv4 unicast address family or BGP-VPN IPv4 unicast address family and all configurations in address family view.

Syntax

address-family ipv4 [ unicast ]

undo address-family ipv4 [ unicast ]

Default

The BGP IPv4 unicast address family or the BGP-VPN IPv4 unicast address family is not created.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

unicast: Specifies the IPv4 unicast address family. This command specifies the IPv4 unicast address family regardless of whether the unicast keyword is specified.

Usage guidelines

Configurations made in BGP IPv4 unicast address family view apply only to the BGP IPv4 unicast routes and peers of the public network.

Configurations made in BGP-VPN IPv4 unicast address family view apply only to the BGP IPv4 unicast routes and peers of the specified VPN instance.

Examples

# In BGP view, create the BGP IPv4 unicast address family and enter its view.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4]

# In BGP-VPN instance view, create the BGP-VPN IPv4 unicast address family and enter its view.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1]

address-family ipv6

Use address-family ipv6 to create the BGP IPv6 unicast address family or BGP-VPN IPv6 unicast address family and enter its view.

Use undo address-family ipv6 to remove the BGP IPv6 unicast address family or BGP-VPN IPv6 unicast address family and all configurations in address family view.

Syntax

address-family ipv6 [ unicast ]

undo address-family ipv6 [ unicast ]

Default

The BGP IPv6 unicast address family or BGP-VPN IPv6 unicast address family is not created.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

unicast: Specifies the IPv6 unicast address family. This command specifies the IPv6 unicast address family regardless of whether the unicast keyword is specified.

Usage guidelines

Configurations made in BGP IPv6 unicast address family view apply only to the BGP IPv6 unicast routes and peers of the public network.

Configurations made in BGP-VPN IPv6 unicast address family view apply only to the BGP IPv6 unicast routes and peers of the specified VPN instance.

Examples

# In BGP view, create the BGP IPv6 unicast address family and enter its view.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6]

# In BGP-VPN instance view, create the BGP-VPN IPv6 unicast address family and enter its view.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1]

advertise-rib-active

Use advertise-rib-active to enable BGP to advertise optimal routes in the IP routing table.

Use undo advertise-rib-active to restore the default.

Syntax

advertise-rib-active

undo advertise-rib-active

Default

BGP advertises optimal routes in the BGP routing table, regardless of whether they are optimal in the IP routing table.

Views

BGP view

Predefined user roles

network-admin

Usage guidelines

The advertise-rib-active command does not apply to the following routes:

·     Routes redistributed by the import-route command.

·     Routes advertised by the network command.

·     Default routes redistributed by the default-route imported command.

This command takes effect only on the routes generated after you execute this command. To make this command take effect on the routes generated before you executed it, use the reset bgp command to reset BGP sessions.

Examples

# Enable BGP to advertise optimal routes in the IP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] advertise-rib-active

aggregate

Use aggregate to create a summary route in the BGP routing table.

Use undo aggregate to remove a summary route.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

aggregate ip-address { mask | mask-length } [ as-set | detail-suppressed ] *

undo aggregate ip-address { mask | mask-length }

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

aggregate ipv6-address prefix-length [ as-set | detail-suppressed ] *

undo aggregate ipv6-address prefix-length

Default

No summary route is configured.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

ip-address: Specifies a summary address.

mask: Specifies a mask for the summary address, in dotted decimal notation.

mask-length: Specifies a mask length for the summary address, in the range of 0 to 32.

ipv6-address: Specifies an IPv6 summary address.

prefix-length: Specifies a prefix length for the IPv6 summary address, in the range of 0 to 128.

as-set: Enables the AS_PATH attribute of the summary route to contain the AS path information of all summarized routes. The AS_PATH attribute is of the AS_SET type that requires no sequence when arranging AS numbers. If you do not specify this keyword, the AS_PATH attribute of the summary route contains only the AS number of the local router.

detail-suppressed: Advertises only the summary route. If you do not specify this keyword, BGP advertises both the summary route and the more specific routes.

Usage guidelines

This command creates a summary route. If the BGP routing table has routes whose destination addresses fall within the specified network, the summary route is added to the BGP routing table. For example, if two routes 10.1.1.0/24 and 10.1.2.0/24 exist in the BGP routing table, configuring the aggregate 10.1.0.0 16 command creates a summary route 10.1.0.0/16.

If the summarized routes have different ORIGIN attributes, the summary route selects the ORIGIN attribute in the sequence of INCOMPLETE, EGP, and IGP. For example, if the ORIGIN attributes of the summarized routes include INCOMPLETE and IGP, the ORIGIN attribute of the summary route is INCOMPLETE.

The COMMUNITY attribute of the summary route includes all the COMMUNITY (or extended community) attribute values if the routes have the following details:

·     Summarized routes have different COMMUNITY (or extended community) attribute values.

·     The summary route does not have the ATOMIC_AGGREGATE attribute.

Table 1 Functions of the keywords

Keywords

Function

as-set

Enables the summary route to carry the AS path information of all summarized routes. This feature can help avoid routing loops. However, if many routes are summarized and are changed frequently, do not specify this keyword. This configuration causes the summary route to flap with the more specific routes.

detail-suppressed

Disables advertisement of all more specific routes.

 

Examples

# In BGP IPv4 unicast address family view, create summary route 1.1.0.0/16 in the BGP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] aggregate 1.1.0.0 255.255.0.0

# In BGP IPv4 unicast address family view, create summary route 1.1.0.0/16 in the BGP routing table. Specify the AS_PATH attribute for the summary route to contain the AS path information of all summarized routes, and advertise only the summary route.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] aggregate 1.1.0.0 255.255.0.0 as-set detail-suppressed

# In BGP-VPN IPv4 unicast address family view, create summary route 1.1.0.0/16 in BGP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] aggregate 1.1.0.0 255.255.0.0

# In BGP IPv6 unicast address family view, create summary route 12::/64 in the IPv6 BGP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6

[Sysname-bgp-ipv6] aggregate 12:: 64

Related commands

·     display bgp routing-table ipv4 unicast

·     display bgp routing-table ipv6 unicast

·     summary automatic

balance

Use balance to enable load balancing and specify the maximum number of BGP ECMP routes for load balancing.

Use undo balance to disable load balancing.

Syntax

balance { [ ebgp | eibgp | ibgp ] number | as-path-neglect }

undo balance [ ebgp | eibgp | ibgp | as-path-neglect ]

Default

Load balancing is not enabled.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

ebgp: Enables load balancing over EBGP routes.

eibgp: Enables load balancing between EBGP and IBGP routes.

ibgp: Enables load balancing over IBGP routes.

as-path-neglect: Enables BGP to implement load balancing over routes with different AS_PATH attributes. If you do not specify this keyword, BGP does not implement load balancing over routes with different AS_PATH attributes.

number: Specifies the maximum number of BGP ECMP routes for load balancing. When it is set to 1, load balancing is disabled.

Usage guidelines

Unlike IGP, BGP has no explicit metric for making load balancing decision. Instead, it implements load balancing by modifying route selection rules. If multiple BGP routes destined for a network meet the following conditions, the device selects the specified number of routes for load balancing:

·     The routes have the same AS_PATH, ORIGIN, LOCAL_PREF, and MED attributes. (When the as-path-neglect keyword is specified, BGP implements load balancing over routes with different AS_PATH attributes. Use the as-path-neglect keyword according to your network, and make sure a routing loop does not occur.)

·     All the routes are reflected by a route reflector, or none of the routes is reflected by a route reflector.

If you do not provide the ibgp, eibgp, or ebgp keyword, this command enables load balancing over EBGP routes and IBGP routes, but not between EBGP and IBGP routes.

After you execute the balance eibgp number command, the balance [ ebgp | ibgp ] number and undo balance [ ebgp | ibgp ] commands cannot be executed; and vice versa.

Examples

# In BGP IPv4 unicast address family view, enable load balancing and specify the maximum number of BGP ECMP routes used for load balancing as 2.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] balance 2

# In BGP-VPN IPv6 unicast address family view, enable load balancing and specify the maximum number of BGP ECMP routes for load balancing as 2.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] balance 2

bestroute as-path-neglect

Use bestroute as-path-neglect to configure BGP to not consider the AS_PATH during best route selection.

Use undo bestroute as-path-neglect to configure BGP to consider the AS_PATH during best route selection.

Syntax

bestroute as-path-neglect

undo bestroute as-path-neglect

Default

BGP considers the AS_PATH during best route selection.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Examples

# In BGP IPv4 unicast address family view, ignore AS_PATH in route selection.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] bestroute as-path-neglect

# In BGP-VPN IPv6 unicast address family view, ignore AS_PATH in route selection.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] bestroute as-path-neglect

bestroute compare-med

Use bestroute compare-med to enable MED comparison for routes on a per-AS basis.

Use undo bestroute compare-med to restore the default.

Syntax

bestroute compare-med

undo bestroute compare-med

Default

MED comparison for routes on a per-AS basis is disabled.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Usage guidelines

By default, BGP does not compare MEDs for routes from the same AS. When a router learns a new route, it compares the route with the optimal route in its BGP routing table. If the new route is more optimal, it becomes the optimal route in the BGP routing table. In this way, route learning sequence might affect optimal route selection.

To solve the selection problem, the router puts routes received from the same AS into a group when the bestroute compare-med command is configured. The router then selects the route with the lowest MED from the same group, and compares routes from different groups.

Examples

# In BGP IPv4 unicast address family view, enable MED comparison for routes on a per-AS basis.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] bestroute compare-med

# In BGP-VPN IPv4 unicast address family view, enable MED comparison for routes on a per-AS basis.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] bestroute compare-med

# In BGP IPv6 unicast address family view, enable MED comparison for routes on a per-AS basis.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] bestroute compare-med

bestroute med-confederation

Use bestroute med-confederation to enable MED comparison for routes received from confederation peers.

Use undo bestroute med-confederation to restore the default.

Syntax

bestroute med-confederation

undo bestroute med-confederation

Default

MED comparison is disabled for routes received from confederation peers.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Usage guidelines

This command enables BGP to compare the MEDs of routes received from confederation peers. However, if a route from a confederation peer has an AS number that does not belong to the confederation, BGP does not compare the route with other routes. For example, a confederation has three AS numbers 65006, 65007, and 65009. BGP receives three routes from different confederation peers. The AS_PATH attributes of these routes are 65006 65009, 65007 65009, and 65008 65009, and the MED values of them are 2, 3, and 1. Because the third route's AS_PATH attribute contains AS number 65008, which does not belong to the confederation, BGP does not compare it with other routes. As a result, the first route becomes the optimal route.

Examples

# In BGP IPv4 unicast address family view, enable MED comparison for routes received from confederation peers.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] bestroute med-confederation

# In BGP-VPN IPv4 unicast address family view, enable MED comparison for routes received from confederation peers.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] bestroute med-confederation

# In BGP IPv6 unicast address family view, enable MED comparison for routes received from confederation peers.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] bestroute med-confederation

bgp

Use bgp to enable BGP and enter BGP view.

Use undo bgp to disable BGP.

Syntax

bgp as-number

undo bgp [ as-number ]

Default

BGP is not enabled.

Views

System view

Predefined user roles

network-admin

Parameters

as-number: Specifies a local AS by its number in the range of 1 to 4294967295.

Usage guidelines

A router can reside only in one AS, so the router can run only one BGP process.

A router supports 4-byte AS number.

Examples

# Enable BGP, set the local AS number to 100, and enter BGP view.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp]

bgp update-delay on-startup

Use bgp update-delay on-startup to configure BGP to delay sending updates on reboot.

Use undo bgp update-delay on-startup to restore the default.

Syntax

bgp update-delay on-startup seconds

undo bgp update-delay on-startup

Default

BGP immediately sends updates on reboot.

Views

BGP view

Predefined user roles

network-admin

Parameters

seconds: Specifies the delay time in the range of 0 to 3600 seconds. The value of 0 indicates that BGP does not send route updates after the device reboots.

Usage guidelines

After this command is executed, BGP redistributes all routes from other neighbors on reboot, and then advertises the optimal route. This configuration reduces traffic loss due to the reboot.

Examples

# Configure BGP to wait 100 seconds before sending updates on reboot.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp-100] bgp update-delay on-startup 100

compare-different-as-med

Use compare-different-as-med to enable MED comparison for routes from peers in different ASs.

Use undo compare-different-as-med to disable the comparison.

Syntax

compare-different-as-med

undo compare-different-as-med

Default

The comparison is disabled.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Usage guidelines

If multiple routes to a destination exist, the route with the smallest MED is selected.

Do not use this command unless relevant ASs adopt the same IGP protocol and routing selection method.

Examples

# In BGP IPv4 unicast address family view, enable MED comparison for routes from peers in different ASs.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] compare-different-as-med

# In BGP-VPN IPv4 unicast address family view, enable MED comparison for routes from peers in different ASs.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] compare-different-as-med

# In BGP IPv6 unicast address family view, enable MED comparison for routes from peers in different ASs.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] compare-different-as-med

confederation id

Use confederation id to configure a confederation ID.

Use undo confederation id to remove the specified confederation ID.

Syntax

confederation id as-number

undo confederation id

Default

No confederation ID is configured.

Views

BGP view

Predefined user roles

network-admin

Parameters

as-number: Specifies an AS number that identifies the confederation, in the range of 1 to 4294967295.

Usage guidelines

You can split an AS into several sub-ASs, and each sub-AS remains fully meshed. These sub-ASs form a confederation. Key path attributes of a route, such as the Next_HOP, MED, and LOCAL_PREF, are not discarded when crossing each sub-AS. The sub-ASs still look like one AS from the perspective of other ASs. The AS number is the confederation ID.

Confederation can ensure the integrity of the former AS, and solve the problem of too many IBGP connections in the AS.

Configure the same confederation ID for all routers in one confederation.

For a non-confederation BGP router that establishes a BGP connection to a router in a confederation, the confederation ID is the AS number of the router.

Examples

# Confederation 9 consists of four sub-ASs numbered 38, 39, 40 and 41. Peer 10.1.1.1 is a member of sub-AS 38. Peer 200.1.1.1 is a member outside of confederation 9, which belongs to AS 98. Confederation 9 looks like one AS (with AS number 9) from the perspective of peer 200.1.1.1. This example uses a router in sub-AS 41.

<Sysname> system-view

[Sysname] bgp 41

[Sysname-bgp] confederation id 9

[Sysname-bgp] confederation peer-as 38 39 40

[Sysname-bgp] group Confed38 external

[Sysname-bgp] peer Confed38 as-number 38

[Sysname-bgp] peer 10.1.1.1 group Confed38

[Sysname-bgp] group Remote98 external

[Sysname-bgp] peer Remote98 as-number 98

[Sysname-bgp] peer 200.1.1.1 group Remote98

Related commands

·     confederation nonstandard

·     confederation peer-as

confederation nonstandard

Use confederation nonstandard to enable compatibility with routers not compliant with RFC 3065 in the confederation.

Use undo confederation nonstandard to restore the default.

Syntax

confederation nonstandard

undo confederation nonstandard

Default

The device is compatible only with routers compliant with RFC 3065 in the confederation.

Views

BGP view

Predefined user roles

network-admin

Usage guidelines

Configure this command on all routers compliant with RFC 3065 to interact with those routers not compliant with RFC 3065 in the confederation.

Examples

# Confederation 100 comprises two sub-ASs, 64000 and 65000, and contains routers not compliant with RFC 3065. Enable compatibility with routers not compliant with RFC 3065 in the confederation.

<Sysname> system-view

[Sysname] bgp 64000

[Sysname-bgp] confederation id 100

[Sysname-bgp] confederation peer-as 65000

[Sysname-bgp] confederation nonstandard

Related commands

·     confederation id

·     confederation peer-as

confederation peer-as

Use confederation peer-as to specify confederation peer sub-ASs.

Use undo confederation peer-as to remove specified confederation peer sub-ASs.

Syntax

confederation peer-as as-number-list

undo confederation peer-as [ as-number-list ]

Default

No confederation peer sub-ASs are specified.

Views

BGP view

Predefined user roles

network-admin

Parameters

as-number-list: Specifies a sub-AS number list. Up to 32 sub-ASs can be configured in one command line. The expression is as-number-list = as-number &<1-32>. The as-number argument specifies a sub-AS number in the range of 1 to 4294967295, and &<1-32> indicates up to 32 numbers can be specified.

Usage guidelines

Before this configuration, use the confederation id command to specify the confederation for the sub-ASs.

If the undo confederation peer-as command without the as-number-list argument is used, all confederation peer sub-ASs are removed.

Examples

# Specify confederation peer sub-ASs 2000 and 2001.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] confederation id 10

[Sysname-bgp] confederation peer-as 2000 2001

Related commands

·     confederation id

·     confederation nonstandard

dampening

Use dampening to enable BGP route dampening.

Use undo dampening to disable route dampening.

Syntax

dampening [ half-life-reachable half-life-unreachable reuse suppress ceiling ] *

undo dampening

Default

Route dampening is disabled.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

half-life-reachable: Specifies a half-life for active routes, in the range of 1 to 45 minutes. By default, the value is 15 minutes.

half-life-unreachable: Specifies a half-life for suppressed routes, in the range of 1 to 45 minutes. By default, the value is 15 minutes.

reuse: Specifies a reuse threshold value for suppressed routes, in the range of 1 to 20000. A suppressed route whose penalty value decreases under the value is reused. By default, the reuse value is 750. The reuse threshold must be less than the suppression threshold.

suppress: Specifies a suppression threshold in the range of 1 to 20000. The route with a penalty value higher than the threshold is suppressed. The default value is 2000.

ceiling: Specifies a ceiling penalty value in the range of 1001 to 20000. The value must be bigger than the suppress value. By default, the value is 16000.

Usage guidelines

The command dampens only EBGP routes.

Examples

# In BGP IPv4 unicast address family view, configure BGP route dampening.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] dampening 10 10 1000 2000 10000

# In BGP-VPN IPv4 unicast address family view, configure BGP route dampening.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] dampening 10 10 1000 2000 10000

# In BGP IPv6 unicast address family view, configure BGP route dampening.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] dampening 10 10 1000 2000 10000

# In BGP-VPN IPv6 unicast address family view, configure BGP route dampening.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] dampening 10 10 1000 2000 10000

Related commands

·     display bgp dampening parameter ipv4 unicast

·     display bgp dampening parameter ipv6 unicast

default local-preference

Use default local-preference to configure a default local preference.

Use undo default local-preference to restore the default.

Syntax

default local-preference value

undo default local-preference

Default

The default local preference is 100.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

value: Specifies a default local preference in the range of 0 to 4294967295. A larger value represents a higher preference.

Examples

# In BGP IPv4 unicast address family view, set the default local preference to 180.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] default local-preference 180

# In BGP-VPN IPv6 unicast address family view, set the default local preference to 180.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] default local-preference 180

default med

Use default med to specify a default MED value.

Use undo default med to restore the default.

Syntax

default med med-value

undo default med

Default

The default med-value is 0.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

med-value: Specifies the default MED value in the range of 0 to 4294967295.

Usage guidelines

BGP selects a MED value in the following order:

1.     MED set by the med keyword in the import-route command.

2.     MED set by the default med command.

3.     Original MED of a BGP route, or MED changed from the metric of a redistributed IGP route.

Examples

# In BGP IPv4 unicast address family view, configure the default MED as 25.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] default med 25

# In BGP-VPN IPv6 unicast address family view, configure the default MED as 25.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] default med 25

Related commands

import-route

default-route imported

Use default-route imported to enable default route redistribution into the BGP routing table.

Use undo default-route imported to restore the default.

Syntax

default-route imported

undo default-route imported

Default

Default route redistribution is not enabled.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Usage guidelines

By default, BGP does not redistribute default IGP routes. You must use the default-route imported command together with the import-route command to redistribute default IGP routes into the BGP routing table.

Examples

# In BGP IPv4 unicast address family view, enable default route redistribution from OSPF process 1 into the BGP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] default-route imported

[Sysname-bgp-ipv4] import-route ospf 1

# In BGP-VPN IPv4 unicast address family view, enable default route redistribution from OSPF process 1 into the BGP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] default-route imported

[Sysname-bgp-ipv4-vpn1] import-route ospf 1

# In BGP IPv6 unicast address family view, enable default route redistribution from OSPFv3 process 1 into the IPv6 BGP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] default-route imported

[Sysname-bgp-ipv6] import-route ospfv3 1

# In BGP-VPN IPv6 unicast address family view, enable default route redistribution from OSPFv3 process 1 into the IPv6 BGP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] default-route imported

[Sysname-bgp-ipv6-vpn1] import-route ospfv3 1

Related commands

import-route

display bgp dampening parameter ipv4 unicast

Use display bgp dampening parameter ipv4 unicast to display BGP IPv4 unicast route dampening parameters.

Syntax

display bgp dampening parameter ipv4 [ unicast ] [ vpn-instance vpn-instance-name ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP IPv4 unicast route dampening parameters for the public network.

Usage guidelines

This command displays BGP IPv4 unicast route dampening parameters regardless of whether the unicast keyword is specified.

Examples

# Display BGP IPv4 unicast route dampening parameters for the public network.

<Sysname> display bgp dampening parameter ipv4

Maximum suppression time (in seconds)              : 3973

Ceiling value                                      : 16000

Reuse value                                        : 750

Half-life time for reachable routes (in seconds)   : 900

Half-life time for unreachable routes (in seconds) : 900

Suppression threshold                              : 2000

Table 2 Command output

Field

Description

Maximum suppression time

Maximum time (in seconds) for the penalty value to decrease from the ceiling value to the reuse value.

Ceiling value

Penalty ceiling value.

Reuse value

Reuse threshold.

 

Related commands

dampening

display bgp dampening parameter ipv6 unicast

Use display bgp dampening parameter ipv6 unicast to display BGP IPv6 unicast route dampening parameters.

Syntax

display bgp dampening parameter ipv6 [ unicast ] [ vpn-instance vpn-instance-name ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP IPv6 unicast route dampening parameters for the public network.

Usage guidelines

This command displays BGP IPv6 unicast route dampening parameters regardless of whether the unicast keyword is specified.

Examples

# Display BGP IPv6 unicast route dampening parameters for the public network.

<Sysname> display bgp dampening parameter ipv6

Maximum suppression time (in seconds)              : 3973

Ceiling value                                      : 16000

Reuse value                                        : 750

Half-life time for reachable routes (in seconds)   : 900

Half-life time for unreachable routes (in seconds) : 900

Suppression threshold                              : 2000

Table 3 Command output

Field

Description

Maximum suppression time

Maximum time (in seconds) for the penalty value to decrease from the ceiling value to the reuse value.

Ceiling value

Penalty ceiling value.

Reuse value

Reuse threshold.

 

Related commands

dampening

display bgp group

Use display bgp group to display BGP peer group information.

Syntax

display bgp group ipv4 [ unicast ] [ vpn-instance vpn-instance-name ] } [ group-name ]

display bgp group ipv6 [ unicast ] [ vpn-instance vpn-instance-name ] [ group-name ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

ipv4: Displays IPv4 BGP peer group information.

ipv6: Displays IPv6 BGP peer group information.

unicast: Displays BGP unicast peer group information. If you do not specify this keyword, the command also displays BGP unicast peer group information.

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP peer group information for the public network.

group-name: Specifies a BGP peer group by its name, a case-sensitive string of 1 to 47 characters. If you do not specify a group, this command displays brief information about all BGP peer groups for the specified address family.

Examples

# Display brief information about all BGP IPv4 unicast peer groups for the public network.

 BGP peer group: group1

 Remote AS: 600

 Type: external

 Members:

  1.1.1.10

 

 BGP peer group: group2

 Remote AS number: not specified

 Type: external

 Members:

  2.2.2.2

# Display detailed information about BGP IPv4 unicast peer group group1 for the public network.

<Sysname> display bgp group ipv4 group1

 BGP peer group: group1

 Remote AS: 600

 Type: external

 Maximum number of prefixes allowed: 4294967295

 Threshold: 75%

 Configured hold time: 180 seconds

 Keepalive time: 60 seconds

 Minimum time between advertisements: 30 seconds

 Peer preferred value: 0

 

 Routing policy configured:

 No routing policy is configured

 

 Members:

  Peer                    AS  MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

 

  1.1.1.10               600        0        0    0       0 00:00:55 Established

# Display detailed information about BGP IPv6 unicast peer group group2 for the public network.

<Sysname> display bgp group ipv6 group2

 BGP peer group: group2

 Remote AS: 600

 Type: external

 Maximum number of prefixes allowed: 4294967295

 Threshold: 75%

 Configured hold time: 180 seconds

 Keepalive time: 60 seconds

 Minimum time between advertisements: 30 seconds

 Peer preferred value: 0

 IPsec profile name: profile001

 

 Routing policy configured:

 No routing policy is configured

 

 Members:

  Peer                    AS  MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

 

  2::2                   600        0        0    0       0 00:00:45 Established

  3::3                   600        0        0    0       0 00:00:40 Established

 

Table 4 Command output

Field

Description

BGP peer group

Name of the BGP peer group.

Remote AS

AS number of the peer group.

Type

Type of the peer groups:

·     external—EBGP peer group.

·     internal—IBGP peer group.

Maximum number of prefixes allowed

Maximum number of routes allowed to learn from the peer.

Threshold

Percentage of received routes from the peer to maximum routes allowed to learn from the peer. If the percentage is reached, the system generates a log message.

Configured hold time

Configured Hold Interval in seconds.

Keepalive time

Keepalive interval in seconds.

Minimum time between advertisements

Minimum route advertisement interval in seconds.

Peer preferred value

Preferred value specified for routes from the peer.

Routing policy configured

This field is not supported in the current software version.

Routing policy configured for the peer group.

If you do not specify any routing policy, this field displays No routing policy is configured.

Members

Information about peers included in the peer group.

Peer

IP or IPv6 address of the peer.

AS

AS number of the peer.

MsgRcvd

Number of messages received.

MsgSent

Number of messages sent.

OutQ

Number of messages to be sent.

PrefRcv

For the IPv4 and IPv6 address families, this field displays the number of prefixes received from the peer.

Up/Down

Lasting time of the current BGP session state.

State

Current state of the BGP session between the local router and the peer.

IPsec profile name

IPsec profile applied to the IPv6 BGP peer group.

 

display bgp network

Use display bgp network to display information about routes advertised by the network command and shortcut routes configured by the network short-cut command.

Syntax

display bgp network { ipv4 | ipv6 } [ unicast ] [ vpn-instance vpn-instance-name ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

ipv4: Displays IPv4 address family information.

ipv6: Displays IPv6 address family information.

unicast: Displays IPv4 or IPv6 unicast address family information regardless of whether this keyword is specified.

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays routing information for the public network.

Examples

# Display information about routes advertised by the network command and shortcut routes configured by the network short-cut command in the IPv4 unicast address family for the public network.

<Sysname> display bgp network ipv4

 

  BGP local router ID: 192.168.1.135

  Local AS number: 100

 

  Network           Mask            Route-policy        Short-cut

  20.1.1.0          255.255.255.0                       No

  40.1.1.0          255.255.255.0   abc                 No

  30.1.1.0          255.255.255.0                       Yes

# Display information about routes advertised by the network command and shortcut routes configured by the network short-cut command in the IPv6 unicast address family for the public network.

<Sysname> display bgp network ipv6

 

  BGP local router ID: 192.168.1.135

  Local AS number: 100

 

  Network           PrefixLen       Route-policy        Short-cut

  1::               24                                  No

  2::               24                                  No

  3::               64              policy1             No

  2::               24                                  Yes

# Display information about routes advertised by the network command and shortcut routes configured by the network short-cut command in the IPv4 unicast address family in VPN instance vpn1.

<Sysname> display bgp network ipv4 vpn-instance vpn1

 

  BGP local router ID: 192.168.1.135

  Local AS number: 100

 

  Network           Mask            Route-policy        Short-cut

  50.1.1.0          255.255.255.0                       No

  40.1.1.0          255.255.255.0                       Yes

Table 5 Command output

Field

Description

Network

Destination network address of the routes advertised by the network command and the shortcut routes.

Mask

Mask of the destination network address.

PrefixLen

Prefix length of the destination network address.

Route-policy

This field is not supported in the current software version.

Routing policy that is applied to the route.

Short-cut

Indicates whether the route is a shortcut route:

·     Yes.

·     No.

 

display bgp non-stop-routing status

Use display bgp non-stop-routing status to display BGP NSR status information.

Syntax

display bgp non-stop-routing status

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# Display BGP NSR status information.

<Sysname> display bgp non-stop-routing status

 

BGP NSR status: Ready

 Location of preferred standby process: slot 1

 TCP NSR status: Ready

Table 6 Command output

Field

Description

BGP NSR status

BGP NSR status:

·     Ready—BGP NSR has backed up BGP neighbor and routing information from the active process to the standby process. In this state, BGP NSR can ensure continuous routing when an active/standby process switchover occurs.

·     Not ready—BGP NSR is backing up BGP neighbor and routing information from the active process to the standby process. If an active/standby process switchover occurs in this state, traffic is interrupted and the BGP session will be re-established.

·     Not configured—BGP NSR is disabled.

Location of preferred standby process

ID of the IRF member device by its member ID where the preferred standby process resides.

TCP NSR status

TCP NSR status:

·     Ready—TCP NSR has backed up TCP connection information from the active process to the standby process.

·     Not ready—TCP NSR is backing up TCP connection information from the active process to the standby process.

 

display bgp paths

Use display bgp paths to display BGP path attribute information.

Syntax

display bgp paths [ as-regular-expression ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

as-regular-expression: Displays information about BGP path attributes whose AS_PATH attribute matches the specified regular expression. The as-regular-expression argument is a string of 1 to 256 characters. If you do not specify this argument, the command displays information about all BGP path attributes.

Examples

# Display information about all BGP path attributes.

<Sysname> display bgp paths

 

  RefCount    MED         Path/Origin

  3           0           ?

  2           0           100i

  3           0           100i

  1           0           ?

  1           0           ?

  1           0           ?

Table 7 Command output

Field

Description

RefCount

Number of BGP routes with these path attributes.

MED

MULTI_EXIT_DISC attribute.

Path/Origin

AS_PATH and ORIGIN attributes of the route:

·     AS_PATH attributeRecords the ASs the route has passed to avoid routing loops.

·     ORIGIN attribute—Identifies the origin of the route:

¡     i—Originated in the AS. The origin of routes advertised with the network command is IGP.

¡     e—Learned through EGP.

¡     ?—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE.

 

display bgp peer

Use display bgp peer to display BGP peer or peer group information.

Syntax

display bgp peer ipv4 [ unicast ] [ vpn-instance vpn-instance-name ] [ ip-address mask-length | { ip-address | group-name group-name } log-info | [ [ ip-address ] verbose ] [ standby slot slot-number] ]

display bgp peer ipv6 [ unicast ] [ vpn-instance vpn-instance-name ] [ ipv6-address prefix-length | { ipv6-address | group-name group-name } log-info | [ [ ipv6-address ] verbose ] [ standby slot slot-number ] ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

ipv4: Displays IPv4 BGP peer or peer group information.

unicast: Displays BGP unicast peer or peer group information. If you do not specify this keyword, the command also displays BGP unicast peer or peer group information.

ipv6: Displays IPv6 BGP peer or peer group information.

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP peer or peer group information for the public network.

group-name group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters.

ip-address: Specifies a peer by its IP address.

log-info: Displays log information.

verbose: Displays detailed information.

standby: Display BGP peer or peer group information for a standby BGP process. If you do not specify a standby BGP process, this command displays BGP peer or peer group information for the active BGP process.

slot slot-number: Specifies the member ID of the on the specified device. The slot-number argument specifies the IRF member device by its member ID.

Usage guidelines

If you do not specify any parameters, this command displays brief information about all BGP peers for the specified address family.

Examples

# Display brief information about all BGP IPv4 unicast peers for the active BGP process on the public network.

<Sysname> display bgp peer ipv4

 

 BGP local router ID: 192.168.100.1

 Local AS number: 100

 Total number of peers: 1                  Peers in established state: 1

 

  Peer                    AS  MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

 

  10.2.1.2               200       13       16    0       0 00:10:34 Established

# Display brief information about all BGP IPv4 unicast peers for the standby BGP process on the public network.

<Sysname> display bgp peer ipv4 standby slot 1

 

 BGP local router ID: 192.168.100.1

 Local AS number: 100

 Total number of peers: 1                  Peers in established state: 1

 

  Peer                    AS  MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

 

  10.2.1.2               200        -        -    -       - 00:01:05 Established

Table 8 Command output

Field

Description

Peer

IP or IPv6 address of the peer.

AS

AS number of the peer.

MsgRcvd

Number of messages received.

MsgSent

Number of messages sent.

OutQ

Number of messages to be sent.

PrefRcv

For the IPv4 and IPv6 address families, this field displays the number of prefixes received from the peer.

Up/Down

Lasting time of the current BGP session state.

State

Current state of the BGP session between the local router and the peer.

 

# Display detailed information about BGP IPv4 unicast peer 10.2.1.2 on the public network.

<Sysname> display bgp peer ipv4 10.2.1.2 verbose

 

         Peer: 10.2.1.2  Local: 192.168.100.1

         Type: EBGP link

         BGP version 4, remote router ID 192.168.100.2

         BGP current state: Established, Up for 00h11m10s

         BGP current event: RecvKeepalive

         BGP last state: OpenConfirm

         Port:  Local - 179      Remote - 60672

         Configured: Active Hold Time: 180 sec   Keepalive Time: 60 sec

         Received  : Active Hold Time: 180 sec

         Negotiated: Active Hold Time: 180 sec   Keepalive Time: 60 sec

         Peer optional capabilities:

         Peer support BGP multi-protocol extended

         Peer support BGP route refresh capability

         Peer support BGP route AS4 capability

         Address family IPv4 Unicast: advertised and received

 

 Received: Total 13 messages, Update messages 0

 Sent: Total 16 messages, Update messages 0

 Maximum allowed prefix number: 4294967295

 Threshold: 75%

 Minimum time between advertisements is 30 seconds

 Optional capabilities:

  Multi-protocol extended capability has been enabled

  Route refresh capability has been enabled

 Peer Preferred Value: 0

 BFD: Enabled

 

 Routing policy configured:

 No routing policy is configured

 

# Display detailed information about BGP IPv4 unicast peer 10.2.1.2 for the standby BGP process on the public network.

<Sysname> display bgp peer ipv4 10.2.1.2 verbose standby slot 1

 

         Peer: 10.2.1.2          Local: 192.168.100.1

         Type: EBGP link

         BGP version 4, remote router ID 192.168.100.2

         BGP current state: Established, Up for 00h11m10s

         BGP current event: -

         BGP last state: -

         Port:  Local - 179      Remote - 60672

         Configured: Active Hold Time: 180 sec   Keepalive Time: 60 sec

         Received  : Active Hold Time: 180 sec

         Negotiated: Active Hold Time: 180 sec   Keepalive Time: 60 sec

         Peer optional capabilities:

         Peer support BGP multi-protocol extended

         Peer support BGP route refresh capability

         Peer support BGP route AS4 capability

         Address family IPv4 Unicast: advertised and received

 

 InQ updates: -, OutQ updates: -

 NLRI statistics:

         Rcvd:   UnReach NLRI          -,      Reach NLRI          -

         Sent:   UnReach NLRI          -,      Reach NLRI          -

 

 Message statistics:

 Msg type     Last rcvd time/      Current rcvd count/      History rcvd count/

              Last sent time       Current sent count       History sent count

 Open         -                    -                        -

              -                    -                        -

 Update       -                    -                        -

              -                    -                        -

 Notification -                    -                        -

              -                    -                        -

 Keepalive    -                    -                        -

              -                    -                        -

 RouteRefresh -                    -                        -

              -                    -                        -

 Total        -                    -                        -

              -                    -                        -

 

 Maximum allowed prefix number: 4294967295

 Threshold: 75%

 Minimum time between advertisements is 30 seconds

 Optional capabilities:

  Multi-protocol extended capability has been enabled

  Route refresh capability has been enabled

 Peer Preferred Value: 0

 BFD: Enabled

 Site-of-Origin: Not specified

 

 Routing policy configured:

 No routing policy is configured

# Display detailed information about BGP IPv6 unicast peer 1::2 for the active BGP process on the public network.

<Sysname> display bgp peer ipv6 1::2 verbose

 

         Peer: 1::2      Local: 192.168.1.136

         Type: EBGP link

         BGP version 4, remote router ID 192.168.1.135

         BGP current state: Established, Up for 00h05m48s

         BGP current event: RecvKeepalive

         BGP last state: OpenConfirm

         Port:  Local - 13184    Remote - 179

         Configured: Active Hold Time: 180 sec   Keepalive Time: 60 sec

         Received  : Active Hold Time: 180 sec

         Negotiated: Active Hold Time: 180 sec   Keepalive Time: 60 sec

         Peer optional capabilities:

         Peer support BGP multi-protocol extended

         Peer support BGP route refresh capability

         Peer support BGP route AS4 capability

         Address family IPv6 Unicast: advertised and received

 

 Received: Total 9 messages, Update messages 1

 Sent: Total 10 messages, Update messages 1

 Maximum allowed prefix number: 4294967295

 Threshold: 75%

 Minimum time between advertisements is 30 seconds

 Optional capabilities:

  Multi-protocol extended capability has been enabled

  Route refresh capability has been enabled

 Peer preferred value: 0

 BFD: Enabled

 IPsec profile name: profile001

 

 Routing policy configured:

 No routing policy is configured

Table 9 Command output

Field

Description

 

Peer

IP address of the peer.

 

Local

Local router ID.

 

Type

BGP connection type between the local router and the peer:

·     IBGP linkIBGP connection.

·     EBGP linkEBGP connection.

 

remote router ID

Router ID of the peer.

 

BGP current state

Current state of the BGP session between the local router and the peer.

 

Up for

Lasting time of the BGP session.

 

BGP current event

Current event of the BGP session between the local router and the peer.

 

BGP last state

Previous state of the BGP session.

 

Port

TCP port numbers of the local router and its peer.

 

Configured

Timers configured on the local router in seconds, including the holdtime (Active Hold Time) and keepalive interval (Keepalive Time).

 

Received

Received timer (configured on the peer) in seconds, including the holdtime (Active Hold Time).

 

Negotiated

Negotiated timers in seconds, including the holdtime (Active Hold Time) and keepalive interval (Keepalive Time).

 

Peer optional capabilities

Optional capabilities supported by the peer.

 

Peer support BGP route AS4 capability

The peer supports 4-byte AS number.

 

Address family IPv4 Unicast

IPv4 unicast address family capability: Routes of the address family can be advertised and received.

 

Address family IPv6 Unicast

IPv6 unicast address family capability.

 

InQ updates

Number of received updates to be processed.

OutQ updates

Number of updates to be sent to the peer.

NLRI statistics

Number of the reachable and unreachable routes received from and sent to the peer after the BGP session is established.

Message statistics

BGP message statistics.

Msg type

BGP message type.

Last rcvd time/Last sent time

Time when the most recent BGP message was received from or sent to the peer.

Current rcvd count/Current sent count

Number of BGP messages received from or sent to the peer on the current BGP session.

History rcvd count/History sent count

Number of BGP messages received from or sent to the peer since the BGP peer relationship was established.

Total

Total number of received and sent messages.

Maximum allowed prefix number

Maximum number of routes allowed to learn from the peer.

Threshold

Percentage of received routes from the peer to maximum routes allowed to learn from the peer. If the percentage is reached, the system generates alarm messages.

Minimum time between advertisements

Minimum route advertisement interval in seconds.

Optional capabilities

Optional capabilities supported by the local end.

Peer Preferred Value

Preferred value specified for the routes from the peer.

BFD

Whether BFD is enabled to detect the link to the BGP peer.

IPsec profile name

IPsec profile applied to the IPv6 BGP peer.

This field is available only for the IPv6 unicast and IPv6 multicast address families.

Site-of-Origin

This field is not supported in the current software version.

Site of Origin (SoO) attribute configured for the peer.

Routing policy configured

This field is not supported in the current software version.

Routing policy configured for the peer.

If you do not specify a routing policy, this field displays No routing policy is configured.

 

# Display log information for BGP IPv4 unicast peer 81.2.1.1 for the public network.

<Sysname>display bgp peer ipv4 81.2.1.1 log-info

 

 Peer: 81.2.1.1

 

     Date      Time    State Notification

                             Error/SubError

 

  20-May-2014 16:37:38 Down  Send notification with error 3/5

                             UPDATE Message Error/Attribute Length Error

                            <ORIGIN attribute length error>

  20-May-2014 16:37:33 Up

  20-May-2014 16:37:22 Down  Send notification with error 3/11

                             UPDATE Message Error/Malformed AS_PATH

                             <malformed AS_PATH>

20-May-2014 16:37:04 Up

Table 10 Command output

Field

Description

Peer

IP or IPv6 address of the peer.

Date

Date on which the Notification was sent or received.

Time

Time at which the Notification was sent or received.

State

BGP session state:

·     UpThe BGP session is in Established state.

·     DownThe BGP session is down.

Notification Error/SubError

Error code of the Notification, indicating the cause of why the BGP session is down.

·     Error—Refers to the error code, which identifies the type of the Notification.

·     SubError—Refers to the error subcode of the Notification, which identifies the specific information about the reported error.

 

display bgp routing-table dampened ipv4 unicast

Use display bgp routing-table dampened ipv4 unicast to display dampened BGP IPv4 unicast routes.

Syntax

display bgp routing-table dampened ipv4 [ unicast ] [ vpn-instance vpn-instance-name ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays dampened BGP IPv4 unicast routes for the public network.

Usage guidelines

This command displays dampened BGP IPv4 unicast routes regardless of whether the unicast keyword is specified.

Examples

# Display dampened BGP IPv4 unicast routes.

<Sysname> display bgp routing-table dampened ipv4

 

 Total number of routes: 1

 

 BGP local router ID is 192.168.1.135

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

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

 

     Network            From            Reuse                         Path/Ogn

 

  de 20.1.1.0/24        10.1.1.2        00:56:27                      100i

Table 11 Command output

Field

Description

Status codes

Status codes:

·     * – valid—Valid route.

·     > – best—Best route.

·     d – dampened—Dampened route.

·     h – history—History route.

·     s – suppressed—Suppressed route.

·     S – stale—Stale route.

·     i – internal—Internal route.

·     e – external—External route.

Origin

Origin of the route:

·     i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP.

·     e – EGP—Learned through EGP.

·     ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE.

Network

Destination network address.

From

IP address from which the route was received.

Reuse

Reuse time of the route.

Path/Ogn

AS_PATH and ORIGIN attributes of the route:

·     AS_PATH attributeRecords the ASs the route has passed to avoid routing loops.

·     ORIGIN attribute—Identifies the origin of the route.

 

Related commands

·     dampening

·     reset bgp dampening ipv4 unicast

display bgp routing-table dampened ipv6 unicast

Use display bgp routing-table dampened ipv6 unicast to display dampened BGP IPv6 unicast routes.

Syntax

display bgp routing-table dampened ipv6 [ unicast ] [ vpn-instance vpn-instance-name ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays dampened BGP IPv6 unicast routes for the public network.

Usage guidelines

This command displays dampened BGP IPv6 unicast routes regardless of whether the unicast keyword is specified.

Examples

# Display dampened BGP IPv6 unicast routes.

<Sysname> display bgp routing-table dampened ipv6

 

 Total number of routes: 2

 

 BGP local router ID is 192.168.1.135

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

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

 

  de Network : 2::                                      PrefixLen : 64

     From    : 10.1.1.1                                 Reuse     : 00:39:49

     Path/Ogn: 100i

 

  de Network : 2::                                      PrefixLen : 64

     From    : 1::1                                     Reuse     : 00:39:49

     Path/Ogn: 100i

Table 12 Command output

Field

Description

Status codes

Status codes:

·     * – valid—Valid route.

·     > – best—Best route.

·     d – dampened—Dampened route.

·     h – history—History route.

·     s – suppressed—Suppressed route.

·     S – stale—Stale route.

·     i – internal—Internal route.

·     e – external—External route.

Origin

Origin of the route:

·     i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP.

·     e – EGP—Learned through EGP.

·     ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE.

Network

Destination network address.

From

IP address from which the route was received.

Reuse

Reuse time of the route.

Path/Ogn

AS_PATH and ORIGIN attributes of the route:

·     AS_PATH attributeRecords the ASs the route has passed to avoid routing loops.

·     ORIGIN attribute—Identifies the origin of the route.

 

Related commands

·     dampening

·     reset bgp dampening ipv6 unicast

display bgp routing-table flap-info ipv4 unicast

Use display bgp routing-table flap-info ipv4 unicast to display BGP IPv4 unicast route flap statistics.

Syntax

display bgp routing-table flap-info ipv4 [ unicast ] [ vpn-instance vpn-instance-name ] [ network-address [ { mask | mask-length } [ longest-match ] ] ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP IPv4 unicast route flap statistics for the public.

network-address: Specifies a destination network address.

mask: Specifies a network mask, in dotted decimal notation.

mask-length: Specifies a mask length in the range of 0 to 32.

longest-match: Displays the routing entries selected through the following steps:

1.     AND the specified network address with the specified mask.

2.     Display the route with the longest mask among the matching routes that have a mask shorter than or equal to the specified mask.

Usage guidelines

If you do not specify the network-address, mask, and mask-length arguments, the command displays flap statistics of all BGP IPv4 unicast routes for the public network or the specified VPN.

If you specify only the network-address argument, the system ANDs the network address with the mask of a route. If the result matches the network address of the route, the command displays flap statistics of the route.

If you specify the network-address mask or network-address mask-length argument, and do not specify the longest-match keyword, the command displays flap statistics of the BGP IPv4 unicast route that matches both the specified destination network address and the mask (or mask length).

This command displays BGP IPv4 unicast route flap statistics regardless of whether the unicast keyword is specified.

Examples

# Display BGP IPv4 unicast route flap statistics for the public network.

<Sysname> display bgp routing-table flap-info ipv4

 

 Total number of routes: 1

 

 BGP local router ID is 192.168.1.135

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

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

 

     Network            From            Flaps  Duration  Reuse        Path/Ogn

 

  de 20.1.1.0/24        10.1.1.2        1      00:02:36  00:53:58     100i

Table 13 Command output

Field

Description

Status codes

Status codes:

·     * – valid—Valid route.

·     > – best—Best route.

·     d – dampened—Dampened route.

·     h – history—History route.

·     s – suppressed—Suppressed route.

·     S – stale—Stale route.

·     i – internal—Internal route.

·     e – external—External route.

Origin

Origin of the route:

·     i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP.

·     e – EGP—Learned through EGP.

·     ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE.

Network

Destination network address.

From

Source IP address of the route.

Flaps

Number of routing flaps.

Duration

Duration time of the flap route.

Reuse

Reuse time of the route.

Path/Ogn

AS_PATH and ORIGIN attributes of the route:

·     AS_PATH attribute—Records the ASs the route has passed to avoid routing loops.

·     ORIGIN attribute—Identifies the origin of the route.

 

Related commands

·     dampening

·     reset bgp flap-info ipv4 unicast

display bgp routing-table flap-info ipv6 unicast

Use display bgp routing-table flap-info ipv6 unicast to display BGP IPv6 unicast route flap statistics.

Syntax

display bgp routing-table flap-info ipv6 [ unicast ] [ vpn-instance vpn-instance-name ] [ network-address prefix-length ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP IPv6 unicast route flap statistics for the public network.

network-address prefix-length: Specifies the destination network address and prefix length. The value range for the prefix-length argument is 0 to 128.

Usage guidelines

This command displays BGP IPv6 unicast route flap statistics regardless of whether the unicast keyword is specified.

If you do not specify any parameters, this command displays flap statistics of all BGP IPv6 unicast routes for the public network.

Examples

# Display BGP IPv6 unicast route flap statistics for the public network.

<Sysname> display bgp routing-table flap-info ipv6

 

 Total number of routes: 2

 

 BGP local router ID is 192.168.1.135

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

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

 

  de Network : 2::                                      PrefixLen : 64

     From    : 10.1.1.1                                 Flaps     : 5

     Duration: 00:03:25                                 Reuse     : 00:39:28

     Path/Ogn: 100i

 

  de Network : 2::                                      PrefixLen : 64

     From    : 1::1                                     Flaps     : 5

     Duration: 00:03:25                                 Reuse     : 00:39:28

     Path/Ogn: 100i

Table 14 Command output

Field

Description

Status codes

Status codes:

·     * – valid—Valid route.

·     > – best—Best route.

·     d – dampened—Dampened route.

·     h – history—History route.

·     s – suppressed—Suppressed route.

·     S – stale—Stale route.

·     i – internal—Internal route.

·     e – external—External route.

Origin

Origin of the route:

·     i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP.

·     e – EGP—Learned through EGP.

·     ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE.

Network

Destination network address.

PrefixLen

Prefix length of the destination network address.

From

Source IP address of the route.

Flaps

Number of routing flaps.

Duration

Duration time of the flap route.

Reuse

Reuse time of the route.

Path/Ogn

AS_PATH and ORIGIN attributes of the route:

·     AS_PATH attribute—Records the ASs the route has passed to avoid routing loops.

·     ORIGIN attribute—Identifies the origin of the route.

 

Related commands

·     dampening

·     reset bgp flap-info ipv6 unicast

display bgp routing-table ipv4 unicast

Use display bgp routing-table ipv4 unicast to display BGP IPv4 unicast routing information.

Syntax

display bgp routing-table ipv4 [ unicast ] [ vpn-instance vpn-instance-name ] [ network-address [ { mask | mask-length } [ longest-match ] ] ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays the BGP IPv4 unicast routing information for the public network.

network-address: Specifies a destination network address.

mask: Specifies a network mask, in dotted decimal notation.

mask-length: Specifies a mask length in the range of 0 to 32.

longest-match: Displays the routing entries selected through the following steps:

1.     AND the specified network address with the specified mask.

2.     Display the route with the longest mask among the matching routes that have a mask shorter than or equal to the specified mask.

Usage guidelines

If you do not specify the network-address, mask, and mask-length arguments, the command displays brief information about all BGP IPv4 unicast routes.

If you specify only the network-address argument, the system ANDs the network address with the mask of a route. If the result matches the network address of the route, the command displays detailed information about the route.

If you specify the network-address mask or network-address mask-length argument and do not specify the longest-match keyword, the command displays detailed information about the BGP IPv4 unicast route that matches both the specified destination network address and the mask (or mask length).

This command displays BGP IPv4 unicast routing information regardless of whether the unicast keyword is specified.

Examples

# Display brief information about all BGP IPv4 unicast routes for the public network.

<Sysname> display bgp routing-table ipv4

 

 Total number of routes: 4

 

 BGP local router ID is 192.168.100.1

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

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

 

     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn

 

* >  10.2.1.0/24        10.2.1.1        0                     0       i

   e                    10.2.1.2        0                     0       200i

* >  192.168.1.0        192.168.1.135   0                     0       i

*  e                    10.2.1.2        0                     0       200i

Table 15 Command output

Field

Description

Status codes

Status codes:

·     * – valid—Valid route.

·     > – best—Best route.

·     d – dampened—Dampened route.

·     h – history—History route.

·     s – suppressed—Suppressed route.

·     S – stale—Stale route.

·     i – internal—Internal route.

·     e – external—External route.

Origin

Origin of the route:

·     i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP.

·     e – EGP—Learned through EGP.

·     ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE.

Network

Destination network address.

NextHop

Next hop IP address.

MED

MULTI_EXIT_DISC attribute.

LocPrf

Local preference value.

PrefVal

Preferred value of the route.

Path/Ogn

AS_PATH and ORIGIN attributes of the route:

·     AS_PATHRecords the ASs the route has passed to avoid routing loops.

·     ORIGIN—Identifies the origin of the route.

 

# Display detailed information about BGP IPv4 unicast routes destined to network 10.2.1.0/24 for the public network.

<Sysname> display bgp routing-table ipv4 10.2.1.0 24

 

 BGP local router ID: 192.168.100.1

 Local AS number: 100

 

 Paths:   2 available, 1 best

 

 BGP routing table information of 10.2.1.0/24:

 Imported route.

 Original nexthop: 10.2.1.1

 OutLabel        : NULL

 AS-path         : (null)

 Origin          : igp

 Attribute value : MED 0, pref-val 0, pre 0

 State           : valid, local, best,

 

 From            : 10.2.1.2 (192.168.100.2)

 Relay nexthop   : not resolved

 Original nexthop: 10.2.1.2

 OutLabel        : NULL

 AS-path         : 200

 Origin          : igp

 Attribute value : MED 0, pref-val 0, pre 255

 State           : external,

Table 16 Command output

Field

Description

Paths

Number of routes:

·     available—Number of valid routes.

·     best—Number of optimal routes.

Original nexthop

Original next hop of the route. If the route is received from a BGP update message, the original next hop is the next hop IP address in the message.

OutLabel

This field is not supported in the current software version.

Outgoing label of the route.

AS-path

AS_PATH attribute of the route, which records the ASs the route has passed to avoid routing loops.

Origin

Origin of the route:

·     igp—Originated in the AS. The origin of routes advertised with the network command is IGP.

·     egp—Learned through EGP.

·     incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE.

Attribute value

BGP path attributes:

·     MED—MED value.

·     localprefLocal preference value.

·     pref-valPreferred value.

·     pre—Route preference.

State

Current state of the route:

·     valid.

·     internal.

·     external.

·     local.

·     synchronize.

·     best.

From

IP address of BGP peer that advertised the route.

Relay Nexthop

Next hop found by route recursion. If no next hop is found, this field displays not resolved.

 

display bgp routing-table ipv4 unicast advertise-info

Use display bgp routing-table ipv4 unicast advertise-info to display advertisement information for BGP IPv4 unicast routes.

Syntax

display bgp routing-table ipv4 [ unicast ] [ vpn-instance vpn-instance-name ] network-address [ mask | mask-length ] advertise-info

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays advertisement information of BGP IPv4 unicast routes for the public network.

network-address: Specifies a destination network address.

mask: Specifies a network mask, in dotted decimal notation.

mask-length: Specifies a mask length in the range of 0 to 32.

Usage guidelines

If you do not specify the mask and mask-length arguments, the system ANDs the specified network address with the mask of a route. If the result matches the network address of the route, the command displays advertisement information for the route.

If you specify the mask or mask-length argument, the command displays advertisement information for the BGP IPv4 unicast route that matches both the specified destination network address and the mask (or mask length).

This command displays advertisement information for BGP IPv4 unicast routes regardless of whether the unicast keyword is specified.

Examples

# Display advertisement information of BGP IPv4 unicast routes destined to network 10.2.1.0/24 for the public network.

<Sysname> display bgp routing-table ipv4 10.2.1.0 24 advertise-info

 

 BGP local router ID: 192.168.100.1

 Local AS number: 100

 

 Paths:   1 best

 

 BGP routing table information of 10.2.1.0/24:

 Advertised to peers (1 in total):

    10.2.1.2

Table 17 Command output

Field

Description

Paths

Number of optimal routes destined to the specified network.

BGP routing table information of 10.2.1.0/24

Advertisement information of BGP routes destined to network 10.2.1.0/24.

Advertised to peers (1 in total)

Peers to which the route has been advertised and the number of peers.

 

display bgp routing-table ipv4 unicast peer

Use display bgp routing-table ipv4 unicast peer to display BGP IPv4 unicast routing information advertised to or received from the specified BGP peer.

Syntax

display bgp routing-table ipv4 [ unicast ] [ vpn-instance vpn-instance-name ] peer ip-address { advertised-routes | received-routes } [ network-address [ mask | mask-length ] | statistics ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP IPv4 unicast routing information advertised to or received from the specified BGP peer for the public network.

ip-address: Specifies a peer by its IP address.

advertised-routes: Displays routing information advertised to the specified peer.

received-routes: Displays routing information received from the specified peer.

network-address: Specifies the IP address of the destination network.

mask: Specifies the mask of the destination network, in dotted decimal notation.

mask-length: Specifies a mask length in the range of 0 to 32.

statistics: Displays route statistics.

Usage guidelines

If you do not specify the network-address, mask, and mask-length arguments, this command displays all BGP IPv4 unicast routing information advertised to or received from the specified BGP peer.

If you specify only the network-address argument, the system ANDs the network address with the mask of a route. If the result matches the network address of the route, the command displays information about the route.

If you specify the network-address mask or network-address mask-length argument, this command displays information about the route that matches both the specified destination network address and the mask (or mask length).

This command displays BGP IPv4 unicast routing information advertised to or received from the specified BGP peer regardless of whether the unicast keyword is specified.

Examples

# Display all BGP IPv4 unicast routing information advertised to BGP peer 10.2.1.2 for the public network.

<Sysname> display bgp routing-table ipv4 peer 10.2.1.2 advertised-routes

 

 Total number of routes: 2

 

 BGP local router ID is 192.168.100.1

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

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

 

     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn

 

* >  10.2.1.0/24        10.2.1.1        0                     0       i

* >  192.168.1.0        192.168.1.135   0                     0       i

# Display all BGP IPv4 unicast routing information received from BGP peer 10.2.1.2 for the public network.

<Sysname> display bgp routing-table ipv4 peer 10.2.1.2 received-routes

 

 Total number of routes: 2

 

 BGP local router ID is 192.168.100.1

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

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

 

     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn

 

   e 10.2.1.0/24        10.2.1.2        0                     0       200i

*  e 192.168.1.0        10.2.1.2        0                     0       200i

For command output, see Table 15.

# Display statistics of BGP IPv4 unicast routes advertised to BGP peer 10.2.1.2 for the public network.

<Sysname> display bgp routing-table ipv4 peer 10.2.1.2 advertised-routes statistics

 

 Advertised routes total: 2

# Display statistics of BGP IPv4 unicast routes received from BGP peer 10.2.1.2 for the public network.

<Sysname> display bgp routing-table ipv4 peer 10.2.1.2 received-routes statistics

 

 Received routes total: 2

Table 18 Command output

Field

Description

Advertised routes total

Total number of routes advertised to the specified peer.

Received routes total

Total number of routes received from the specified peer.

 

display bgp routing-table ipv4 unicast statistics

Use display bgp routing-table ipv4 unicast statistics to display BGP IPv4 unicast route statistics.

Syntax

display bgp routing-table ipv4 [ unicast ] [ vpn-instance vpn-instance-name ] statistics

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays the BGP IPv4 unicast route statistics for the public network.

Usage guidelines

This command displays BGP IPv4 unicast route statistics regardless of whether the unicast keyword is specified.

Examples

# Display statistics of BGP IPv4 unicast routes for the public network.

<Sysname> display bgp routing-table ipv4 statistics

 

 Total number of routes: 4

display bgp routing-table ipv6 unicast

Use display bgp routing-table ipv6 unicast to display BGP IPv6 unicast routing information.

Syntax

display bgp routing-table ipv6 [ unicast ] [ vpn-instance vpn-instance-name ] [ network-address prefix-length | advertise-info ] ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays the BGP IPv6 unicast routing information for the public network.

network-address prefix-length: Specifies the destination network address and prefix length. The value range for the prefix-length argument is 0 to 128. If you do not specify this argument, the command displays brief information about all BGP IPv6 unicast routing information.

advertise-info: Displays advertisement information for BGP IPv6 unicast routes. If you do not specify this keyword, the command displays the BGP IPv6 unicast routing table.

Usage guidelines

This command displays BGP IPv6 unicast routing information regardless of whether the unicast keyword is specified.

Examples

# Display brief information about all BGP IPv6 unicast routes for the public network.

<Sysname> display bgp routing-table ipv6

 

 Total number of routes: 1

 

 BGP local router ID is 192.168.1.136

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

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

 

* >e Network : 3::                                      PrefixLen : 64

     NextHop : 1::2                                     LocPrf    :

     PrefVal : 0                                        OutLabel  : NULL

     MED     :

     Path/Ogn: 100i

Table 19 Command output

Field

Description

Status codes

Status codes:

·     * – valid—Valid route.

·     > – best—Best route.

·     d – dampened—Dampened route.

·     h – history—History route.

·     s – suppressed—Suppressed route.

·     S – stale—Stale route.

·     i – internal—Internal route.

·     e – external—External route.

Origin

Origin of the route:

·     i – IGP—Originated in the AS. The origin of routes advertised with the network command is IGP.

·     e – EGP—Learned through EGP.

·     ?– incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE.

Network

Destination network address.

PrefixLen

Prefix length of the destination network address.

NextHop

Next hop IPv6 address.

LocPrf

Local preference value.

PrefVal

Preferred value of the route.

OutLabel

This field is not supported in the current software version.

Outgoing label of the route.

MED

MULTI_EXIT_DISC attribute.

Path/Ogn

AS_PATH and ORIGIN attributes of the route:

·     AS_PATH attribute—Records the ASs the route has passed to avoid routing loops.

·     ORIGIN attribute—Identifies the origin of the route.

 

# Display detailed information about BGP IPv6 unicast routes destined to network 2::/64 for the public network.

<Sysname> display bgp routing-table ipv6 2:: 64

 

 BGP local router ID: 192.168.1.135

 Local AS number: 200

 

 Paths:   2 available, 1 best

 

 BGP routing table information of 2::/64:

 From            : 10.1.1.1 (192.168.1.136)

 Relay nexthop   : ::FFFF:10.1.1.1

 Original nexthop: ::FFFF:10.1.1.1

 OutLabel        : NULL

 AS-path         : 100

 Origin          : igp

 Attribute value : MED 0, pref-val 0

 State           : valid, external, best,

 

 From            : 1::1 (192.168.1.136)

 Relay nexthop   : 1::1

 Original nexthop: 1::1

 OutLabel        : NULL

 AS-path         : 100

 Origin          : igp

 Attribute value : MED 0, pref-val 0

 State           : valid, external,

Table 20 Command output

Field

Description

Paths

Number of routes:

·     available—Number of valid routes.

·     best—Number of optimal routes.

Original nexthop

Original next hop of the route. If the route is received from a BGP update message, the original next hop is the next hop IP address in the message.

OutLabel

This field is not supported in the current software version.

Outgoing label of the route.

AS-path

AS_PATH attribute of the route, which records the ASs the route has passed to avoid routing loops.

Origin

Origin of the route:

·     igp—Originated in the AS. The origin of routes advertised with the network command is IGP.

·     egp—Learned through EGP.

·     incomplete—Unknown origin. The origin of routes redistributed from IGP protocols is INCOMPLETE.

Attribute value

BGP path attributes:

·     MED—MED value.

·     localprefLocal preference value.

·     pref-valPreferred value.

·     pre—Route preference.

State

Current state of the route:

·     valid.

·     internal.

·     external.

·     local.

·     best.

From

IP address of BGP peer that advertised the route.

Relay Nexthop

Next hop found by route recursion. If no next hop is found, this field displays not resolved.

 

# Display advertisement information about BGP IPv6 unicast routes destined to network 2::/64 for the public network.

<Sysname> display bgp routing-table ipv6 2:: 64 advertise-info

 

 BGP local router ID: 192.168.1.136

 Local AS number: 100

 

 Paths:   1 best

 

 BGP routing table information of 2::/64:

 Advertised to peers (2 in total):

    10.1.1.2

    1::2

Table 21 Command output

Field

Description

Paths

Number of optimal routes destined to the specified network.

BGP routing table information of 2::/64

Advertisement information of BGP routes destined to network 2::/64.

Advertised to peers (2 in total)

Peers to which the route has been advertised, and the number of peers.

 

display bgp routing-table ipv6 unicast peer

Use display bgp routing-table ipv6 unicast peer to display BGP IPv6 unicast routing information advertised to or received from a BGP peer.

Syntax

display bgp routing-table ipv6 [ unicast ] peer { ip-address | ipv6-address } { advertised-routes | received-routes } [ network-address prefix-length | statistics ]

display bgp routing-table ipv6 [ unicast ] vpn-instance vpn-instance-name peer ipv6-address { advertised-routes | received-routes } [ network-address prefix-length | statistics ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

ip-address: Specifies the IPv4 address of a peer.

ipv6-address: Specifies the IPv6 address of a peer.

advertised-routes: Displays routing information advertised to the specified peer.

received-routes: Displays routing information received from the specified peer.

network-address prefix-length: Specifies the destination network address and prefix length. The value range for the prefix-length argument is 0 to 128. If you do not specify this argument, the command displays all BGP IPv6 unicast routing information.

statistics: Displays route statistics.

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays the BGP IPv6 unicast routing information for the public network.

Usage guidelines

This command displays BGP IPv6 unicast routing information advertised to or received from the specified BGP peer regardless of whether the unicast keyword is specified.

Examples

# Display all BGP IPv6 unicast routing information advertised to BGP peer 1::1.

<Sysname> display bgp routing-table ipv6 peer 1::1 advertised-routes

 

 Total number of routes: 1

 

 BGP local router ID is 192.168.1.136

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

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

 

* >  Network : 2::                                      PrefixLen : 64

     NextHop : ::                                       LocPrf    :

     MED     : 0                                        OutLabel  : NULL

     Path/Ogn: i   

# Display all BGP IPv6 unicast routing information received from BGP peer 1::1.

<Sysname> display bgp routing-table ipv6 peer 1::1 received-routes

 

 Total number of routes: 1

 

 BGP local router ID is 192.168.1.135

 Status codes: * - valid, > - best, d - dampened, h - history,

               s - suppressed, S - stale, i - internal, e - external

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

 

* >e Network : 2::                                      PrefixLen : 64

     NextHop : ::FFFF:10.1.1.1                          LocPrf    :

     PrefVal : 0                                        OutLabel  : NULL

     MED     : 0

     Path/Ogn: 100i

For command output, see Table 19.

# Display statistics of BGP IPv6 unicast routes advertised to BGP peer 1::1.

<Sysname> display bgp routing-table ipv6 peer 1::1 advertised-routes statistics

 

 Advertised routes total: 1

# Display statistics of BGP IPv6 unicast routes received from BGP peer 1::1.

<Sysname> display bgp routing-table ipv6 peer 1::1 received-routes statistics

 

 Received routes total: 1

Table 22 Command output

Field

Description

Advertised routes total

Total number of routes advertised to the specified peer.

Received routes total

Total number of routes received from the specified peer.

 

display bgp routing-table ipv6 unicast statistics

Use display bgp routing-table ipv6 unicast statistics to display BGP IPv6 unicast route statistics.

Syntax

display bgp routing-table ipv6 [ unicast ] [ vpn-instance vpn-instance-name ] statistics

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays the BGP IPv6 unicast route statistics for the public network.

Usage guidelines

This command displays BGP IPv6 unicast route statistics regardless of whether the unicast keyword is specified.

Examples

# Display statistics of BGP IPv6 unicast routes.

<Sysname> display bgp routing-table ipv6 statistics

 

 Total number of routes: 4

display bgp update-group

Use display bgp update-group to display BGP update group information.

Syntax

display bgp update-group ipv4 [ unicast ] [ vpn-instance vpn-instance-name ] [ ip-address ]

display bgp update-group ipv6 [ unicast ] [ vpn-instance vpn-instance-name ] [ ipv6-address ]

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

ipv4: Displays BGP update group information for IPv4 address family.

unicast: Displays BGP update group information for unicast address family. If you do not specify this keyword, the command also displays BGP update group information for unicast address family.

ipv6: Displays BGP update group information for IPv6 address family.

vpn-instance vpn-instance-name: Displays BGP update group information for the VPN instance specified by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command displays BGP update group information for the public network.

ip-address: Displays BGP update group information for the specified BGP peer.

ipv6-address: Displays BGP update group information for the specified IPv6 BGP peer.

Usage guidelines

The update group feature classifies BGP peers that have the same export policy into an update group. When BGP advertises routes to the peers in the update group, it uses the export policy to filter the routes and generates route updates for all the peers only once.

With this feature, BGP performs one-time policy filtering and encapsulation for a prefix before advertising the prefix to all the peers in the update group. For example, BGP advertises 1000 prefixes to 1000 peers that have the same export policy (in data centers for example). Without the update group feature, BGP matches the export policy 1000 × 1000 times. With the update group feature, BGP matches the export policy only 1000 × 1 times, improving encapsulation efficiency 1000 times.

If you do not specify any parameter, this command displays all update groups for the specified address family on the public network.

Examples

# Display information about all BGP update groups for the public network.

<Sysname> display bgp update-group ipv4

 

  Update-group ID: 0

  Type: EBGP link

  4-byte AS number: Supported

  Minimum time between advertisements: 30 seconds

  OutQ: 0

  Members: 1

    99.1.1.1

# Display update group information for peer 1.1.1.2 on the public network.

<Sysname> display bgp update-group ipv4 1.1.1.2

 

  Update-group ID: 0

  Type: EBGP link

  4-byte AS number: Supported

  Minimum time between advertisements: 30 seconds

  OutQ: 0

  Members: 2

    1.1.1.2

    1.1.1.3

Table 23 Command output

Field

Description

Update-group ID

ID of the update group.

Type

BGP link type:

·     IBGP link.

·     EBGP link.

·     Confed IBGP linkConfederation IBGP link.

·     Confed EBGP link—Confederation EBGP link.

Label capability: Supported

This field is not supported in the current software version.

The peers in the update group support labeled routes.

4-byte AS number: Supported

4-byte AS number suppression is disabled for the peers in the update group. The peers in the update group support 4-byte AS numbers.

4-byte AS number: Suppressed

4-byte AS number suppression is enabled for the peers in the update group.

Fake AS

A fake local AS number is configured for the peers in the update group.

Public-AS-Only: Yes

BGP route updates advertised to the peers in the update group only carry the public AS number without the private AS number. 

Substitute-AS: Yes

AS number substitution is enabled.

Minimum time between advertisements: number seconds

Minimum time between advertisements.

Advertising community: Yes

Community advertisement to peers in the update group is enabled.

Route-reflect client: Yes

The peer is a client of the route reflector.

Advertising extended community: Yes

Extended community advertisement to peers in the update group is enabled.

Export AS-path-ACL: as-path-acl-number

This field is not supported in the current software version.

AS path ACL used to filter BGP routes advertised to peers in the update group.

Export filter-policy: ACL acl-number

ACL used to filter BGP routes advertised to peers in the update group.

OutQ

Number of prefixes to be advertised to peers in the update group.

Members

Number and IP addresses of peers in the update group.

 

ebgp-interface-sensitive

Use ebgp-interface-sensitive to enable quick re-establishment of direct EBGP sessions.

Use undo ebgp-interface-sensitive to disable the function.

Syntax

ebgp-interface-sensitive

undo ebgp-interface-sensitive

Default

Quick re-establishment of direct EBGP sessions is enabled.

Views

BGP view

Predefined user roles

network-admin

Usage guidelines

When a direct link to an EBGP peer fails, BGP tears down the session and re-establishes a session to the peer immediately. If the function is not enabled, the router does not tear down the session until the holdtime expires. However, disabling this function can prevent routing flaps from affecting EBGP session state.

This command applies only to direct EBGP sessions.

Examples

# Enable quick re-establishment of direct EBGP sessions.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ebgp-interface-sensitive

filter-policy export

Use filter-policy export to filter advertised BGP routes.

Use undo filter-policy export to remove the route filter.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

filter-policy acl-number export [ protocol process-id ]

undo filter-policy export [ protocol process-id ]

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

filter-policy acl6-number export [ protocol process-id ]

undo filter-policy export [ protocol process-id ]

Default

Advertised BGP routes are not filtered.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

acl-number: Specifies an IPv4 ACL by its number in the range of 2000 to 3999, to match routes by destination.

acl6-number: Specifies an IPv6 ACL by its number in the range of 2000 to 3999, to match routes by destination.

protocol: Filters routes redistributed from the routing protocol.

·     In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view, it can be direct, isis, ospf, rip, or static.

·     In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view, it can be direct, isisv6, ospfv3, ripng, or static.

process-id: Specifies a routing protocol by its ID in the range of 1 to 65535.

·     In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view, it is available only when the protocol is isis, ospf, or rip.

·     In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view, it is available only when the protocol is isisv6, ospfv3, or ripng.

Usage guidelines

If you specify a protocol, this command filters only routes redistributed from the specified protocol. If no protocol is specified, this command filters all advertised routes, including the following routes:

·     Redistributed from IGP.

·     Injected by the network command.

·     Learned from BGP peers.

The following guidelines apply when you use an ACL in the command:

·     To filter routes with a specific destination address, use one of the following:

¡     A basic ACL (2000 to 2999).

¡     An advanced ACL that contain rules defined with the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard command.

·     To filter routes with a specific destination address and mask, use an advanced ACL that contains rules defined with the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard destination dest-addr dest-wildcard command.

·     If an ACL is used, BGP advertises only routes that match a permit rule in the ACL.

The sour-addr sour-wildcard argument combination matches the destination address of a route without matching the mask in the route.

The dest-addr dest-wildcard argument combination matches the subnet mask of the route without matching the destination address in the route. The dest-wildcard must be contiguous. Otherwise, the ACL rule does not take effect.

Examples

# In BGP IPv4 unicast address family view, use ACL 2000 to filter advertised BGP IPv4 routes.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] filter-policy 2000 export

# In BGP-VPN IPv6 unicast address family view, use ACL 2000 to filter advertised BGP IPv6 routes.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] filter-policy 2000 export

# Configure ACL 3000 to permit only route 113.0.0.0/16 to pass, and use ACL 3000 to filter advertised BGP routes.

<Sysname> system-view

[Sysname] acl number 3000

[Sysname-acl-adv-3000] rule 10 permit ip source 113.0.0.0 0 destination 255.255.0.0 0

[Sysname-acl-adv-3000] rule 100 deny ip

[Sysname-acl-adv-3000] quit

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] filter-policy 3000 export

Related commands

·     filter-policy import

·     peer filter-policy

filter-policy import

Use filter-policy import to filter received BGP routes.

Use undo filter-policy import to remove the filter.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

filter-policy acl-number import

undo filter-policy import

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

filter-policy acl6-number import

undo filter-policy import

Default

Received BGP routes are not filtered.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

acl-number: Specifies an ACL by its number in the range of 2000 to 3999, to match routes by destination.

acl6-number: Specifies an ACL6 by its number in the range of 2000 to 3999, to match routes by destination.

Usage guidelines

If you use a basic ACL (with a number from 2000 to 2999) configured with the rule [ rule-id ] { deny | permit } source source-address source-wildcard command, the command matches routes whose destination network addresses match the source-address source-wildcard argument. However, it does not match the masks of the destination addresses.

To use an advanced ACL (with a number from 3000 to 3999) in the command, configure the ACL using one of the following steps:

·     To deny/permit a route with the specified destination, use the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard command.

·     To deny/permit a route with the specified destination and mask, use the rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard destination dest-addr dest-wildcard command.

The source keyword specifies the destination address of a route and the destination keyword specifies the subnet mask of the destination. The subnet mask must be contiguous. Otherwise, the configuration does not take effect.

Examples

# In BGP IPv4 unicast address family view, use ACL 2000 to filter received BGP routes.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] filter-policy 2000 import

# In BGP-VPN IPv6 unicast address family view, use ACL6 2000 to filter received BGP routes.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] filter-policy 2000 import

# Configure ACL6 3000 to permit only route 113.0.0.0/16 to pass, and use ACL 3000 to filter received BGP routes.

<Sysname> system-view

[Sysname] acl number 3000

[Sysname-acl-adv-3000] rule 10 permit ip source 113.0.0.0 0 destination 255.255.0.0 0

[Sysname-acl-adv-3000] rule 100 deny ip

[Sysname-acl-adv-3000] quit

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] filter-policy 3000 import

Related commands

·     filter-policy export

·     peer filter-policy

graceful-restart

Use graceful-restart to enable BGP Graceful Restart (GR) capability.

Use undo graceful-restart to disable BGP GR capability.

Syntax

graceful-restart

undo graceful-restart

Default

BGP GR capability is disabled.

Views

BGP view

Predefined user roles

network-admin

Usage guidelines

GR ensures continuous forwarding when BGP restarts or an active/standby switchover occurs.

BGP peers exchange Open messages containing GR information. If both parties have GR capability, they establish a GR-capable session.

After you execute this command, the device re-establishes BGP sessions.

Examples

# Enable GR capability for BGP process 100.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] graceful-restart

Related commands

·     graceful-restart timer purge-time

·     graceful-restart timer restart

·     graceful-restart timer wait-for-rib

graceful-restart timer purge-time

Use graceful-restart timer purge-time to set the Routing Information Base (RIB) purge timer.

Use undo graceful-restart timer purge-time to restore the default.

Syntax

graceful-restart timer purge-time timer

undo graceful-restart timer purge-time

Default

The RIB purge timer is 480 seconds.

Views

BGP view

Predefined user roles

network-admin

Parameters

timer: Sets the RIB purge timer in the range of 1 to 6000 seconds.

Usage guidelines

BGP starts the RIB purge timer when an active/standby switchover occurs or BGP restarts. If BGP route exchange is not completed before the RIB purge timer expires, the GR restarter quits the GR process. It updates the RIB with the BGP routes already learned, and removes the stale routes from RIB.

Enable BGP GR before you execute this command.

Set the RIB purge timer to be long enough to complete GR, especially when large numbers of BGP routes exist.

As a best practice, set the RIB purge timer to be greater than the timer set by the graceful-restart timer wait-for-rib command and smaller than the timer set by the protocol lifetime command.

Examples

# Set the RIB purge timer to 300 seconds.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] graceful-restart

[Sysname-bgp] graceful-restart timer purge-time 300

Related commands

·     graceful-restart

·     graceful-restart timer restart

·     graceful-restart timer wait-for-rib

·     protocol lifetime

graceful-restart timer restart

Use graceful-restart timer restart to configure the GR timer.

Use undo graceful-restart timer restart to restore the default.

Syntax

graceful-restart timer restart timer

undo graceful-restart timer restart

Default

The GR timer is 150 seconds.

Views

BGP view

Predefined user roles

network-admin

Parameters

timer: Specifies the GR time in the range of 3 to 600 seconds.

Usage guidelines

The GR restarter sends the GR timer to the GR helper in an Open message. When the GR helper detects that an active/standby switchover or a BGP restart occurred on the GR restarter, the GR helper performs the following actions:

·     Marks all routes learned from the GR restarter as stale.

·     Starts the GR timer.

·     If no BGP session is established before the GR timer expires, the GR helper removes the stale routes.

Before you configure this command, enable the BGP GR capability.

To apply a new GR timer, you must re-establish BGP sessions.

Examples

# Configure the GR timer as 300 seconds.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] graceful-restart

[Sysname-bgp] graceful-restart timer restart 300

Related commands

·     graceful-restart

·     graceful-restart timer purge-time

·     graceful-restart timer wait-for-rib

graceful-restart timer wait-for-rib

Use graceful-restart timer wait-for-rib to configure the time to wait for the End-of-RIB marker.

Use undo graceful-restart timer wait-for-rib to restore the default.

Syntax

graceful-restart timer wait-for-rib timer

undo graceful-restart timer wait-for-rib

Default

The time to wait for the End-of-RIB marker is 180 seconds.

Views

BGP view

Predefined user roles

network-admin

Parameters

timer: Specifies the time to wait for the End-of-RIB marker, in the range of 3 to 3600 seconds.

Usage guidelines

BGP uses this timer to control the time to receive updates from the peer. The timer is not advertised to the peer.

After the GR restarter and GR helper re-establish a BGP session, they start this timer. If they do not complete route exchange before the timer expires, the GR restarter does not receive new routes. It updates its routing table and forwarding table with learned BGP routes, and the GR helper removes the stale routes.

This command controls the routing convergence speed. A smaller timer value means faster routing convergence but possibly results in incomplete routing information.

Before configuring this command, you must enable the BGP GR capability.

Examples

# Set the time to wait for the End-of-RIB marker on the local end to 100 seconds.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] graceful-restart

[Sysname-bgp] graceful-restart timer wait-for-rib 100

Related commands

·     graceful-restart

·     graceful-restart timer purge-time

·     graceful-restart timer restart

group

Use group to create a peer group.

Use undo group to delete a peer group.

Syntax

group group-name [ external | internal ]

undo group group-name

Default

No peer group is created.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a name for the peer group, a case-sensitive string of 1 to 47 characters.

external: Creates an EBGP peer group.

internal: Creates an IBGP peer group.

Usage guidelines

In a large-scale network, many peers can use the same route selection policy. You can configure a peer group and add these peers into this group. In this way, peers can share the same policy as the peer group. When the policy of the group is modified, the modification also applies to peers in it.

If you do not specify the internal or external keyword, the command creates an IBGP peer group.

If you perform configurations on a peer group and peers of the peer group, the last configuration takes effect.

After you create a peer group, you must use the peer enable command to enable BGP to exchange routing information with the specified peer group.

Examples

# In BGP view, create EBGP peer group test with AS number 200, and add EBGP peers 10.1.1.1 and 10.1.2.1 into the group.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] group test external

[Sysname-bgp] peer test as-number 200

[Sysname-bgp] peer 10.1.1.1 group test

[Sysname-bgp] peer 10.1.2.1 group test

# In BGP-VPN instance view, create EBGP peer group test with AS number 200, and add EBGP peers 10.1.1.1 and 10.1.2.1 into the group.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] group test external

[Sysname-bgp-vpn1] peer test as-number 200

[Sysname-bgp-vpn1] peer 10.1.1.1 group test

[Sysname-bgp-vpn1] peer 10.1.2.1 group test

# In BGP view, create EBGP peer group test with AS number 200, and add EBGP peers 1::1 and 1::2 into the group.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] group test external

[Sysname-bgp] peer test as-number 200

[Sysname-bgp] peer 1::1 group test

[Sysname-bgp] peer 1::2 group test

# In BGP-VPN instance view, create EBGP peer group test with AS number 200, and add EBGP peers 1::1 and 1::2 into the group.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] group test external

[Sysname-bgp-vpn1] peer test as-number 200

[Sysname-bgp-vpn1] peer 1::1 group test

[Sysname-bgp-vpn1] peer 1::2 group test

Related commands

·     display bgp group

·     peer enable

ignore-first-as

Use ignore-first-as to configure BGP to ignore the first AS number of EBGP route updates.

Use undo ignore-first-as to restore the default.

Syntax

ignore-first-as

undo ignore-first-as

Default

BGP checks the first AS number of a received EBGP route update. If the first AS number is neither that of the BGP peer nor a private AS number, the BGP router discards the route update.

Views

BGP view

Predefined user roles

network-admin

Examples

# Configure BGP to ignore the first AS number of EBGP route updates.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ignore-first-as

import-route

Use import-route to enable BGP to redistribute routes from an IGP protocol.

Use undo import-route to disable route redistribution from an IGP protocol.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

import-route protocol [ { process-id | all-processes } [ med med-value ] ]

undo import-route protocol [ process-id | all-processes ]

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

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

undo import-route protocol [ process-id ]

Default

BGP does not redistribute IGP routes.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

protocol: Redistributes routes from a specified IGP protocol.

·     In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view, it can be direct, isis, ospf, rip, or static.

·     In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view, it can be direct, isisv6, ospfv3, ripng, or static.

process-id: Specifies a process by its ID in the range of 1 to 65535. The default is 1.

·     In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view, it is available only when the protocol is isis, ospf, or rip.

·     In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view, it is available only when the protocol is isisv6, ospfv3, or ripng.

all-processes: Redistributes routes from all the processes of the specified IGP protocol. This keyword takes effect only when the protocol is isis, ospf, or rip.

med med-value: Specifies a MED value for redistributed routes, in the range of 0 to 4294967295. If you do not specify a MED, the metric of a redistributed route is used as its MED.

Usage guidelines

The import-route command cannot redistribute default IGP routes. To redistribute default IGP routes, use the default-route imported command together with the import-route command.

Only active routes can be redistributed. You can use the display ip routing-table protocol or display ipv6 routing-table protocol command to view route state information.

The ORIGIN attribute of routes redistributed by the import-route command is INCOMPLETE.

Examples

# In BGP IPv4 unicast address family view, redistribute routes from RIP process 1, and set the MED value for redistributed routes to 100.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] import-route rip 1 med 100

# In BGP IPv6 unicast address family view, redistribute routes from RIP process 1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] import-route ripng

# In BGP-VPN IPv6 unicast address family view, redistribute routes from RIP process 1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] import-route ripng

Related commands

·     display ip routing-table protocol

·     display ipv6 routing-table protocol

ip vpn-instance (BGP view)

Use ip vpn-instance to create an BGP-VPN instance and enter BGP-VPN instance view.

Use undo ip vpn-instance to remove an BGP-VPN instance and all its configurations.

Syntax

ip vpn-instance vpn-instance-name

undo ip vpn-instance vpn-instance-name

Default

No BGP-VPN instance exists.

Views

BGP view

Predefined user roles

network-admin

Parameters

vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters.

Usage guidelines

After you create a BGP peer in BGP-VPN instance view, the BGP routes learned from the peer are added into the routing table of the specified VPN instance.

This command and all commands in BGP-VPN instance view are typically executed on provider edge (PE) or Multi-VPN-Instance CE (MCE) devices. The commands add routes learned from different sites into different VPN instances.

Before you execute this command, perform the following tasks:

·     Use the ip vpn-instance command to create the VPN instance in system view.

·     Use the route-distinguisher command to configure a route distinguisher (RD) for the VPN instance.

Examples

# Create a BGP-VPN instance and enter its view.

<Sysname> system-view

[Sysname] ip vpn-instance vpn1

[Sysname-vpn-instance-vpn1] route-distinguisher 100:1

[Sysname-vpn-instance-vpn1] quit

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1]

log-peer-change

Use log-peer-change to enable the logging of BGP session state changes.

Use undo log-peer-change to disable the function.

Syntax

log-peer-change

undo log-peer-change

Default

Logging of BGP session state changes is enabled.

Views

BGP view

Predefined user roles

network-admin

Usage guidelines

After you execute the log-peer-change command, BGP logs session establishment and disconnection events. To view the log information, use the display bgp peer ipv4 unicast log-info command or the display bgp peer ipv6 unicast log-info command. The logs are sent to the information center of the device. The output rules of the logs (whether to output the logs and where to output) are determined by the information center configuration. For more information about information center configuration, see Network Management and Monitoring Configuration Guide.

If you disable the logging of BGP session state changes, BGP does not generate logs for session establishments and disconnections.

Examples

# Enable the logging of session state changes globally.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] log-peer-change

Related commands

display bgp peer

log-route-flap

Use log-route-flap to enable logging for BGP route flapping.

Use undo log-route-flap to restore the default.

Syntax

log-route-flap monitor-time monitor-count [ log-count-limit ]

undo log-route-flap

Default

Logging for BGP route flapping is disabled.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP-VPN IPv6 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

monitor-time: Specifies the monitoring interval for route flapping, in the range of 1 to 600 minutes.

monitor-count: Specifies the number of route flaps for triggering a log, in the range of 2 to 8.

log-count-limit: Specifies the maximum number of logs allowed to be generated in a minute. The value range for this argument is 1 to 600, and the default value is 200.

Usage guidelines

This feature enables BGP to generate logs for BGP route flappings that trigger log generation. The generated logs are sent to the information center. For the logs to be output correctly, you must also configure information center on the device. For more information about information center, see Network Management and Monitoring Configuration Guide.

This command is applicable only to incoming routes of the specified address family.

Examples

# In BGP IPv4 unicast address family view, enable logging for BGP route flapping. Set the monitoring interval to 10 minutes, the number of route flaps for triggering a log to 5, and the maximum number of allowed logs in a minute to 100.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] log-route-flap 10 5 100

network

Use network to inject a network to the BGP routing table.

Use undo network to remove the configuration.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

network ip-address [ mask | mask-length ]

undo network ip-address [ mask | mask-length ]

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

network ipv6-address prefix-length

undo network ipv6-address prefix-length

Default

BGP does not advertise any local network.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

ip-address: Specifies an IPv4 network address. If you do not specify the mask or mask-length argument, natural mask is used.

mask: Specifies a mask in dotted decimal notation.

mask-length: Specifies a mask length in the range of 0 to 32.

ipv6-address: Specifies an IPv6 network address.

prefix-length: Specifies a prefix length in the range of 0 to 128.

Usage guidelines

The network to be injected must be available and active in the local IP routing table.

The ORIGIN attribute of the route injected with the network command is IGP.

When you execute the undo network command, you must specify the same mask or mask length/prefix length that you specified for the network command. Otherwise, the configuration cannot be removed.

Examples

# In BGP IPv4 unicast address family view, inject local network 10.0.0.0/16 to the BGP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] network 10.0.0.0 255.255.0.0

# In BGP-VPN IPv4 unicast address family view, inject local network 10.0.0.0/16 to the BGP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] network 10.0.0.0 255.255.0.0

# In BGP IPv6 unicast address family view, inject local network 2002::/64 to the IPv6 BGP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] network 2002:: 64

# In BGP-VPN IPv6 unicast address family view, inject local network 2002::/64 to the IPv6 BGP routing table.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] network 2002:: 64

network short-cut

Use network short-cut to increase the preference for a received EBGP route. This EBGP route is called shortcut route.

Use undo network short-cut to cancel the configuration.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

network ip-address [ mask | mask-length ] short-cut

undo network ip-address [ mask | mask-length ] short-cut

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

network ipv6-address prefix-length short-cut

undo network ipv6-address prefix-length short-cut

Default

A received EBGP route has a preference of 255.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

ip-address: Specifies an IPv4 network address. If you do not specify the mask or mask-length argument, natural mask is used.

mask: Specifies a mask of the network address in dotted decimal notation.

mask-length: Specifies a mask length in the range of 0 to 32.

ipv6-address: Specifies an IPv6 network address.

prefix-length: Specifies a prefix length in the range of 0 to 128.

Usage guidelines

Different routing protocols might find different routes to the same destination. However, not all of those routes are optimal. For route selection, routing protocols, direct routes, and static routes are assigned different preferences. The route with the highest preference is preferred.

By default, the preference of an EBGP route is lower than a local route. If a device has an EBGP route and a local route to reach the same destination, the device does not select the EBGP route. You can use the network shortcut command to configure the EBGP route to have the same preference as the local route so the EBGP route is more likely to become the optimal route.

You can use the preference command to modify the preferences for external and local BGP routes.

Examples

# In BGP IPv4 unicast address family view, increase the preference of EBGP route 10.0.0.0/16.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] network 10.0.0.0 255.255.0.0 short-cut

# In BGP-VPN IPv6 unicast address family view, increase the preference of EBGP route 10::/16.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] network 10:: 16 short-cut

Related commands

preference

non-stop-routing

Use non-stop-routing to enable BGP nonstop routing (NSR).

Use undo non-stop-routing to disable BGP NSR.

Syntax

non-stop-routing

undo non-stop-routing

Default

BGP NSR is disabled.

Views

BGP view

Predefined user roles

network-admin

Usage guidelines

BGP NSR ensures continuous routing by synchronizing BGP state and data information from the active BGP process to the standby BGP process. The standby BGP process can seamlessly take over all services when the active process fails.

Examples

# Enable BGP NSR.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] non-stop-routing

Related commands

display bgp non-stop-routing status

peer advertise-community

Use peer advertise-community to advertise the COMMUNITY attribute to a peer or peer group.

Use undo peer advertise-community to disable the COMMUNITY attribute advertisement to a peer or peer group.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

peer { group-name | ip-address [ mask-length ] } advertise-community

undo peer { group-name | ip-address [ mask-length ] } advertise-community

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } advertise-community

undo peer { group-name | ipv6-address [ prefix-length ] } advertise-community

Default

No COMMUNITY attribute is advertised to any peer or peer group.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP-VPN IPv6 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command advertises the COMMUNITY attribute to all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command advertises the COMMUNITY attribute to all dynamic peers in the network.

Usage guidelines

The COMMUNITY attribute is a group of specific data carried in update messages. A route can carry one or more COMMUNITY attribute values (each is represented by a 4-byte integer). The receiving router processes the route (for example, determining whether to advertise the route and the scope for advertising the route) based on the COMMUNITY attribute values.

After you execute the peer advertise-community command, routing updates advertised to the peer carry the COMMUNITY attribute.

After you execute the undo peer advertise-community command, BGP, upon receiving a route with the COMMUNITY attribute, removes the COMMUNITY attribute before sending the route to the peer or peer group.

Examples

# In BGP IPv4 unicast address family view, advertise the COMMUNITY attribute to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer test advertise-community

# In BGP-VPN IPv4 unicast address family view, advertise the COMMUNITY attribute to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] peer test advertise-community

# In BGP IPv6 unicast address family view, advertise the COMMUNITY attribute to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] peer test advertise-community

peer advertise-ext-community

Use peer advertise-ext-community to advertise the extended community attribute to a peer or peer group.

Use undo peer advertise-ext-community to disable the extended community attribute advertisement to a peer or peer group.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

peer { group-name | ip-address [ mask-length ] } advertise-ext-community

undo peer { group-name | ip-address [ mask-length ] } advertise-ext-community

In BGP IPv6 unicast address family view:

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise-ext-community

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } advertise-ext-community

Default

No extended community attribute is advertised to a peer or peer group.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command advertises the extended community attribute to all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command advertises the extended community attribute to all dynamic peers in the network.

Usage guidelines

To meet increasing user demands, BGP defines a new attribute—extended community attribute. The extended community attribute has the following advantages over the COMMUNITY attribute:

·     The extended community attribute has an 8-byte length.

·     The extended community attribute supports various types. You can select an extended community attribute type as needed to implement route filtering and control. This simplifies configuration and management.

After you execute the peer advertise-ext-community command, route updates sent to the peer or peer group carry the extended community attribute.

After you execute the undo peer advertise-ext-community command, BGP, upon receiving a route with the extended community attribute, removes the extended community attribute before sending the route to the peer or peer group.

Examples

# In BGP IPv4 unicast address family view, advertise the extended community attribute to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer test advertise-ext-community

# In BGP-VPN IPv4 unicast address family view, advertise the extended community attribute to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] peer test advertise-ext-community

# In BGP IPv6 unicast address family view, advertise the extended community attribute to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] peer test advertise-ext-community

peer allow-as-loop

Use peer allow-as-loop to allow a local AS number to exist in the AS_PATH attribute of routes from a peer or peer group, and to configure the number of times the local AS number can appear.

Use undo peer allow-as-loop to restore the default.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

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

undo peer { group-name | ip-address [ mask-length ] } allow-as-loop

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } allow-as-loop [ number ]

undo peer { group-name | ipv6-address [ prefix-length ] } allow-as-loop

Default

The local AS number is not allowed to exist in the AS_PATH attribute of routes from a peer or peer group.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network in this command, BGP allows a local AS number to exist in the AS_PATH attribute of routes from all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network in this command, BGP allows a local AS number to exist in the AS_PATH attribute of routes from all dynamic peers in the network.

number: Specifies the number of times for which the local AS number can appear, in the range of 1 to 10. The default number is 1. If the number of times for which the local AS number appears in a route is more than the specified number, BGP considers that a routing loop occurs and discards the route.

Usage guidelines

By default, BGP does not receive routes that contain the local AS number in the AS_PATH attribute to avoid routing loops. However, in some network environments, the AS_PATH attribute of a route from a peer must be allowed to contain the local AS number. Otherwise, the route cannot be advertised correctly.

Examples

# In BGP IPv4 unicast address family view, configure the number of times the local AS number can appear in AS_PATH attribute of routes from peer group test as 2.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer test allow-as-loop 2

# In BGP-VPN IPv6 unicast address family view, configure the number of times the local AS number can appear in AS_PATH attribute of routes from peer group test as 2.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] peer test allow-as-loop 2

peer as-number (for a BGP peer)

Use peer as-number to create a BGP peer and specify its AS number.

Use undo peer to delete a BGP peer.

Syntax

peer { ip-address [ mask-length ] | ipv6-address [ prefix-length ] } as-number as-number

undo peer { ip-address [ mask-length ] | ipv6-address [ prefix-length ] }

Default

No BGP peer is created.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

ip-address: Specifies the IP address of a peer.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command enables BGP to establish dynamic peer relationships with all devices in the network.

ipv6-address: Specifies the IPv6 address of a peer.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command enables BGP to establish dynamic peer relationships with all devices in the network.

as-number: Specifies an AS number for the peer, in the range of 1 to 4294967295. If the AS numbers of the peer and the local router are the same, the peer is an IBGP peer. If they are different, the peer is an EBGP peer.

Usage guidelines

You can also create a peer and add it to a peer group by using the peer group command.

To modify the AS number of a peer, do not execute the peer as-number command repeatedly. Instead, you must first delete the peer and configure it again.

After you create a peer, you must use the peer enable command to enable BGP to exchange routing information with the specified peer.

BGP can use an IPv6 link-local address to establish a peer relationship with a peer when the following conditions exist:

·     The IPv6 link-local address belongs to the interface directly connected to the local router.

·     The peer connect-interface command is configured on the peer to specify the interface as the source interface.

Examples

# In BGP view, create BGP peer 1.1.1.1 and specify its AS number as 100.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 1.1.1.1 as-number 100

# In BGP-VPN instance view, create BGP peer 1::1 and specify its AS number as 100.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 1::1 as-number 100

Related commands

·     display bgp peer

·     peer enable

·     peer group

peer as-number (for a BGP peer group)

Use peer as-number to specify an AS number for a peer group.

Use undo peer as-number to delete the AS number of a peer group.

Syntax

peer group-name as-number as-number

undo peer group-name as-number

Default

No AS number is specified for a peer group.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a name for a peer group, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

as-number: Specifies an AS number for a peer group, in the range of 1 to 4294967295.

Usage guidelines

This command applies only to a peer group with no peers in it.

When you specify an AS number for a peer group and want to add peers to it, make sure the AS number of the peers is the same as the peer group.

If you have specified no AS number for a peer group, peers added to it can use their own AS numbers.

Examples

# In BGP view, specify the AS number for peer group test as 100.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer test as-number 100

# In BGP-VPN instance view, specify the AS number for peer group test as 100.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer test as-number 100

Related commands

peer group

peer bfd

Use peer bfd to enable BFD for the link to a BGP peer.

Use undo peer bfd to restore the default.

Syntax

peer { ip-address [ mask-length ] | ipv6-address [ prefix-length ] } bfd [ multi-hop | single-hop ]

undo peer { ip-address [ mask-length ] | ipv6-address [ prefix-length ] } bfd

Default

BFD is disabled.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command enables BFD for links to all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command enables BFD for links to all dynamic peers in the network.

multi-hop: Enables multi-hop BFD.

single-hop: Enables single-hop BFD.

Usage guidelines

When neither the multi-hop keyword nor the single-hop keyword is specified:

·     If you specify an IBGP peer, this command enables multi-hop BFD for the IBGP peer.

·     If you specify a directly connected EBGP peer and do not configure the peer ebgp-max-hop command, this command enables single-hop BFD for the EBGP peer. If the EBGP peer is not directly connected or the peer ebgp-max-hop command is configured, this command enables multi-hop BFD for the EBGP peer.

For more information about multi-hop and single-hop BFD, see High Availability Configuration Guide.

BFD helps speed up BGP routing convergence upon link failures. However, if you have enabled GR, use BFD with caution. BFD might detect a failure before the system performs GR, resulting in GR failure. If you have enabled both BFD and GR for BGP, do not disable BFD during a GR process to avoid GR failure.

To establish a BFD session to a BGP peer, you must configure the same BFD detection mode multi-hop or single-hop on the local router and the BGP peer.

Examples

# In BGP view, enable BFD for the link to BGP peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 1.1.1.1 bfd

# In BGP view, enable BFD for the link to BGP peer 1::1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 1::1 bfd

# In BGP-VPN instance view, enable BFD for the link to BGP peer 2.2.2.2.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 2.2.2.2 bfd

# In BGP-VPN instance view, enable BFD for the link to BGP peer 2::2.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 2::2 bfd

Related commands

·     display bgp peer

·     display bfd session (High Availability Command Reference)

peer capability-advertise conventional

Use peer capability-advertise conventional to disable BGP multi-protocol extension and route refresh for a peer or peer group.

Use undo peer capability-advertise conventional to enable BGP multi-protocol extension and route refresh for a peer or peer group.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise conventional

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise conventional

Default

BGP multi-protocol extension and route refresh are enabled.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command disables BGP multi-protocol extension and route refresh for all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command disables BGP multi-protocol extension and route refresh for all dynamic peers in the network.

Usage guidelines

The route refresh function enables BGP to send and receive Route-refresh messages and implement BGP session soft-reset.

The multi-protocol extension function enables BGP to advertise and receive routing information for various protocols (for example, IPv6 routing information).

If both the peer capability-advertise conventional and peer capability-advertise route-refresh commands are executed, the last configuration takes effect.

Examples

# In BGP view, disable multi-protocol extension and route refresh for peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 1.1.1.1 as-number 100

[Sysname-bgp] peer 1.1.1.1 capability-advertise conventional

# In BGP-VPN instance view, disable multi-protocol extension and route refresh for peer 1::1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 1::1 as-number 100

[Sysname-bgp-vpn1] peer 1::1 capability-advertise conventional

Related commands

·     display bgp peer

·     peer capability-advertise route-refresh

peer capability-advertise route-refresh

Use peer capability-advertise route-refresh to enable BGP route refresh for a specified peer or peer group.

Use undo peer capability-advertise route-refresh to disable the function.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise route-refresh

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise route-refresh

Default

BGP route refresh is enabled.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command enables BGP route refresh for all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command enables BGP route refresh for all dynamic peers in the network.

Usage guidelines

The route refresh function enables BGP to send and receive Route-refresh messages.

BGP route refresh requires that both the local router and the peer support route refresh.

If both the peer capability-advertise route-refresh and peer capability-advertise conventional commands are executed, the last configuration takes effect.

Examples

# In BGP view, enable BGP route refresh for peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 1.1.1.1 as-number 100

[Sysname-bgp] peer 1.1.1.1 capability-advertise route-refresh

# In BGP-VPN instance view, enable BGP route refresh for peer 1::1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 1::1 as-number 200

[Sysname-bgp-vpn1] peer 1::1 capability-advertise route-refresh

Related commands

·     display bgp peer

·     peer capability-advertise conventional

·     peer keep-all-routes

·     refresh bgp ipv4 unicast

·     refresh bgp ipv6 unicast

peer capability-advertise suppress-4-byte-as

Use peer capability-advertise suppress-4-byte-as to enable 4-byte AS number suppression.

Use undo peer capability-advertise suppress-4-byte-as to disable the function.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise suppress-4-byte-as

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } capability-advertise suppress-4-byte-as

Default

The 4-byte AS number suppression function is disabled.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command enables 4-byte AS number suppression for all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command enables 4-byte AS number suppression for all dynamic peers in the network.

Usage guidelines

BGP supports 4-byte AS numbers. The 4-byte AS number occupies four bytes, in the range of 1 to 4294967295. By default, a device sends an Open message to the peer device for session establishment. The Open message indicates that the device supports 4-byte AS numbers. If the peer device supports 2-byte AS numbers instead of 4-byte AS numbers, the session cannot be established. To resolve this issue, enable the 4-byte AS number suppression function. The device then sends an Open message to inform the peer that it does not support 4-byte AS numbers, so the BGP session can be established.

If the peer device supports 4-byte AS numbers, do not enable the 4-byte AS number suppression function. Otherwise, the BGP session cannot be established.

Examples

# In BGP view, enable 4-byte AS number suppression for peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 1.1.1.1 as-number 100

[Sysname-bgp] peer 1.1.1.1 capability-advertise suppress-4-byte-as

# In BGP-VPN instance view, enable 4-byte AS number suppression for peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 1.1.1.1 as-number 200

[Sysname-bgp-vpn1] peer 1.1.1.1 capability-advertise suppress-4-byte-as

Related commands

display bgp peer

peer connect-interface

Use peer connect-interface to specify a source interface (IP address/IPv6 address) for establishing TCP connections to a peer or peer group.

Use undo peer connect-interface to restore the default.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } connect-interface interface-type interface-number

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } connect-interface

Default

BGP uses the output interface (IP address/IPv6 address) of the best route destined for the BGP peer or peer group as the source interface. The interface is used to establish a TCP connection to the peer or peer group.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command specifies a source interface for establishing TCP connections to all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command specifies a source interface for establishing TCP connections to all dynamic peers in the network.

interface-type interface-number: Specifies an interface by its type and number.

Usage guidelines

If the peer's IP/IPv6 address belongs to an interface indirectly connected to the local router, specify that interface as the source interface for TCP connections on the peer. For example, interface A on the local end is directly connected to interface B on the peer. When you execute the peer x.x.x.x as-number as-number command and x.x.x.x is not the IP address of interface B on the local end, use the peer connect-interface command on the peer to specify the interface whose IP address is x.x.x.x as the source interface.

BGP can use an IPv6 link-local address to establish a peer relationship with a peer when the following conditions exist:

·     The IPv6 link-local address belongs to the interface directly connected to the local router.

·     The peer connect-interface command is configured on the peer to specify the interface as the source interface.

On a BGP router that has multiple links to a peer, if the source interface fails, BGP must re-establish TCP connections. To avoid this problem, use a loopback interface as the source interface.

To establish multiple BGP sessions between two routers, specify the source interface for establishing TCP connections to each peer on the local router. Otherwise, the local BGP router might fail to establish TCP connections to a peer when using the outbound interface of the best route to the peer as the source interface.

The source interfaces on the local router and the peer must be reachable.

To specify an indirectly connected interface (except loopback interfaces) on an EBGP peer as the source interface, use the peer ebgp-max-hop command. The command allows the establishment of an EBGP session to the indirectly connected peer.

If an interface has multiple IP addresses, use the primary IP address for establishing TCP connections. If an interface has multiple IPv6 addresses, select an IPv6 address as defined in RFC 3484 for establishing TCP connections.

Examples

# In BGP view, specify loopback 0 as the source interface for TCP connections to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer test connect-interface loopback 0

# In BGP-VPN instance view, specify loopback 0 as the source interface for TCP connections to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer test connect-interface loopback 0

Related commands

peer ebgp-max-hop

peer default-route-advertise

Use peer default-route-advertise to advertise a default route to a peer or peer group.

Use undo peer default-route-advertise to disable default route advertisement to a peer or peer group.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

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

undo peer { group-name | ip-address [ mask-length ] } default-route-advertise

In BGP IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } default-route-advertise

undo peer { group-name | ipv6-address [ prefix-length ] } default-route-advertise

Default

No default route is advertised to a peer or peer group.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command advertises a default route to all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command advertises a default route to all dynamic peers in the network.

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters.

Usage guidelines

The peer default-route-advertise command enables the router to send a default route with the next hop being itself to the peer or peer group regardless of whether the default route exists in the routing table.

Examples

# In BGP IPv4 unicast address family view, advertise a default route to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer test default-route-advertise

# In BGP-VPN IPv4 unicast address family view, advertise a default route to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] peer test default-route-advertise

# In BGP IPv6 unicast address family view, advertise a default route to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] peer test default-route-advertise

peer description

Use peer description to configure a description for a peer or peer group.

Use undo peer description to remove the description for a peer or peer group.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } description description-text

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } description

Default

No description information is configured for a peer or peer group.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command configures a description for all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command configures a description for all dynamic peers in the network.

description-text: Specifies a description for a peer or peer group, a case-sensitive string of 1 to 79 characters.

Examples

# In BGP view, configure a description for peer group test as ISP1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer test description ISP1

# In BGP-VPN instance view, configure a description for peer group test as ISP1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer test description ISP1

peer ebgp-max-hop

Use peer ebgp-max-hop to enable BGP to establish an EBGP session to an indirectly-connected peer or peer group and specify the maximum hop count.

Use undo peer ebgp-max-hop to restore the default.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } ebgp-max-hop [ hop-count ]

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } ebgp-max-hop

Default

BGP does not establish an EBGP session to an indirectly-connected peer or peer group.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network in this command, BGP establishes EBGP sessions to all indirectly connected dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network in this command, BGP establishes EBGP sessions to all indirectly connected dynamic peers in the network.

hop-count: Specifies the maximum number of hop counts, in the range of 1 to 255. The default is 64.

Usage guidelines

EBGP peers must be directly connected. If not, use the peer ebgp-max-hop command to establish an EBGP session over multiple hops between two peers. If direct EBGP peers use loopback interfaces to establish a BGP session, you do not need to configure the peer ebgp-max-hop command.

When the BGP GTSM function is enabled using peer ttl-security, two peers can establish an EBGP session after passing GTSM check, regardless of whether the maximum number of hops is reached.

Examples

# In BGP view, enable BGP to establish EBGP sessions to indirectly-connected EBGP peer group test, and specify the maximum hop count as 64 (default).

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer test ebgp-max-hop

# In BGP-VPN instance view, enable BGP to establish EBGP sessions to indirectly-connected EBGP peer group test, and specify the maximum hop count as 64 (default).

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer test ebgp-max-hop

Related commands

peer ttl-security

peer enable

Use peer enable to enable BGP to exchange routing information for an address family with a peer or peer group.

Use undo peer enable to disable BGP from exchanging routing information for an address family with a peer or peer group.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

peer { group-name | ip-address [ mask-length ] } enable

undo peer { group-name | ip-address [ mask-length ] } enable

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } enable

undo peer { group-name | ipv6-address [ prefix-length ] } enable

Default

BGP cannot exchange routing information with a peer or peer group.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network in this command, BGP exchanges routing information for an address family with all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network in this command, BGP exchanges routing information for an address family with all dynamic peers in the network.

Usage guidelines

Executing the peer enable command in different views enables BGP to exchange routing information for the corresponding address families with the specified peer.

·     In BGP IPv4 unicast address family view, the command enables the capability to exchange IPv4 unicast routing information. It also adds the learned routes to the BGP routing table of the public network.

·     In BGP-VPN IPv4 unicast address family view, the command enables the capability to exchange IPv4 unicast routing information. It also adds the learned routes to the BGP routing table of the specified VPN instance.

·     In BGP IPv6 unicast address family view, the command enables the capability to exchange IPv6 unicast routing information. It also adds the learned routes to the IPv6 BGP routing table of the public network.

·     In BGP-VPN IPv6 unicast address family view, the command enables the capability to exchange IPv6 unicast routing information. It also adds the learned routes to the IPv6 BGP routing table of the specified VPN instance.

The undo peer enable command disables BGP to exchange routing information for the corresponding address family with the peer.

Examples

# In BGP IPv4 unicast address family view, enable BGP to exchange IPv4 unicast routing information with peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer 1.1.1.1 enable

# In BGP-VPN IPv4 unicast address family view, enable BGP to exchange IPv4 unicast routing information with peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] peer 1.1.1.1 enable

# In BGP IPv6 unicast address family view, enable BGP to exchange IPv6 unicast routing information with peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] peer 1.1.1.1 enable

# In BGP-VPN IPv6 unicast address family view, enable BGP to exchange IPv6 unicast routing information with peer 1::1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] peer 1::1 enable

Related commands

display bgp peer

peer fake-as

Use peer fake-as to advertise a fake AS number to a peer or peer group.

Use undo peer fake-as to restore the default.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } fake-as as-number

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } fake-as

Default

No fake local AS number is advertised to a peer or peer group.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command advertises a fake AS number to all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command advertises a fake AS number to all dynamic peers in the network.

as-number: Specifies a fake AS number in the range of 1 to 4294967295.

Usage guidelines

After you move a BGP router from an AS to another AS (from AS 2 to AS 3 for example), you have to modify the AS number of the router on all its EBGP peers. To avoid such modifications, you can configure the router to advertise a fake AS number 2 to its EBGP peers so that the EBGP peers still think that Router A is in AS 2.

The peer fake-as command is only applicable to EBGP peers or peer groups.

If you execute the peer fake-as command on the local router, specify the local router's AS number on the peer as the fake local AS number specified in the command.

Examples

# In BGP view, advertise a fake AS number of 200 to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer test fake-as 200

# In BGP-VPN instance view, advertise a fake AS number of 200 to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer test fake-as 200

peer filter-policy

Use peer filter-policy to filter routes advertised to or received from a peer or peer group by using an ACL.

Use undo peer filter-policy to remove the configuration.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

peer { group-name | ip-address [ mask-length ] } filter-policy acl-number { export | import }

undo peer { group-name | ip-address [ mask-length ] } filter-policy { export | import }

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } filter-policy acl6-number { export | import }

undo peer { group-name | ipv6-address [ prefix-length ] } filter-policy { export | import }

Default

No ACL-based filtering is configured.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command filters routes advertised to or received from all dynamic peers in the network by using an ACL.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command filters routes advertised to or received from all dynamic peers in the network by using an ACL.

acl-number: Specifies an ACL by its number in the range of 2000 to 3999.

acl6-number: Specifies an IPv6 ACL by its number in the range of 2000 to 3999.

export: Filters routes advertised to the peer/peer group.

import: Filters routes received from the peer/peer group.

Usage guidelines

The specified ACL referenced by the peer filter-policy command must have been created with the acl command in system view. Otherwise, all routes can pass the ACL.

If you use a basic ACL (with a number from 2000 to 2999) configured with the rule [ rule-id ] { deny | permit } source source-address source-wildcard command, the command matches routes whose destination network addresses match the source-address source-wildcard argument without matching the masks of the destination addresses.

If you use an advanced ACL (with a number from 3000 to 3999) in the command, the ACL should be configured with one of the following commands:

·     The rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard command to deny/permit a route with the specified destination.

·     The rule [ rule-id ] { deny | permit } ip source sour-addr sour-wildcard destination dest-addr dest-wildcard command to deny/permit a route with the specified destination and mask.

The source keyword specifies the destination address of a route and the destination keyword specifies the subnet mask of the destination. The subnet mask must be contiguous. Otherwise, the configuration does not take effect.

Examples

# In BGP IPv4 unicast address family view, apply ACL 2000 to filter routes advertised to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer test filter-policy 2000 export

# In BGP-VPN IPv6 unicast address family view, apply ACL6 2000 to filter routes advertised to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] peer test filter-policy 2000 export

Related commands

·     acl (ACL and QoS Command Reference)

·     filter-policy export

·     filter-policy import

peer group

Use peer group to add a peer to a peer group.

Use undo peer group to delete a peer from a peer group.

Syntax

peer { ip-address [ mask-length ] | ipv6-address [ prefix-length ] } group group-name [ as-number as-number ]

undo peer { ip-address [ mask-length ] | ipv6-address [ prefix-length ] } group group-name

Default

No peer exists in a peer group.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

ip-address: Specifies a peer by its IP address.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command adds all dynamic peers in the network to a peer group.

ipv6-address: Specifies a peer by its IPv6 address.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command adds all dynamic peers in the network to a peer group.

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

as-number as-number: Specifies an AS for a peer by its number in the range of 1 to 4294967295.

Usage guidelines

You can add a peer to a peer group in the following ways:

·     Use the peer as-number command to create a peer and specify its AS number, and then use the peer group command to add the peer to the peer group.

¡     You can specify the as-number keyword for the peer group command. The AS number must be the same as the AS number specified in the peer as-number command.

¡     If you have specified the AS number of the peer group with the peer as-number command, the peer to be added must have the same AS number as the peer group.

¡     To add a peer to an IBGP peer group, the peer must be an IBGP peer.

·     Use the peer group command to create a peer and add it to the peer group.

¡     If you have specified the AS number of the peer group with the peer as-number command, you do not need to specify the as-number keyword when you execute the peer group command. This is because the AS number of the peer is the same as the peer group. To specify the as-number keyword for the peer group command, make sure that the AS number is the same as the peer group.

¡     If no AS number is specified for an EBGP peer group, specify the as-number keyword when you execute the peer group command.

¡     If no AS number is specified for an IBGP peer group, you do not need to specify the as-number keyword when you execute the peer group command. This is because the AS number of the IBGP peer group is the local AS number. To specify the as-number keyword for the peer group command, make sure that the AS number is the same as the local AS number.

If you have specified the AS number of a peer group with the peer as-number command, only the peers with the same AS number can be added to the peer group. All peers in the group share the same AS number. If you have not specified the AS number for a peer group, peers added to it can use their own AS numbers.

After you add a peer to a peer group, you must use the peer enable command to enable BGP to exchange routing information with the peer group.

Examples

# In BGP view, add peer 10.1.1.1 to EBGP peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] group test external

[Sysname-bgp] peer 10.1.1.1 group test as-number 2004

# In BGP-VPN instance view, add peer 10.1.1.1 to EBGP peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] group test external

[Sysname-bgp-vpn1] peer 10.1.1.1 group test as-number 2004

# In BGP view, add peer 1::1 to EBGP peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] group test external

[Sysname-bgp] peer 1::1 group test as-number 2004

# In BGP-VPN instance view, add peer 1::1 to EBGP peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] group test external

[Sysname-bgp-vpn1] peer 1::1 group test as-number 2004

Related commands

·     group

·     peer as-number

·     peer enable

peer ignore

Use peer ignore to disable BGP session establishment with a peer or peer group.

Use undo peer ignore to restore the default.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } ignore

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } ignore

Default

BGP can establish a session to a peer or peer group.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network in this command, BGP tears down sessions to all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network in this command, BGP tears down sessions to all dynamic peers in the network.

Usage guidelines

This command enables you to temporarily tear down the BGP session to a specific peer or peer group. Then you can perform network upgrade and maintenance without needing to delete and reconfigure the peer or peer group. To recover the session, execute the undo peer ignore command.

If a session has been established to a peer, executing the peer ignore command for the peer tears down the session and clears all related routing information.

If sessions have been established to a peer group, executing the peer ignore command for the peer group disables the sessions to all peers in the group and clears all related routing information.

Examples

# In BGP view, disable session establishment with peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 1.1.1.1 ignore

# In BGP-VPN instance view, disable session establishment with peer 1::1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 1::1 ignore

peer ignore-originatorid

Use peer ignore-originatorid to configure BGP to ignore the ORIGINATOR_ID attribute in BGP route updates.

Use undo peer ignore-originatorid to restore the default.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } ignore-originatorid

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } ignore-originatorid

Default

BGP does not ignore the ORIGINATOR_ID attribute in BGP route updates.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters.

ip-address: Specifies a peer by its IP address.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network in this command, BGP ignores the ORIGINATOR_ID attribute in BGP route updates from all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network in this command, BGP ignores the ORIGINATOR_ID attribute in BGP route updates from all dynamic peers in the network.

Usage guidelines

IMPORTANT

IMPORTANT:

Before using this command, make sure it does not cause any routing loops to the network.

 

By default, BGP drops incoming route updates whose ORIGINATOR_ID attribute is the same as the local router ID. Some networks such as firewall networks require BGP to accept such route updates. To meet the requirement, you must configure BGP to ignore the ORIGINATOR_ID attribute.

After you execute this command, BGP also ignores the CLUSTER_LIST attribute.

Examples

# In BGP view, configure BGP to ignore the ORIGINATOR_ID attribute in BGP route updates from peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 1.1.1.1 ignore-originatorid

# In BGP VPN instance view, configure BGP to ignore the ORIGINATOR_ID attribute in BGP route updates from peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 1::1 ignore-originatorid

peer ipsec-profile

Use peer ipsec-profile to apply an IPsec profile to an IPv6 BGP peer or peer group.

Use undo peer ipsec-profile to remove the profile from the IPv6 BGP peer or peer group.

Syntax

peer { group-name | ipv6-address [ prefix-length ] } ipsec-profile profile-name

undo peer { group-name | ipv6-address [ prefix-length ] } ipsec-profile

Default

No IPsec profile is configured for any IPv6 BGP peer or peer group.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command applies an IPsec profile to all dynamic peers in the network.

profile-name: Specifies an IPsec profile by its name, a case-sensitive string of 1 to 63 characters.

Usage guidelines

IPsec can protect IPv6 BGP packets from data eavesdropping, tampering, and attacks caused by forged IPv6 BGP packets.

When two IPv6 BGP neighbor devices, for example Device A and Device B, are configured with IPsec, Device A encapsulates an IPv6 BGP packet with IPsec before sending it to Device B. If Device B successfully receives and decapsulates the packet, it establishes an IPv6 BGP peer relationship with Device A or learns IPv6 BGP routes to Device A. If Device B receives but fails to decapsulate the packet, or receives a packet not protected by IPsec, it discards the packet.

Configure IPsec to protect IPv6 BGP packets through the following steps:

1.     Configure an IPsec transform set.

2.     Configure a manual IPsec profile.

3.     Execute this command to apply the IPsec profile to an IPv6 BGP peer or peer group.

For more information about IPsec transform sets and IPsec profiles, see Security Configuration Guide.

This command supports only IPsec profiles in manual mode.

If you configure IPsec on a device, you must configure IPsec on its IPv6 BGP peer. Otherwise, IPv6 BGP packets cannot be received.

Examples

# In BGP view, apply IPsec profile profile001 to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer test ipsec-profile profile001

# In BGP-VPN instance view, apply IPsec profile profile001 to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer test ipsec-profile profile001

Related commands

·     display bgp group

·     display bgp peer

peer keep-all-routes

Use peer keep-all-routes to save all route updates from a peer or peer group.

Use undo peer keep-all-routes to restore the default.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

peer { group-name | ip-address [ mask-length ] } keep-all-routes

undo peer { group-name | ip-address [ mask-length ] } keep-all-routes

In BGP IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } keep-all-routes

undo peer { group-name | ipv6-address [ prefix-length ] } keep-all-routes

Default

Route updates from a peer or peer group are not saved.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command saves all route updates from all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command saves all route updates from all dynamic peers in the network.

Usage guidelines

To implement BGP session soft-reset when the local router and a peer or peer group do not support the route refresh function, use the peer keep-all-routes command. The command saves all route updates received from the peer or peer group. After modifying the route selection policy, filter all saved routes with the new policy to refresh the routing table. This method avoids tearing down BGP sessions.

Examples

# In BGP IPv4 unicast address family view, save all route updates from peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer 1.1.1.1 keep-all-routes

# In BGP-VPN IPv4 unicast address family view, save all route updates from peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] peer 1.1.1.1 keep-all-routes

# In BGP IPv6 unicast address family view, save all route updates from peer 1::1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] peer 1::1 keep-all-routes

Related commands

·     peer capability-advertise route-refresh

·     refresh bgp ipv4 unicast

·     refresh bgp ipv6 unicast

peer low-memory-exempt

Use peer low-memory-exempt to configure BGP to protect EBGP peer or peer group when the memory usage reaches level 2 threshold.

Use undo peer low-memory-exempt to restore the default.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } low-memory-exempt

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } low-memory-exempt

Default

When the memory usage reaches level 2 threshold, BGP tears down an EBGP session to release memory resources periodically.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network in this command, BGP protects all dynamic peers in the network when the memory usage reaches level 2 threshold.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network in this command, BGP protects all dynamic peers in the network when the memory usage reaches level 2 threshold.

Usage guidelines

Memory usage includes the following levels of thresholds: normal, level 1, level 2, and level 3. When level 2 threshold is reached, BGP tears down an EBGP session to release memory resources periodically until the memory usage is exempt from level 2 threshold. You can use this command to avoid tearing down the BGP session with a specific EBGP peer when memory usage reaches level 2 threshold.

For more information about thresholds, see Fundamentals Configuration Guide.

Examples

# In BGP view, configure BGP to protect EBGP peer 1.1.1.1 when the memory usage reaches level 2 threshold.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 1.1.1.1 as-number 200

[Sysname-bgp] peer 1.1.1.1 low-memory-exempt

# In BGP-VPN instance view, configure BGP to protect EBGP peer 1.1.1.1 when the memory usage reaches level 2 threshold.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 1.1.1.1 as-number 200

[Sysname-bgp-vpn1] peer 1.1.1.1 low-memory-exempt

peer next-hop-local

Use peer next-hop-local to set the local router as the next hop for routes sent to a peer or peer group.

Use undo peer next-hop-local to restore the default.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

peer { group-name | ip-address [ mask-length ] } next-hop-local

undo peer { group-name | ip-address [ mask-length ] } next-hop-local

In BGP IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } next-hop-local

undo peer { group-name | ipv6-address [ prefix-length ] } next-hop-local

Default

BGP sets the local router as the next hop for all routes sent to an EBGP peer or peer group.

BGP does not set the local router as the next hop for EBGP routes sent to an IBGP peer or peer group.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command sets the local router as the next hop for routes sent to all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command sets the local router as the next hop for routes sent to all dynamic peers in the network.

Usage guidelines

To make sure that an IBGP peer can find the next hop, you can use this command to specify the router as the next hop for routes sent to the IBGP peer.

Examples

# In BGP IPv4 unicast address family view, specify the router as the next hop for routes sent to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer test next-hop-local

# In BGP-VPN IPv4 unicast address family view, specify the router as the next hop for routes sent to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] peer test next-hop-local

# In BGP IPv6 unicast address family view, specify the router as the next hop for routes sent to peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] peer test next-hop-local

peer password

Use peer password to enable MD5 authentication for a BGP peer or peer group.

Use undo peer password to remove MD5 authentication for the BGP peer or peer group.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } password { cipher | simple } password

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } password

Default

MD5 authentication is disabled.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command enables MD5 authentication for all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command enables MD5 authentication for all dynamic peers in the network.

cipher: Sets a ciphertext password.

simple: Sets a plaintext password.

password: Specifies a password, a case-sensitive string of 33 to 137 characters in cipher text, or 1 to 80 characters in plain text.

Usage guidelines

You can enable MD5 authentication to enhance security using the following methods:

·     Perform MD5 authentication when establishing TCP connections. Only the two parties that have the same password configured can establish TCP connections.

·     Perform MD5 calculation on TCP segments to avoid modification to the encapsulated BGP packets.

For security purposes, all passwords, including passwords configured in plain text, are saved in cipher text.

Examples

# In BGP view, perform MD5 authentication on the TCP connection between local router 10.1.100.1 and peer router 10.1.100.2, and set the plaintext authentication password to aabbcc.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 10.1.100.2 password simple aabbcc

# Perform similar configuration on the peer.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 10.1.100.1 password simple aabbcc

# In BGP-VPN instance view, perform MD5 authentication on the TCP connection between local router 10.1.100.1 and peer router 10.1.100.2, and set the plaintext authentication password to aabbcc.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 10.1.100.2 password simple aabbcc

# Perform similar configuration on the peer.

<Sysname> system-view

[Sysname] bgp 200

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 10.1.100.1 password simple aabbcc

peer preferred-value

Use peer preferred-value to specify a preferred value for routes received from a peer or peer group.

Use undo peer preferred-value to restore the default.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

peer { group-name | ip-address [ mask-length ] } preferred-value value

undo peer { group-name | ip-address [ mask-length ] } preferred-value

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } preferred-value value

undo peer { group-name | ipv6-address [ prefix-length ] } preferred-value

Default

The preferred value is 0.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command specifies a preferred value for routes received from all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command specifies a preferred value for routes received from all dynamic peers in the network.

value: Specifies the preferred value in the range of 0 to 65535.

Usage guidelines

If multiple routes that have the same destination are learned from different peers, you can specify different preferred values for the routes as needed to control BGP path selection. The one with the greatest preferred value is selected as the optimal route to the destination.

The preferred value is used for route selection on the local router and is not advertised to the peer. It has only local significance.

Examples

# In BGP IPv4 unicast address family view, specify the preferred value as 50 for routes from peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer 1.1.1.1 preferred-value 50

# In BGP-VPN IPv6 unicast address family view, specify the preferred value as 50 for routes from peer 1::1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] peer 1::1 preferred-value 50

peer public-as-only

Use peer public-as-only to remove private AS numbers in BGP updates sent to an EBGP peer or peer group.

Use undo peer public-as-only to restore the default.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

peer { group-name | ip-address [ mask-length ] } public-as-only

undo peer { group-name | ip-address [ mask-length ] } public-as-only

In BGP IPv6 unicast address family view/BGP-VPN IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } public-as-only

undo peer { group-name | ipv6-address [ prefix-length ] } public-as-only

Default

BGP updates sent to an EBGP peer or peer group can carry both public and private AS numbers.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command removes private AS numbers in BGP updates sent to all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command removes private AS numbers in BGP updates sent to all dynamic peers in the network.

Usage guidelines

Private AS numbers are typically used in test networks, and need not be transmitted in public networks. The range of private AS numbers is from 64512 to 65535.

After you execute the command, you can get the following results:

·     If the AS_PATH attribute of a BGP update carries only private AS numbers, the device removes the AS numbers before sending the update to the EBGP peer or peer group.

·     If the AS_PATH attribute carries both public and private AS numbers, the command does not take effect. The device sends the BGP update to the EBGP peer or peer group without removing the private AS numbers.

·     If the AS_PATH attribute carries AS numbers of the peer or peer group, the command does not take effect. The device sends the BGP update to the peer or peer group without removing the private AS numbers.

This command is only applicable to an EBGP peer or peer group.

Examples

# In BGP IPv4 unicast address family view, remove private AS numbers in BGP updates sent to EBGP peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer test public-as-only

# In BGP-VPN IPv6 unicast address family view, remove private AS numbers in BGP updates sent to EBGP peer group test.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] peer test public-as-only

peer reflect-client

Use peer reflect-client to configure the device as a route reflector and specify a peer or peer group as a client.

Use undo peer reflect-client to restore the default.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

peer { group-name | ip-address [ mask-length ] } reflect-client

undo peer { group-name | ip-address [ mask-length ] } reflect-client

In BGP IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } reflect-client

undo peer { group-name | ipv6-address [ prefix-length ] } reflect-client

Default

Neither the route reflector nor the client is configured.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command configures the device as a route reflector and specifies all dynamic peers in the network as clients.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command configures the device as a route reflector and specifies all dynamic peers in the network as clients.

Usage guidelines

Using route reflectors can solve the issue brought by too many IBGP connections. In an AS, a router acts as a route reflector, and other routers act as clients connecting to the route reflector. The route reflector forwards the routing information received from a client to other clients. In this way, all clients can receive routing information from one another without establishing BGP sessions.

Examples

# In BGP IPv4 unicast address family view, configure the local device as a route reflector and specify IBGP peer group test as a client.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer test reflect-client

# In BGP-VPN IPv6 unicast address family view, configure the local device as a route reflector and specify IBGP peer group test as a client.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] peer test reflect-client

Related commands

·     reflect between-clients

·     reflector cluster-id

peer route-limit

Use peer route-limit to specify the maximum number of routes that can be received from a peer or peer group.

Use undo peer route-limit to restore the default.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view:

peer { group-name | ip-address [ mask-length ] } route-limit prefix-number [ { alert-only | discard | reconnect reconnect-time } | percentage-value ] *

undo peer { group-name | ip-address [ mask-length ] } route-limit

In BGP IPv6 unicast address family view:

peer { group-name | ipv6-address [ prefix-length ] } route-limit prefix-number [ { alert-only | discard | reconnect reconnect-time } | percentage-value ] *

undo peer { group-name | ipv6-address [ prefix-length ] } route-limit

Default

The number of routes that can be received from a peer or peer group is not limited.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command specifies the maximum number of routes that can be received from all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command specifies the maximum number of routes that can be received from all dynamic peers in the network.

prefix-number: Specifies the number of routes that can be received from the peer or peer group. The value range is 1 to 4294967295. If the following conditions exist, the router will tear down the session to the peer or peer group and will not attempt to re-establish it:

·     The alert-only, discard, and reconnect keywords are not specified.

·     The number of routes received from the peer or peer group reaches the prefix-number.

You can use the reset bgp command to re-establish the session.

alert-only: If the number of routes received from the peer or peer group reaches the prefix-number, the router generates a log message instead of tearing down the session to the peer or peer group. The router can continue to receive routes from the peer or peer group.

discard: If the number of routes received from the peer or peer group reaches the prefix-number, the router retains the session to the peer or peer group, but it discards excess routes and generates a log message. After the number of routes received from the peer or peer group falls below the prefix-number, the router can continue to receive routes from the peer or peer group. To restore the discarded routes, use the refresh bgp import command to request the peer or peer group to resend the routes.

reconnect reconnect-time: Specifies a reconnect time. After the specified time is reached, the router re-establishes a session to the peer or peer group when the number of routes received from the peer or peer group reaches the prefix-number. The value range for the reconnect-time argument is 1 to 65535 seconds.

percentage-value: Specifies the threshold value for the router to generate a log message (the router generates a log message when the ratio of the number of received routes to the prefix-number exceeds the percentage value). The value range of this argument is 1 to 100, and the default is 75.

Examples

# In BGP IPv4 unicast address family view, specify the maximum number of routes that can be received from peer 1.1.1.1 to 10000. Configure the router to tear down the session to the peer if the number is exceeded.

<Sysname> system-view

[Sysname] bgp 109

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] peer 1.1.1.1 route-limit 10000

# In BGP-VPN IPv4 unicast address family view, specify the maximum number of routes that can be received from peer 1.1.1.1 to 10000. Configure the router to tear down the session to the peer if the number is exceeded.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] peer 1.1.1.1 route-limit 10000

# In BGP IPv6 unicast address family view, specify the maximum number of routes that can be received from peer 1::1 to 10000. Configure the router to tear down the session to the peer if the number is exceeded.

<Sysname> system-view

[Sysname] bgp 109

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] peer 1::1 route-limit 10000

peer route-update-interval

Use peer route-update-interval to specify an interval for sending the same update to a peer or peer group.

Use undo peer route-update-interval to restore the default.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } route-update-interval interval

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } route-update-interval

Default

The interval for sending the same update to an IBGP peer is 15 seconds and the interval for sending the same update to an EBGP peer is 30 seconds.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command specifies an interval for sending the same update to all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command specifies an interval for sending the same update to all dynamic peers in the network.

interval: Specifies a minimum interval for sending the same update message. The range is 0 to 600 seconds.

Usage guidelines

A BGP router sends an update message to its peers when a route is changed. If the route changes frequently, the BGP router sends many updates for the route, resulting in routing flaps. By configuring the interval for sending the same update to a peer or peer group, you can avoid such routing flaps.

Examples

# In BGP view, specify the interval for sending the same update to peer group test as 10 seconds.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer test as-number 100

[Sysname-bgp] peer test route-update-interval 10

# In BGP-VPN instance view, specify the interval for sending the same update to peer group test as 10 seconds.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer test route-update-interval 10

peer substitute-as

Use peer substitute-as to replace the AS number of a peer or peer group in the AS_PATH attribute with the local AS number.

Use undo peer substitute-as to restore the default.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } substitute-as

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } substitute-as

Default

The AS number of a peer or peer group in the AS_PATH attribute is not replaced.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command replaces the AS number of all dynamic peers in the network in the AS_PATH attribute with the local AS number.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command replaces the AS number of all dynamic peers in the network in the AS_PATH attribute with the local AS number.

Usage guidelines

If CEs in different geographical areas use the same AS number, you must configure the relevant PE to replace the AS number of the CE as its own AS number. This ensures correct advertisement of private network routes.

Examples

# In BGP view, substitute the local AS number for the AS number of peer 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer 1.1.1.1 substitute-as

# In BGP-VPN instance view, substitute the local AS number for the AS number of peer 1::1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer 1::1 substitute-as

peer timer

Use peer timer to configure a keepalive interval and holdtime for a peer or peer group.

Use undo peer timer to restore the default.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } timer keepalive keepalive hold holdtime

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } timer

Default

The keepalive interval is 60 seconds, and the holdtime is 180 seconds.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command configures a keepalive interval and holdtime for all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command configures a keepalive interval and holdtime for all dynamic peers in the network.

keepalive keepalive: Sets a keepalive interval in the range of 0 to 21845 seconds.

hold holdtime: Sets a holdtime in the range of 3 to 65535 seconds. The holdtime must be at least three times the keepalive interval.

Usage guidelines

After establishing a BGP session, two routers send keepalive messages at the specified keepalive interval to each other to keep the session.

If a router receives no keepalive or update message from the peer within the holdtime, it tears down the session.

The timers configured with this command are preferred to the timers configured with the timer command.

If the holdtime settings on the local and peer routers are different, the smaller one is used.

If the holdtime is configured as 0, no keepalive message will be sent to the peer, and the peer session will never time out. If the keepalive interval is configured as 0 and the negotiated holdtime is not 0, one third of the holdtime is taken as the interval for sending keepalive messages. If neither the holdtime nor the keepalive interval is configured as 0, the actual keepalive interval is the smaller one between one third of the holdtime and the keepalive interval.

After this command is executed, the peer session is closed at once, and a new session to the peer is negotiated by using the configured holdtime.

Examples

# In BGP view, configure the keepalive interval and holdtime for peer group test as 60 seconds and 180 seconds.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer test timer keepalive 60 hold 180

# In BGP-VPN instance view, configure the keepalive interval and holdtime interval for peer group test as 60 seconds and 180 seconds.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer test timer keepalive 60 hold 180

# In BGP view, configure both the keepalive interval and holdtime for peer group test as 0 seconds, indicating the session will never time out.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer test timer keepalive 0 hold 0

# In BGP-VPN instance view, configure both the keepalive interval and holdtime for peer group test as 0 seconds, indicating the session will never time out.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer test timer keepalive 0 hold 0

Related commands

·     display bgp peer

·     timer

peer ttl-security

Use peer ttl-security to configure Generalized TTL Security Mechanism (GTSM) for a BGP peer or peer group.

Use undo peer ttl-security to restore the default.

Syntax

peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } ttl-security hops hop-count

undo peer { group-name | ip-address [ mask-length ] | ipv6-address [ prefix-length ] } ttl-security hops

Default

GTSM is disabled for BGP.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command configures GTSM for all dynamic peers in the network.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command configures GTSM for all dynamic peers in the network.

hops hop-count: Specifies the maximum number of hops to the specified peer, in the range of 1 to 254.

Usage guidelines

GTSM protects a BGP session by comparing the TTL value of an incoming IP packet against the valid TTL range. If the TTL value is within the valid TTL range, the packet is accepted. If not, the packet is discarded.

The valid TTL range is from 255 – the configured hop count + 1 to 255.

When GTSM is configured, the BGP packets sent by the device have a TTL of 255.

When GTSM is configured, the local device can establish an EBGP session with the peer after both devices pass GTSM check, regardless of whether the maximum number of hops is reached.

To use GTSM, you must configure GTSM on both the local and peer devices. You can specify different hop-count values for them.

Examples

# In BGP view, enable GTSM for BGP peer group test and specify the maximum number of hops to the specified peer in the peer group as 1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] peer test ttl-security hops 1

# In BGP-VPN instance view, enable GTSM for BGP peer group test and specify the maximum number of hops to the specified peer in the peer group as 1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] peer test ttl-security hops 1

Related commands

peer ebgp-max-hop

pic

Use pic to enable BGP FRR for a BGP address family.

Use undo pic to disable BGP FRR for a BGP address family.

Syntax

pic

undo pic

Default

BGP FRR is disabled.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Usage guidelines

FRR is used in a dual-homing network to protect a primary route with a backup route. It uses ARP, echo-mode BFD (for IPv4), or ND (for IPv6) to detect the connectivity of the primary route. When the primary route fails, BGP directs packets to the backup route.

After you enable FRR, BGP calculates a backup route for a BGP route in the address family if there are two or more unequal-cost routes to reach the destination.

Use the pic command with caution because it might cause routing loops in specific scenarios.

Examples

# Enable BGP FRR in BGP IPv4 unicast address family view.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] pic

preference

Use preference to configure preferences for BGP routes.

Use undo preference to restore the default.

Syntax

preference external-preference internal-preference local-preference

undo preference

Default

The preferences of external, internal, and local BGP routes are 255, 255, and 130.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

external-preference: Specifies a preference for EBGP routes, in the range of 1 to 255.

internal-preference: Specifies a preference for IBGP routes, in the range of 1 to 255.

local-preference: Specifies a preference for local routes, in the range of 1 to 255.

Usage guidelines

Different routing protocols might find different routes to the same destination. However, not all of those routes are optimal. For route selection, routing protocols, direct routes, and static routes are assigned different preferences. The route with the highest preference is preferred.

Configuring the preferences for BGP routes changes the possibility for the routes to become the optimal route.

Examples

# In BGP IPv4 unicast address family view, configure preferences for EBGP, IBGP, and local routes as 20, 20, and 200.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] preference 20 20 200

# In BGP-VPN IPv6 unicast address family view, configure preferences for EBGP, IBGP, and local routes as 20, 20, and 200.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv6 unicast

[Sysname-bgp-ipv6-vpn1] preference 20 20 200

primary-path-detect bfd

Use primary-path-detect bfd to configure BGP FRR to use BFD to detect next hop connectivity for the primary route.

Use undo primary-path-detect bfd to restore the default.

Syntax

primary-path-detect bfd echo

undo primary-path-detect bfd

Default

BGP FRR uses ARP to detect the connectivity to the next hop of the primary route.

Views

BGP view

Predefined user roles

network-admin

Parameters

echo: Uses echo-mode BFD to detect the connectivity to the next hop of the primary route.

Examples

# Configure BGP FRR to use echo-mode BFD to detect next hop connectivity for the primary route.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] primary-path-detect bfd echo

Related commands

pic

reflect between-clients

Use reflect between-clients to enable route reflection between clients.

Use undo reflect between-clients to disable this function.

Syntax

reflect between-clients

undo reflect between-clients

Default

Route reflection between clients is enabled.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Usage guidelines

When a route reflector is configured, and the clients of a route reflector are fully meshed, route reflection is unnecessary because it consumes more bandwidth resources. You can use the undo reflect between-clients command to disable route reflection instead of modifying network configuration or changing network topology.

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

Examples

# In BGP IPv4 unicast address family view, disable route reflection between clients.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] undo reflect between-clients

# In BGP-VPN IPv4 unicast address family view, disable route reflection between clients.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] undo reflect between-clients

# In BGP IPv6 unicast address family view, disable route reflection between clients.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] undo reflect between-clients

Related commands

·     peer reflect-client

·     reflector cluster-id

reflector cluster-id

Use reflector cluster-id to configure the cluster ID for a route reflector.

Use undo reflector cluster-id to restore the default.

Syntax

reflector cluster-id { cluster-id | ip-address }

undo reflector cluster-id

Default

A route reflector uses its router ID as the cluster ID.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

Parameters

cluster-id: Specifies the cluster ID in the format of an integer, in the range of 1 to 4294967295.

ip-address: Specifies the cluster ID in the format of an IPv4 address in dotted decimal notation.

Usage guidelines

The route reflector and clients form a cluster. Typically a cluster has one route reflector. The ID of the route reflector is the cluster ID.

You can configure more than one route reflector in a cluster to improve network reliability and prevent a single point of failure. Use this command to configure the same cluster ID for all route reflectors in the cluster to avoid routing loops.

Do not configure the router ID of a client as the cluster ID.

Examples

# In BGP IPv4 unicast address family view, configure the cluster ID on the local router (a reflector in the cluster) as 80.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] reflector cluster-id 80

# In BGP-VPN IPv4 unicast address family view, configure the cluster ID on the local router (a reflector in the cluster) as 80.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] reflector cluster-id 80

# In BGP IPv6 unicast address family view, configure the cluster ID on the local router (a reflector in the cluster) as 80.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv6 unicast

[Sysname-bgp-ipv6] reflector cluster-id 80

Related commands

·     peer reflect-client

·     reflect between-clients

refresh bgp

Use refresh bgp to manually soft-reset BGP sessions.

Syntax

refresh bgp { ip-address [ mask-length ]| all | external | group group-name | internal } { export | import } ipv4 [ unicast ] [ vpn-instance vpn-instance-name ]

refresh bgp { ipv6-address [ prefix-length ] | all | external | group group-name | internal } { export | import } ipv6 [ unicast ] [ vpn-instance vpn-instance-name ]

Views

User view

Predefined user roles

network-admin

Parameters

ip-address: Soft-resets the BGP session to a peer specified by its IP address.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command soft-resets BGP sessions to all dynamic peers in the network.

ipv6-address: Soft-resets the BGP session to a peer specified by its IPv6 address.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command soft-resets BGP sessions to all dynamic peers in the network.

all: Soft-resets all BGP sessions.

external: Soft-resets all EBGP sessions.

group group-name: Soft-resets the BGP sessions to the peers of the specified peer group. The group-name argument is the name of a peer group, a case-sensitive string of 1 to 47 characters.

internal: Soft-resets all IBGP sessions.

export: Performs outbound soft-reset (filters routes advertised to the specified peer or peer group by using the new configuration).

import: Performs inbound soft-reset (filters routes received from the specified peer or peer group by using the new configuration).

ipv4: Soft-resets BGP sessions for IPv4 address family.

ipv6: Soft-resets BGP sessions for IPv6 address family.

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command soft-resets BGP sessions for the specified address family on the public network.

Usage guidelines

A soft-reset operation enables the router to apply a new route selection policy without tearing down BGP connections.

To apply a new policy to outbound BGP sessions, execute this command with the export keyword. The router uses the new policy to filter routing information and sends the routing information that passes the filtering to the BGP peers.

To apply a new policy to inbound sessions, execute this command with the import keyword. The router advertises a route-refresh message to the peer and the peer resends its routing information to the router.

This command requires that both the local router and the peer support route refresh.

If the peer keep-all-routes command is configured, the refresh bgp ipv4 unicast import command does not take effect.

This command soft-resets BGP sessions for unicast address families regardless of whether the unicast keyword is specified.

Examples

# Soft-reset all inbound BGP sessions for the IPv4 unicast address family.

<Sysname> refresh bgp all import ipv4

# Soft-reset all inbound BGP sessions for the IPv6 unicast address family.

<Sysname> refresh bgp all import ipv6

# Soft-reset all outbound BGP sessions for the IPv4 multicast address family.

<Sysname> refresh bgp all export ipv4 multicast

# Soft-reset all outbound BGP sessions for the IPv6 multicast address family.

<Sysname> refresh bgp all export ipv6 multicast

Related commands

·     peer capability-advertise route-refresh

·     peer keep-all-routes

reset bgp

Use reset bgp to reset BGP sessions for the specified address family.

Syntax

reset bgp { as-number | ip-address [ mask-length ] | all | external | group group-name | internal } ipv4 [ unicast ] [ vpn-instance vpn-instance-name ]

reset bgp { as-number | ipv6-address [ prefix-length ] | all | external | group group-name | internal } ipv6  [ unicast ] [ vpn-instance vpn-instance-name ]

Views

User view

Predefined user roles

network-admin

Parameters

as-number: Resets BGP sessions to peers in the AS specified by its number in the range of 1 to 4294967295.

ip-address: Resets the BGP session to a peer specified by its IP address.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ip-address and mask-length arguments together to specify a network. If you specify a network, this command resets BGP sessions to all dynamic peers in the network.

ipv6-address: Resets the BGP session to a peer specified by its IPv6 address.

prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a network. If you specify a network, this command resets BGP sessions to all dynamic peers in the network.

all: Resets all BGP sessions.

external: Resets all EBGP sessions.

group group-name: Resets the BGP sessions to the peers in the peer group specified by its name, a case-sensitive string of 1 to 47 characters.

internal: Resets all IBGP sessions.

ipv4: Resets BGP sessions for IPv4 address family.

ipv6: Resets BGP sessions for IPv6 address family.

unicast: Resets BGP sessions for unicast address family.

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command resets BGP sessions for the specified address family on the public network.

Usage guidelines

A reset operation enables the router to apply a new route selection policy by re-establishing BGP sessions. This operation breaks down BGP sessions for a short while.

The unicast keyword is used if neither the unicast nor multicast keyword is specified.

Examples

# Reset all BGP sessions for the IPv4 unicast address family.

<Sysname> reset bgp all ipv4

# Reset all BGP sessions for the IPv6 unicast address family.

<Sysname> reset bgp all ipv6

# Reset all BGP sessions for the IPv4 multicast address family.

<Sysname> reset bgp all ipv4 multicast

# Reset all BGP sessions for the IPv6 multicast address family.

<Sysname> reset bgp all ipv6 multicast

reset bgp all

Use reset bgp all to reset all BGP sessions for all address families.

Syntax

reset bgp all

Views

User view

Predefined user roles

network-admin

Usage guidelines

To apply a new route selection policy, use this command to reset BGP sessions. BGP re-establishes the BGP sessions, advertises routes, and applies the new policy to routes. This operation breaks down BGP sessions for a short period of time.

Examples

# Reset all BGP sessions.

<Sysname> reset bgp all

reset bgp dampening ipv4 unicast

Use reset bgp dampening ipv4 unicast to clear BGP IPv4 unicast route dampening information and release the suppressed BGP IPv4 unicast routes.

Syntax

reset bgp dampening ipv4 [ unicast ] [ vpn-instance vpn-instance-name ] [ network-address [ mask | mask-length ] ]

Views

User view

Predefined user roles

network-admin

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command clears BGP IPv4 unicast route dampening information for the public network, and releases the suppressed BGP IPv4 unicast routes.

network-address: Specifies a destination network address.

mask: Specifies a network mask, in dotted decimal notation.

mask-length: Specifies a mask length in the range of 0 to 32.

Usage guidelines

If you do not specify the network-address, mask, and mask-length arguments, the command clears all BGP IPv4 unicast route dampening information of the public network or the specified VPN, and releases all suppressed BGP IPv4 unicast routes.

If you specify only the network-address argument, the system ANDs the network address with the mask of a route. If the result matches the network address of the route, the command clears dampening information of the route, and releases the suppressed route.

If you specify the network-address mask or network-address mask-length argument, the command does the following:

·     Clears dampening information of the BGP IPv4 unicast route that matches both the specified destination network address and the mask (or mask length).

·     Releases the suppressed route.

This command clears BGP IPv4 unicast route dampening information and releases the suppressed BGP IPv4 unicast routes regardless of whether the unicast keyword is specified.

Examples

# Clear damping information of BGP IPv4 unicast route 20.1.0.0/16 for the public network, and release the suppressed route.

<Sysname> reset bgp dampening ipv4 20.1.0.0 255.255.0.0

Related commands

·     dampening

·     display bgp routing-table dampened ipv4 unicast

reset bgp dampening ipv6 unicast

Use reset bgp dampening ipv6 unicast to clear BGP IPv6 unicast route dampening information and release suppressed BGP IPv6 unicast routes.

Syntax

reset bgp dampening ipv6 [ unicast ] [ vpn-instance vpn-instance-name ] [ network-address prefix-length ]

Views

User view

Predefined user roles

network-admin

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command clears BGP IPv6 unicast route dampening information for the public network, and releases the suppressed BGP IPv6 unicast routes.

network-address prefix-length: Specifies a destination network address and prefix length. The value range for the prefix-length argument is 0 to 128. If you do not specify this argument, the command clears all BGP IPv6 unicast route dampening information, and releases all suppressed BGP IPv6 unicast routes.

Usage guidelines

This command clears BGP IPv6 unicast route dampening information and releases suppressed BGP IPv6 unicast routes regardless of whether the unicast keyword is specified.

Examples

# Clear damping information of BGP IPv6 unicast route 2345::/16 for the public network, and release the suppressed route.

<Sysname> reset bgp dampening ipv6 2345:: 16

Related commands

·     dampening

·     display bgp routing-table dampened ipv6 unicast

reset bgp flap-info ipv4 unicast

Use reset bgp flap-info ipv4 unicast to clear the flap statistics of BGP IPv4 unicast routes.

Syntax

reset bgp flap-info ipv4 [ unicast ] [ vpn-instance vpn-instance-name ] [ network-address [ mask | mask-length ] | peer peer-address ]

Views

User view

Predefined user roles

network-admin

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command clears the flap statistics of the BGP IPv4 unicast routes for the public network.

network-address: Specifies a destination network address.

mask: Specifies a network mask, in dotted decimal notation.

mask-length: Specifies a mask length in the range of 0 to 32.

peer peer-address: Clears flap statistics of BGP IPv4 unicast routes learned from the specified BGP peer.

Usage guidelines

If you do not specify the network-address, mask, and mask-length arguments, the command clears the flap statistics of all BGP IPv4 unicast routes for the public network or the specified VPN.

If you specify only the network-address argument, the system ANDs the network address with the mask of a route. If the result matches the network address of the route, the command clears the flap statistics of the route.

If you specify the network-address mask or network-address mask-length argument, the command clears the flap statistics of the BGP IPv4 unicast route that matches both the specified destination network address and the mask (or mask length).

This command clears the flap statistics of BGP IPv4 unicast routes regardless of whether the unicast keyword is specified.

Examples

# Clear the flap statistics of BGP IPv4 unicast route 20.1.0.0/16 for the public network.

<Sysname> reset bgp flap-info ipv4 20.1.0.0 16

# Clear the flap statistics for the public network BGP IPv4 unicast routes learned from peer 1.1.1.1.

<Sysname> reset bgp flap-info ipv4 peer 1.1.1.1

Related commands

·     dampening

·     display bgp routing-table flap-info ipv4 unicast

reset bgp flap-info ipv6 unicast

Use reset bgp flap-info ipv6 unicast to clear the flap statistics of BGP IPv6 unicast routes.

Syntax

reset bgp flap-info ipv6 [ unicast ] [ vpn-instance vpn-instance-name ] [ network-address prefix-length | peer ipv6-address ]

Views

User view

Predefined user roles

network-admin

Parameters

vpn-instance vpn-instance-name: Specifies a VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, this command clears the flap statistics of the BGP IPv6 unicast routes for the public network.

network-address prefix-length: Specifies the destination network address and prefix length. The value range for the prefix-length argument is 0 to 128. If you do not specify this argument, the command clears the flap statistics of all BGP IPv6 unicast routes.

peer ipv6-address: Clears flap statistics of BGP IPv6 unicast routes learned from the specified BGP peer.

Usage guidelines

This command clears the flap statistics of BGP IPv6 unicast routes regardless of whether the unicast keyword is specified.

Examples

# Clear the flap statistics of BGP IPv6 unicast route 2345::/16 for the public network.

<Sysname> reset bgp flap-info ipv6 2345:: 16

# Clear the flap statistics for the public network BGP IPv6 unicast routes learned from peer 1::1.

<Sysname> reset bgp flap-info ipv6 peer 1::1

Related commands

·     dampening

·     display bgp routing-table flap-info ipv6 unicast

router id (system view)

Use router id to configure a global router ID.

Use undo router id to remove the global router ID.

Syntax

router id router-id

undo router id

Default

No global router ID is configured.

Views

System view

Predefined user roles

network-admin

Parameters

router-id: Specifies a router ID in IP address format.

Usage guidelines

Some routing protocols use a router ID to identify a device. You can configure a global router ID, which is used by routing protocols that have no router ID configured.

If no global router ID is configured, the highest loopback address, if any, is used as the router ID. If no loopback address is available, the highest physical interface IP address is used, regardless of the interface status. If no IP address is configured for any interface, the router ID is 0.0.0.0.

During an active/standby switchover, the member device running the standby process checks the validity of the previous router ID backed up before switchover. If it is not valid, it selects a new router ID.

If the interface IP address that is selected as the router ID is removed or modified, a new router ID is selected. The following events will not trigger a router ID re-selection:

·     The interface goes down.

·     After a physical interface address is selected as the router ID, an IP address is configured for a loopback interface.

·     A higher interface IP address is configured.

After a router ID is changed, use the reset command to make it effective.

Examples

# Configure a global router ID as 1.1.1.1.

<Sysname> system-view

[Sysname] router id 1.1.1.1

Related commands

router-id

router-id (BGP view)

Use router-id to configure a router ID for BGP.

Use undo router-id to remove the router ID for BGP.

Syntax

router-id router-id

undo router-id

Default

BGP uses the global router ID configured by router id in system view.

Views

BGP view

Predefined user roles

network-admin

Parameters

router-id: Specifies a router ID for BGP, in IP address format.

Usage guidelines

To run BGP, a router must have a router ID, which is an unsigned 32-bit integer that uniquely identifies the router in the AS.

To modify a non-zero router ID for BGP, execute the router-id command in BGP view.

To improve availability, specify the IP address of a loopback interface as the router ID for BGP.

If you execute this command in the same BGP view multiple times, the most recent configuration takes effect.

Examples

# Configure the router ID for BGP as 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] router-id 1.1.1.1

Related commands

·     router id (system view)

·     router-id (BGP-VPN instance view)

router-id (BGP-VPN instance view)

Use router-id to configure a router ID for a BGP VPN instance.

Use undo router-id to remove the router ID for a BGP VPN instance.

Syntax

router-id { router-id | auto-select }

undo router-id

Default

A BGP VPN instance uses the router ID configured in BGP view. If no router ID is configured in BGP view, the BGP VPN instance uses the global router ID configured in system view.

Views

BGP-VPN instance view

Predefined user roles

network-admin

Parameters

router-id: Specifies a router ID in IP address format.

auto-select: Automatically selects a router ID for the BGP VPN instance.

Usage guidelines

To run BGP, a VPN instance must have a router ID, which is an unsigned 32-bit integer that uniquely identifies the BGP VPN router in the AS.

To improve availability, specify the IP address of a loopback interface as the router ID.

You can specify a different router ID for each VPN instance on a device.

If you execute this command in the same BGP-VPN instance view multiple times, the most recent configuration takes effect.

If the auto-select keyword is specified, the system selects a router ID for the BGP VPN instance in the following order:

1.     The highest loopback address in the BGP VPN instance as the router ID.

2.     The highest physical interface address in the BGP VPN instance as the router ID, regardless of the interface status.

3.     0.0.0.0 as the router ID.

If a non-zero router ID is selected for the BGP VPN instance, the router ID will not change when a more preferable router ID is available in the BGP VPN instance.

Examples

# In BGP-VPN instance view, configure the router ID as 1.1.1.1.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] router-id 1.1.1.1

Related commands

·     router-id (system view)

·     router-id (BGP view)

snmp-agent trap enable bgp

Use snmp-agent trap enable bgp to enable SNMP notifications for BGP.

Use undo snmp-agent trap enable bgp to disable SNMP notifications for BGP.

Syntax

snmp-agent trap enable bgp

undo snmp-agent trap enable bgp

Default

SNMP notifications for BGP are enabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

This feature enables BGP to generate SNMP notifications. The generated SNMP notifications are sent to the SNMP module.

For more information about SNMP notifications, see Network Management and Monitoring Configuration Guide.

Examples

# Enable SNMP notifications for BGP.

<Sysname> system-view

[Sysname] snmp-agent trap enable bgp

summary automatic

Use summary automatic to configure automatic route summarization for redistributed IGP subnet routes.

Use undo summary automatic to remove the configuration.

Syntax

summary automatic

undo summary automatic

Default

Automatic route summarization is not performed for redistributed IGP subnet routes.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view

Predefined user roles

network-admin

Usage guidelines

After the summary automatic command is configured, BGP summarizes IGP subnets redistributed by the import-route command.

Automatic summary routes can be manually summarized, but cannot be added to the IP routing table.

Examples

# In BGP IPv4 unicast address family view, configure automatic route summarization for redistributed IGP subnet routes.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] address-family ipv4 unicast

[Sysname-bgp-ipv4] summary automatic

# In BGP-VPN IPv4 unicast address family view, configure automatic route summarization for redistributed IGP subnet routes.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] address-family ipv4 unicast

[Sysname-bgp-ipv4-vpn1] summary automatic

Related commands

·     aggregate

·     import-route

timer

Use timer to configure a BGP keepalive interval and holdtime.

Use undo timer to restore the default.

Syntax

timer keepalive keepalive hold holdtime

undo timer

Default

The BGP keepalive interval and the holdtime are 60 seconds and 180 seconds.

Views

BGP view, BGP-VPN instance view

Predefined user roles

network-admin

Parameters

keepalive keepalive: Configures a keepalive interval in the range of 0 to 21845 seconds.

hold holdtime: Configures a holdtime in seconds, whose value is 0 or in the range of 3 to 65535. The holdtime must be at least three times the keepalive interval.

Usage guidelines

After establishing a BGP session, two routers send keepalive messages at the specified keepalive interval to each other to keep the session.

If a router receives no keepalive or update message from the peer within the holdtime, it tears down the session.

Use the timer command to configure the keepalive interval and holdtime for all BGP peers. Use the peer timer command to configure the keepalive interval and holdtime for a peer or peer group. If both commands are configured, the intervals configured by the peer timer command have higher priority.

If the holdtime settings on the local and peer routers are different, the smaller one is used.

If the holdtime is configured as 0, no keepalive message will be sent to the peer, and the peer session will never time out. If the keepalive interval is configured as 0 and the negotiated holdtime is not 0, one third of the holdtime is taken as the interval for sending keepalive messages. If neither the holdtime nor the keepalive interval is configured as 0, the actual keepalive interval is the smaller one between one third of the holdtime and the keepalive interval.

The timer command affects only new BGP sessions.

After the timer command is executed, no peer session is closed at once. The configured holdtime is used for negotiation in session re-establishment (for example, when you reset the BGP session).

Examples

# In BGP view, configure the keepalive interval and holdtime as 60 seconds and 180 seconds.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] timer keepalive 60 hold 180

# In BGP-VPN instance view, configure the keepalive interval and holdtime as 60 seconds and 180 seconds.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] timer keepalive 60 hold 180

# In BGP view, configure both the keepalive interval and holdtime as 0 seconds, indicating the sessions will never time out.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] timer keepalive 0 hold 0

# In BGP-VPN instance view, configure both the keepalive interval and holdtime as 0 seconds for BGP sessions in vpn1, indicating the sessions will never time out.

<Sysname> system-view

[Sysname] bgp 100

[Sysname-bgp] ip vpn-instance vpn1

[Sysname-bgp-vpn1] timer keepalive 0 hold 0

Related commands

·     display bgp peer

·     peer timer