← 返回命令列表

Linux command

bgpctl 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show BGP summary

bgpctl show summary

Show all BGP neighbors

bgpctl show neighbor

Show RIB

bgpctl show rib

Show routes from a specific neighbor

bgpctl show rib neighbor [192.168.1.1]

Show routes for a specific prefix

bgpctl show rib [10.0.0.0/8]

Soft reset a neighbor

bgpctl neighbor [192.168.1.1] refresh

Clear a neighbor

bgpctl neighbor [192.168.1.1] clear

Show BGP network statements

bgpctl show network

说明

bgpctl is the control program for OpenBGPD, an implementation of the Border Gateway Protocol version 4. It communicates with the running bgpd daemon to display routing information and control BGP sessions. The command provides visibility into the BGP Routing Information Base (RIB), neighbor session states, and allows administrative actions like resetting sessions or injecting routes. It connects to bgpd via a Unix socket. bgpctl is part of the OpenBGPD project, which originated in OpenBSD and has been ported to other operating systems.

参数

show summary
Display neighbor status overview.
show neighbor _peer_
Show detailed neighbor information.
show rib _options_
Display routing information base.
show network
Show configured network statements.
show fib _options_
Show forwarding information base.
neighbor _peer_ up
Bring up a neighbor session.
neighbor _peer_ down
Bring down a neighbor session.
neighbor _peer_ clear
Clear and reset a session.
neighbor _peer_ refresh
Request route refresh.
network add _prefix_
Add a network to advertise.
network delete _prefix_
Remove a network advertisement.
-n
Show IP addresses instead of names.
-s _socket_
Connect to alternate control socket.

FAQ

What is the bgpctl command used for?

bgpctl is the control program for OpenBGPD, an implementation of the Border Gateway Protocol version 4. It communicates with the running bgpd daemon to display routing information and control BGP sessions. The command provides visibility into the BGP Routing Information Base (RIB), neighbor session states, and allows administrative actions like resetting sessions or injecting routes. It connects to bgpd via a Unix socket. bgpctl is part of the OpenBGPD project, which originated in OpenBSD and has been ported to other operating systems.

How do I run a basic bgpctl example?

Run `bgpctl show summary` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does show summary do in bgpctl?

Display neighbor status overview.