Complete reference for
gobfdctl-- the CLI client for managing BFD sessions, monitoring events, and interacting with the gobfd daemon.
- Overview
- Global Flags
- Session Commands
- Echo Commands
- Micro-BFD Commands
- Monitor Command
- Version Command
- Interactive Shell
- Output Formats
gobfdctl communicates with the gobfd daemon via ConnectRPC (compatible with gRPC, Connect, and gRPC-Web protocols). It provides both non-interactive commands (via Cobra) and an interactive shell (via reeflective/console) with tab completion.
gobfdctl [global flags] <command> [subcommand] [flags]
| Flag | Default | Description |
|---|---|---|
--addr |
localhost:50051 |
gobfd daemon address (host:port) |
--format |
table |
Output format: table, json, yaml |
gobfdctl session listShows all BFD sessions with their current state, peer address, timers, and discriminators.
# By peer address
gobfdctl session show 10.0.0.1
# By local discriminator
gobfdctl session show 42# Single-hop BFD session
gobfdctl session add \
--peer 10.0.0.1 \
--local 10.0.0.2 \
--interface eth0 \
--type single-hop \
--tx-interval 100ms \
--rx-interval 100ms \
--detect-mult 3
# Multihop session
gobfdctl session add \
--peer 192.168.1.1 \
--local 192.168.2.1 \
--type multi-hop \
--tx-interval 300ms \
--detect-mult 5
# Authenticated session
gobfdctl session add \
--peer 10.0.0.1 \
--local 10.0.0.2 \
--auth-type keyed-sha1 \
--auth-key-id 7 \
--auth-secret api-auth-secret| Flag | Required | Default | Description |
|---|---|---|---|
--peer |
Yes | -- | Remote system IP address |
--local |
Yes | -- | Local system IP address |
--interface |
No | -- | Network interface (for SO_BINDTODEVICE) |
--type |
No | single-hop |
Session type: single-hop or multi-hop |
--tx-interval |
No | 1s |
Desired Min TX Interval |
--rx-interval |
No | 1s |
Required Min RX Interval |
--detect-mult |
No | 3 |
Detection Multiplier |
--auth-type |
No | none |
Auth type: none, simple-password, keyed-md5, meticulous-keyed-md5, keyed-sha1, meticulous-keyed-sha1 |
--auth-key-id |
If auth enabled | 0 |
RFC 5880 Auth Key ID, range 0-255 |
--auth-secret |
If auth enabled | -- | Auth secret: 1-16 bytes for Simple Password/MD5, 1-20 bytes for SHA1 |
# By local discriminator
gobfdctl session delete 42RFC 9747 unaffiliated BFD echo sessions live under a separate command group because their timer model differs from RFC 5880 control sessions: TxInterval is locally provisioned and not negotiated with the peer.
gobfdctl echo listgobfdctl echo add \
--peer 10.0.0.1 \
--local 10.0.0.2 \
--tx-interval 50ms \
--detect-mult 3| Flag | Required | Default | Description |
|---|---|---|---|
--peer |
Yes | -- | Echo target IP address |
--local |
No | -- | Local IP address (fallback to default route) |
--interface |
No | -- | Outbound interface for SO_BINDTODEVICE |
--tx-interval |
No | 1s |
Echo transmit interval (RFC 9747 Section 3.3) |
--detect-mult |
No | 3 |
Detection multiplier; DetectionTime = mult * TxInterval |
gobfdctl echo delete 42RFC 7130 micro-BFD groups bind one BFD session per LAG member link. The CLI manages the group resource; per-member sessions are created in the daemon when the group is added.
gobfdctl micro listgobfdctl micro add \
--lag bond0 \
--members eth0,eth1,eth2 \
--peer 10.0.0.1 \
--local 10.0.0.2 \
--tx-interval 300ms \
--rx-interval 300ms \
--detect-mult 3 \
--min-active 2| Flag | Required | Default | Description |
|---|---|---|---|
--lag |
Yes | -- | LAG interface name (bond0, team0, port-channel1) |
--members |
Yes | -- | Comma-separated member link names |
--peer |
Yes | -- | Peer IP address shared by every member session |
--local |
No | -- | Local IP address |
--tx-interval |
No | 1s |
Desired minimum TX interval |
--rx-interval |
No | 1s |
Required minimum RX interval |
--detect-mult |
No | 3 |
Detection multiplier (RFC 7130 Section 2.2) |
--min-active |
No | 1 |
Minimum active members for aggregate Up |
The CLI rejects --min-active outside [1, len(--members)] before
contacting the daemon.
gobfdctl micro delete bond0Stream live BFD events (state changes) from the daemon:
# Stream only new events
gobfdctl monitor
# Stream events with initial snapshot of all sessions
gobfdctl monitor --current| Flag | Default | Description |
|---|---|---|
--current |
false |
Include current session states before streaming |
The monitor uses gRPC server-side streaming. Each event includes:
- Timestamp
- Session identifier (peer address, local discriminator)
- Old state and new state
- Diagnostic code
- Event trigger
Press Ctrl+C to stop monitoring.
All binaries support version display with commit hash and build date:
gobfd --version
gobfdctl version
gobfd-haproxy-agent --version
gobfd-exabgp-bridge --versionExample output:
gobfdctl v0.1.0
commit: abc1234
built: 2026-02-22T12:00:00Z
Version information is injected at build time via ldflags (see 09-development.md).
gobfdctl shellLaunches an interactive shell with:
- Tab completion for commands and subcommands
- Readline autocomplete via reeflective/console (derived from Cobra command tree)
- Full access to all gobfdctl commands without the
gobfdctlprefix
Example session:
gobfd> session list
gobfd> session show 10.0.0.1
gobfd> monitor --current
gobfd> exit
All commands support three output formats via the --format flag:
| Format | Use Case |
|---|---|
table |
Human-readable terminal output (default) |
json |
Machine-parseable, scripting, piping to jq |
yaml |
Human-readable structured output |
# JSON output for scripting
gobfdctl session list --format json
# YAML output
gobfdctl session list --format yaml
# Pipe JSON to jq
gobfdctl session list --format json | jq '.sessions[].state'# Connect to remote daemon
gobfdctl --addr 10.0.0.1:50051 session list
# Quick session setup for testing
gobfdctl session add --peer 10.0.0.1 --local 10.0.0.2 --interface eth0 \
--tx-interval 100ms --detect-mult 3
# Watch for state changes in JSON
gobfdctl --format json monitor --current
# Scripted health check
if gobfdctl session show 10.0.0.1 --format json | jq -e '.state == "Up"' > /dev/null; then
echo "BFD session is Up"
fi- 03-configuration.md -- Declarative session configuration
- 07-monitoring.md -- Prometheus metrics and Grafana dashboards
- 01-architecture.md -- ConnectRPC server architecture
Last updated: 2026-02-21