The peer listen-net command specifies a network segment from which a dynamic BGP peer group listens for BGP connection requests.
The undo peer listen-net command deletes the specified network segment from which a dynamic BGP peer group listens for BGP connection requests.
By default, no network segment from which a dynamic BGP peer group listens for BGP connection requests is specified.
Parameter | Description | Value |
---|---|---|
group-name |
Specifies the name of a dynamic BGP peer group. |
The name is a string of 1 to 47 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
ipv4-address |
Specifies a network segment from which the dynamic BGP peer group listens for BGP connection requests. |
The value is in dotted decimal notation. |
mask-length |
Specifies a mask length. The 1s in each 32-bit mask must be consecutive. Therefore, a mask in dotted decimal notation can be presented by a mask length. |
The value is an integer ranging from 0 to 32. |
mask |
Specifies the mask of the preceding IP address. |
The value is in dotted decimal notation. |
Usage Scenario
If static BGP peers change frequently on a BGP network, you need to add or delete BGP peer configurations in response to each change, which requires a heavy maintenance workload. To address this problem, configure the dynamic BGP peer function to enable BGP to listen for BGP connection requests from a specified network segment, dynamically establish BGP peer relationships, and add these peers to the same dynamic peer group. This spares you from adding or deleting BGP peer configurations in response to each change in dynamic peers. To specify a network segment from which a dynamic BGP peer group listens for BGP connection requests, run the peer listen-net command.
Prerequisites
A dynamic BGP peer group has been configured using the group listen [ internal | external ] command. In the case of a dynamic EBGP peer group, a peer AS from which the peer group listens for BGP connection requests must also have been specified using the peer listen-as command.
Precautions
If the undo peer listen-net command is run, connections with the corresponding dynamic peers are not deleted. However, if the peers are disconnected, their connections are not reestablished.
If both the dynamic BGP peer function and a static BGP peer are configured on the local end, a static BGP peer relationship is preferentially established when the peer end attempts to establish a connection with the local end. If the peer listen-net command is run more than once, all configurations take effect.<HUAWEI> system-view [~HUAWEI] bgp 100 [*HUAWEI-bgp] group in listen internal [*HUAWEI-bgp] peer in listen-net 10.10.10.0 24
<HUAWEI> system-view [~HUAWEI] bgp 100 [*HUAWEI-bgp] group ex listen external [*HUAWEI-bgp] peer ex listen-as 200 [*HUAWEI-bgp] peer ex listen-net 10.10.10.0 24