.\" $OpenBSD: bgpctl.8,v 1.34 2006/05/26 05:07:15 henning Exp $ .\" .\" Copyright (c) 2003 Henning Brauer .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd December 22, 2003 .Dt BGPCTL 8 .Os .Sh NAME .Nm bgpctl .Nd control the Border Gateway Protocol daemon .Sh SYNOPSIS .Nm bgpctl .Op Fl n .Op Fl s Ar socket .Ar command .Op Ar arguments ... .Sh DESCRIPTION The .Nm program controls the .Xr bgpd 8 daemon. Commands to switch between displays may be abbreviated to the minimum unambiguous prefix; for example, .Cm s s for .Cm show summary . .Pp The options are as follows: .Bl -tag -width Ds .It Fl n Show neighbors' IP addresses instead of their description. .It Fl s Ar socket Use .Ar socket instead of the default .Pa /var/run/bgpd.sock to communicate with .Xr bgpd 8 . .El .Pp The commands are as follows: .Bl -tag -width xxxxxx .It Cm fib couple Insert the learned routes into the Forward Information Base a.k.a. the kernel routing table. .It Cm fib decouple Remove the learned routes from the Forward Information Base a.k.a. the kernel routing table. .It Cm neighbor Ar peer Cm up Take the BGP session to the specified neighbor up. .Ar peer may be the neighbor's address or description. .It Cm neighbor Ar peer Cm down Take the BGP session to the specified neighbor down. .Ar peer may be the neighbor's address or description. .It Cm neighbor Ar peer Cm clear Stop and restart the BGP session to the specified neighbor. .Ar peer may be the neighbor's address or description. .It Cm neighbor Ar peer Cm refresh Request the neighbor to re-send all routes. Note that the neighbor is not obliged to re-send all routes, or any routes at all, even if it announced the route refresh capability. .Ar peer may be the neighbor's address or description. .It Cm network add Ar prefix Add the specified prefix to the list of announced networks. .It Cm network delete Ar prefix Remove the specified prefix from the list of announced networks. .It Cm network flush Remove all dynamically added prefixes from the list of announced networks. .It Cm network show Ar family Show all announced networks. .Ar family , if given, limits the output to the given address family. The supported families are .Em inet and .Em inet6 . .It Cm reload Reload the configuration file. .It Cm show fib Ar filter Show routes from .Xr bgpd 8 Ns 's view of the Forward Information Base. .Ar filter can be an IP address, in which case the route to this address is shown, or a flag: .Pp .Bl -tag -width connected -compact .It Cm connected Show only connected routes. .It Cm static Show only static routes. .It Cm bgp Show only routes originating from .Xr bgpd 8 itself. .It Cm nexthop Show only routes required to reach a BGP nexthop. .El .It Cm show interfaces Show the interface states. .It Cm show neighbor Ar peer modifier Show detailed information about the neighbor identified by .Ar peer , which may be the neighbor's address or description, according to the given .Ar modifier : .Pp .Bl -tag -width messages -compact .It Cm messages Show statistics about sent and received BGP messages. .It Cm timers Show the BGP timers. .El .It Cm show nexthop Show the list of BGP nexthops and the result of their validity check. .It Xo .Cm show rib .Op Ar detail .Ar filter .Xc Show routes from the .Xr bgpd 8 Routing Information Base. .Ar filter can be an IP address, a CIDR prefix, an AS filter or nothing: .Pp .Bl -tag -width "address/len all" -compact .It Ar address Show best matching route for address. .It Ar address Ns Li / Ns Ar len Show RIB entry for this CIDR prefix. .It Xo .Ar address Ns Li / Ns Ar len .Cm all .Xc Show all entries in the specified range. .\".It Ar address/len Cm longer-prefixes .It Cm as Ar as Show all entries with .Ar as anywhere in the AS path. .It Cm source-as Ar as Show all entries with .Ar as as rightmost AS. .It Cm transit-as Ar as Show all entries with .Ar as anywhere but rightmost. .It Cm empty-as Show all entries that are internal routes with no AS's in the AS path. .It Cm summary This is the same as the .Ic show summary command. .It Cm memory Show RIB memory statistics. .It Ar family Limit the output to the given address family. .El .Pp If .Ar detail is specified, a more detailed output of the routes matched by .Ar filter will be shown. It is silently ignored when used together with .Ar summary or .Ar memory . .It Cm show summary Show a list of all neighbors, including information about the session state and message counters. .El .Sh FILES .Bl -tag -width "/etc/bgpd.conf" -compact .It Pa /etc/bgpd.conf default .Xr bgpd 8 configuration file .El .Sh SEE ALSO .Xr bgpd.conf 5 , .Xr bgpd 8 .Sh HISTORY The .Nm program first appeared in .Ox 3.5 .