Enabling logging for session state changes

Perform this task to enable BGP to log BGP session establishment and disconnection events. To display 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. 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.

To enable logging for session state changes (IPv4 unicast/IPv4 multicast):

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. Enable logging for session state changes globally.

log-peer-change

By default, logging for session state changes is enabled globally.

4. (Optional.) Enter BGP-VPN instance view.

ip vpn-instance vpn-instance-name

N/A

5. Enable logging for session state changes for a peer or peer group.

peer { group-name | ipv4-address [ mask-length ] } log-change

By default, logging for session state changes is enabled for all peers or peer groups.

To enable logging for session state changes (IPv6 unicast/IPv6 multicast):

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. Enable logging for session state changes globally.

log-peer-change

By default, logging for session state changes is enabled globally.

4. (Optional.) Enter BGP-VPN instance view.

ip vpn-instance vpn-instance-name

N/A

5. Enable logging for session state changes for a peer or peer group.

peer { group-name | ipv6-address [ prefix-length ] } log-change

By default, logging for session state changes is enabled for all peers or peer groups.