Configuring a BGP peer group

The peers in a peer group use the same route selection policy.

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. When you change the policy for the group, the modification also applies to the peers in the group.

A peer group is an IBGP peer group if peers in it belong to the local AS, and is an EBGP peer group if peers in it belong to different ASs.

Configuring an IBGP peer group

After you create an IBGP peer group and then add a peer into it, the system creates the peer in BGP instance view and specifies the local AS number for the peer.

To configure an IBGP peer group (IPv4 unicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view or BGP-VPN instance view.

  • Enter BGP instance view:bgp as-number [ instance instance-name ]

  • Enter BGP-VPN instance view:

    1. bgp as-number [ instance instance-name ]

    2. ip vpn-instance vpn-instance-name

N/A

3. Create an IBGP peer group.

group group-name [ internal ]

By default, no IBGP peer groups exist.

4. Add a peer into the IBGP peer group.

peer ipv4-address [ mask-length ] group group-name [ as-number as-number ]

By default, no peer exists in the peer group.

The as-number as-number option must specify the local AS number.

5. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

6. Create the BGP IPv4 unicast address family or BGP-VPN IPv4 unicast address family and enter its view.

address-family ipv4 [ unicast ]

By default, no BGP IPv4 unicast address family or BGP-VPN IPv4 unicast address family exists.

7. Enable the router to exchange IPv4 unicast routing information with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv4 unicast routing information with the peers.

To configure an IBGP peer group (IPv6 unicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view or BGP-VPN instance view.

  • Enter BGP instance view:bgp as-number [ instance instance-name ]

  • Enter BGP-VPN instance view:

    1. bgp as-number [ instance instance-name ]

    2. ip vpn-instance vpn-instance-name

N/A

3. Create an IBGP peer group.

group group-name [ internal ]

By default, no IBGP peer groups exist.

4. Add a peer into the IBGP peer group.

peer ipv6-address [ prefix-length ] group group-name [ as-number as-number ]

By default, no peer exists in the peer group.

The as-number as-number option must specify the local AS number.

5. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

6. Create the BGP IPv6 unicast address family or BGP-VPN IPv6 unicast address family and enter its view.

address-family ipv6 [ unicast ]

By default, no BGP IPv6 unicast address family or BGP-VPN IPv6 unicast address family exists.

7. Enable the router to exchange IPv6 unicast routing information with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv6 unicast routing information with the peers.

To configure an IBGP peer group (IPv4 multicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view.

bgp as-number [ instance instance-name ]

N/A

3. Create an IBGP peer group.

group group-name [ internal ]

By default, no IBGP peer groups exist.

4. Add an IPv4 peer into the IBGP peer group.

peer ipv4-address [ mask-length ] group group-name [ as-number as-number ]

By default, no peer exists in the peer group.

The as-number as-number option must specify the local AS number.

5. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

6. Create the BGP IPv4 multicast address family and enter its view.

address-family ipv4 multicast

By default, no BGP IPv4 multicast address family exists.

7. Enable the router to exchange IPv4 unicast routing information used for RPF check with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv4 unicast routing information used for RPF check with the peers in the peer group.

To configure an IBGP peer group (IPv6 multicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view.

bgp as-number [ instance instance-name ]

N/A

3. Create an IBGP peer group.

group group-name [ internal ]

By default, no IBGP peer groups exist.

4. Add a peer into the IBGP peer group.

peer ipv6-address [ prefix-length ] group group-name [ as-number as-number ]

By default, no peer exists in the peer group.

The as-number as-number option must specify the local AS number.

5. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

6. Create the BGP IPv6 multicast address family and enter its view.

address-family ipv6 multicast

By default, no BGP IPv6 multicast address family exists.

7. Enable the router to exchange IPv6 unicast routing information used for RPF check with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv6 unicast routing information used for RPF check with the peers in the peer group.

Configuring an EBGP peer group

If peers in an EBGP group belong to the same external AS, the EBGP peer group is a pure EBGP peer group. If not, it is a mixed EBGP peer group.

Use one of the following methods to configure an EBGP peer group:

To configure an EBGP peer group by using Method 1 (IPv4 unicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view or BGP-VPN instance view.

  • Enter BGP instance view:bgp as-number [ instance instance-name ]

  • Enter BGP-VPN instance view:

    1. bgp as-number [ instance instance-name ]

    2. ip vpn-instance vpn-instance-name

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Specify the AS number of the group.

peer group-name as-number as-number

By default, no AS number is specified.

If a peer group contains peers, you cannot remove or change its AS number.

5. Add a peer into the EBGP peer group.

peer ipv4-address [ mask-length ] group group-name [ as-number as-number ]

By default, no peers exist in the peer group.

The as-number as-number option, if used, must specify the same AS number as the peer group-name as-number as-number command.

6. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

7. Create the BGP IPv4 unicast address family or BGP-VPN IPv4 unicast address family and enter its view.

address-family ipv4 [ unicast ]

By default, no BGP IPv4 unicast address family or BGP-VPN IPv4 unicast address family exists.

8. Enable the router to exchange IPv4 unicast routing information with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv4 unicast routing information with the peers.

To configure an EBGP peer group by using Method 1 (IPv6 unicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view or BGP-VPN instance view.

  • Enter BGP instance view:bgp as-number [ instance instance-name ]

  • Enter BGP-VPN instance view:

    1. bgp as-number [ instance instance-name ]

    2. ip vpn-instance vpn-instance-name

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Specify the AS number of the group.

peer group-name as-number as-number

By default, no AS number is specified.

If a peer group contains peers, you cannot remove or change its AS number.

5. Add a peer into the EBGP peer group.

peer ipv6-address [ prefix-length ] group group-name [ as-number as-number ]

By default, no peers exist in the peer group.

The as-number as-number option, if used, must specify the same AS number as the peer group-name as-number as-number command.

6. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

7. Create the BGP IPv6 unicast address family or BGP-VPN IPv6 unicast address family and enter its view.

address-family ipv6 [ unicast ]

By default, no BGP IPv6 unicast address family or BGP-VPN IPv6 unicast address family exists.

8. Enable the router to exchange IPv6 unicast routing information with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv6 unicast routing information with the peers.

To configure an EBGP peer group by using Method 1 (IPv4 multicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view.

bgp as-number [ instance instance-name ]

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Specify the AS number of the group.

peer group-name as-number as-number

By default, no AS number is specified.

If a peer group contains peers, you cannot remove or change its AS number.

5. Add an IPv4 BGP peer into the EBGP peer group.

peer ipv4-address [ mask-length ] group group-name [ as-number as-number ]

By default, no peers exist in the peer group.

The as-number as-number option, if used, must specify the same AS number as the peer group-name as-number as-number command.

6. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

7. Create the BGP IPv4 multicast address family and enter its view.

address-family ipv4 multicast

By default, no BGP IPv4 multicast address family exists.

8. Enable the router to exchange IPv4 unicast routing information used for RPF check with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv4 unicast routing information used for RPF check with the peers in the group.

To configure an EBGP peer group by using Method 1 (IPv6 multicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view.

bgp as-number [ instance instance-name ]

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Specify the AS number of the group.

peer group-name as-number as-number

By default, no AS number is specified.

If a peer group contains peers, you cannot remove or change its AS number.

5. Add an IPv6 BGP peer into the EBGP peer group.

peer ipv6-address [ prefix-length ] group group-name [ as-number as-number ]

By default, no peers exist in the peer group.

The as-number as-number option, if used, must specify the same AS number as the peer group-name as-number as-number command.

6. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

7. Create the BGP IPv6 multicast address family and enter its view.

address-family ipv6 multicast

By default, no BGP IPv6 multicast address family exists.

8. Enable the router to exchange IPv6 unicast routing information used for RPF check with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv6 unicast routing information used for RPF check with the peers in the group.

To configure an EBGP peer group by using Method 2 (IPv4 unicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view or BGP-VPN instance view.

  • Enter BGP instance view:bgp as-number [ instance instance-name ]

  • Enter BGP-VPN instance view:

    1. bgp as-number [ instance instance-name ]

    2. ip vpn-instance vpn-instance-name

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Create an IPv4 BGP peer and specify its AS number.

peer ipv4-address [ mask-length ] as-number as-number

By default, no IPv4 BGP peers exist.

5. Add the peer into the EBGP peer group.

peer ipv4-address [ mask-length ] group group-name [ as-number as-number ]

By default, no peers exist in the peer group.

The as-number as-number option, if used, must specify the same AS number as the peer ipv4-address [ mask-length ] as-number as-number command.

6. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

7. Create the BGP IPv4 unicast address family or BGP-VPN IPv4 unicast address family and enter its view.

address-family ipv4 [ unicast ]

By default, no BGP IPv4 unicast address family or BGP-VPN IPv4 unicast address family exists.

8. Enable the router to exchange IPv4 unicast routing information with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv4 unicast routing information with the peers.

To configure an EBGP peer group by using Method 2 (IPv6 unicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view or BGP-VPN instance view.

  • Enter BGP instance view:bgp as-number [ instance instance-name ]

  • Enter BGP-VPN instance view:

    1. bgp as-number [ instance instance-name ]

    2. ip vpn-instance vpn-instance-name

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Create an IPv6 BGP peer and specify its AS number.

peer ipv6-address [ prefix-length ] as-number as-number

By default, no IPv6 BGP peers exist.

5. Add the peer into the EBGP peer group.

peer ipv6-address [ prefix-length ] group group-name [ as-number as-number ]

By default, no peers exist in the peer group.

The as-number as-number option, if used, must specify the same AS number as the peer ipv4-address [ prefix-length ] as-number as-number command.

6. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

7. Create the BGP IPv6 unicast address family or BGP-VPN IPv6 unicast address family and enter its view.

address-family ipv6 [ unicast ]

By default, no BGP IPv6 unicast address family or BGP-VPN IPv6 unicast address family exists.

8. Enable the router to exchange IPv6 unicast routing information with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv6 unicast routing information with the peers.

To configure an EBGP peer group by using Method 2 (IPv4 multicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view.

bgp as-number [ instance instance-name ]

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Create an IPv4 BGP peer and specify its AS number.

peer ipv4-address [ mask-length ] as-number as-number

By default, no IPv4 BGP peers exist.

5. Add the peer into the EBGP peer group.

peer ipv4-address [ mask-length ] group group-name [ as-number as-number ]

By default, no peers exist in the peer group.

The as-number as-number option, if used, must specify the same AS number as the peer ipv4-address [ mask-length ] as-number as-number command.

6. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

7. Create the BGP IPv4 multicast address family and enter its view.

address-family ipv4 multicast

By default, no BGP IPv4 multicast address family exists.

8. Enable the router to exchange IPv4 unicast routing information used for RPF check with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv4 unicast routing information used for RPF check with the peers in the group.

To configure an EBGP peer group by using Method 2 (IPv6 multicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view.

bgp as-number [ instance instance-name ]

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Create an IPv6 BGP peer and specify its AS number.

peer ipv6-address [ prefix-length ] as-number as-number

By default, no IPv6 BGP peers exist.

5. Add the peer into the EBGP peer group.

peer ipv6-address [ prefix-length ] group group-name [ as-number as-number ]

By default, no peers exist in the peer group.

The as-number as-number option, if used, must specify the same AS number as the peer ipv6-address [ prefix-length ] as-number as-number command.

6. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

7. Create the BGP IPv6 multicast address family and enter its view.

address-family ipv6 multicast

By default, no BGP IPv6 multicast address family exists.

8. Enable the router to exchange IPv6 unicast routing information used for RPF check with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv6 unicast routing information used for RPF check with the peers in the group.

To configure an EBGP peer group by using Method 3 (IPv4 unicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view or BGP-VPN instance view.

  • Enter BGP instance view:bgp as-number [ instance instance-name ]

  • Enter BGP-VPN instance view:

    1. bgp as-number [ instance instance-name ]

    2. ip vpn-instance vpn-instance-name

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Add a peer into the EBGP peer group.

peer ipv4-address [ mask-length ] group group-name as-number as-number

By default, no peers exist in the peer group.

5. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

6. Create the BGP IPv4 unicast address family or BGP-VPN IPv4 unicast address family and enter its view.

address-family ipv4 [ unicast ]

By default, no BGP IPv4 unicast address family or BGP-VPN IPv4 unicast address family exists.

7. Enable the router to exchange IPv4 unicast routing information with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv4 unicast routing information with the peers.

To configure an EBGP peer group by using Method 3 (IPv6 unicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view or BGP-VPN instance view.

  • Enter BGP instance view:bgp as-number [ instance instance-name ]

  • Enter BGP-VPN instance view:

    1. bgp as-number [ instance instance-name ]

    2. ip vpn-instance vpn-instance-name

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Add a peer into the EBGP peer group.

peer ipv6-address [ prefix-length ] group group-name as-number as-number

By default, no peers exist in the peer group.

5. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

6. Create the BGP IPv6 unicast address family or BGP-VPN IPv6 unicast address family and enter its view.

address-family ipv6 [ unicast ]

By default, no BGP IPv6 unicast address family or BGP-VPN IPv6 unicast address family exists.

7. Enable the router to exchange IPv6 unicast routing information with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv6 unicast routing information with the peers.

To configure an EBGP peer group by using Method 3 (IPv4 multicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view.

bgp as-number [ instance instance-name ]

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Add an IPv4 BGP peer into the EBGP peer group.

peer ipv4-address [ mask-length ] group group-name as-number as-number

By default, no peers exist in the peer group.

5. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

6. Create the BGP IPv4 multicast address family and enter its view.

address-family ipv4 multicast

By default, no BGP IPv4 multicast address family exists.

7. Enable the router to exchange IPv4 unicast routing information used for RPF check with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv4 unicast routing information used for RPF check with the peers.

To configure an EBGP peer group by using Method 3 (IPv6 multicast address family):

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter BGP instance view.

bgp as-number [ instance instance-name ]

N/A

3. Create an EBGP peer group.

group group-name external

By default, no EBGP peer groups exist.

4. Add an IPv6 BGP peer into the EBGP peer group.

peer ipv6-address [ prefix-length ] group group-name as-number as-number

By default, no peers exist in the peer group.

5. (Optional.) Configure a description for the peer group.

peer group-name description text

By default, no description is configured for the peer group.

6. Create the BGP IPv6 multicast address family and enter its view.

address-family ipv6 multicast

By default, no BGP IPv6 multicast address family exists.

7. Enable the router to exchange IPv6 unicast routing information used for RPF check with peers in the specified peer group.

peer group-name enable

By default, the router cannot exchange IPv6 unicast routing information used for RPF check with the peers in the group.