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 { ipv6-address [ prefix-length ] } group group-name [ as-number as-number ]

undo peer { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } group group-name

Default

No peers exist in a peer group.

Views

BGP instance view

BGP-VPN instance view

Predefined user roles

network-admin

Parameters

ipv4-address: Specifies a peer by its IPv4 address.

mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command adds all dynamic peers in the subnet 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 subnet. If you specify a subnet, this command adds all dynamic peers in the subnet 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:

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 instance view, add peer 10.1.1.1 to EBGP peer group test.

<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp-default] group test external
[Sysname-bgp-default] peer 10.1.1.1 group test as-number 2004

Related commands

group

peer as-number

peer enable