The OPEN used to offer IPv4 and IPv6 unicast unconditionally, and what the peer offered was ignored apart from its four-octet AS number. Address families (RFC 4760): - A peer's `address_families` in the configuration says which to offer it; all of them by default. - A session carries the families both OPENs offered. A peer that sends no Multiprotocol capability is a plain RFC 4271 speaker: IPv4 unicast. - Routes of a family that was not negotiated are not sent, and are ignored when received; the rest of the UPDATE is applied and the session stays up. - A session with no family in common is refused with Unsupported Capability, naming the capabilities we needed (RFC 5492). - The negotiated families are shown on /statusz and in /api/peers. Bugs found on the way: - A capability naming an address family we have no constant for (EVPN, VPNv4, ...) failed the whole OPEN, so such a peer could never establish. It is now kept as an unknown capability and ignored. - An UPDATE could not be encoded for a peer without four-octet AS support, which ended the session on the first route. AS_PATH is now written two octets wide with AS_TRANS where needed, and AS4_PATH carries the real numbers (RFC 6793). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
39 lines
1.2 KiB
Protocol Buffer Text Format
39 lines
1.2 KiB
Protocol Buffer Text Format
# A worked example; the fields are documented in
|
|
# crates/server/proto/config.proto.
|
|
router_id: "10.0.0.1"
|
|
local_asn: 65000
|
|
|
|
# Where to accept BGP connections. Port 179 needs privileges; pick another
|
|
# port to run unprivileged against a peer that dials a custom port.
|
|
listen_endpoints { address: "127.0.0.1" port: 179 }
|
|
listen_endpoints { address: "::1" port: 179 }
|
|
|
|
# A peer we connect to (and accept connections from).
|
|
peers {
|
|
name: "r1"
|
|
endpoint { address: "127.0.0.1" port: 1791 }
|
|
remote_asn: 65001
|
|
hold_time_seconds: 30
|
|
# Offer only these families to the peer. Left out, all are offered.
|
|
address_families: IPV4_UNICAST
|
|
address_families: IPV6_UNICAST
|
|
}
|
|
connect_retry_seconds: 5
|
|
|
|
# Let a restarted peer replace a stale Established session immediately
|
|
# (RFC 4271 CollisionDetectEstablishedState). Default false.
|
|
collision_detect_established_state: false
|
|
|
|
# Routes this router originates, announced to every peer.
|
|
originate { prefix: "10.100.0.0/16" }
|
|
originate {
|
|
prefix: "2001:db8:100::/48"
|
|
med: 50
|
|
communities: "65000:100"
|
|
large_communities: "65000:1:2"
|
|
}
|
|
|
|
# Read-only status page, JSON API and metrics. It has no authentication:
|
|
# keep it on loopback or behind a reverse proxy.
|
|
http_endpoint { address: "127.0.0.1" port: 8080 }
|