BGP on Linux
Wren can carry an IPv4 prefix across a peering link with only IPv6 addresses. Use the example below to verify both the negotiated next hop and the installed Linux route.
Peer over an IPv6-only link
The lab connects AS 65001 to AS 65002 over 2001:db8::/64. Router B originates 10.99.0.0/24. A and B negotiate extended next-hop encoding; the 32-bit router IDs do not need to be assigned to the peering interfaces.
flowchart LR
A["Router A · AS 65001<br/>2001:db8::1"] <-->|"eBGP, extended next hop"| B["Router B · AS 65002<br/>2001:db8::2"]
B -.->|"10.99.0.0/24 via 2001:db8::2"| A
Router A · receiving peer
router-id = "10.0.0.1"
[bgp]
enabled = true
local-as = 65001
ebgp-require-policy = false
[[bgp.neighbor]]
address = "2001:db8::2"
remote-as = 65002
extended-nexthop = true
Router B · originating peer
router-id = "10.0.0.2"
[bgp]
enabled = true
local-as = 65002
network = ["10.99.0.0/24"]
next-hop6 = "2001:db8::2"
ebgp-require-policy = false
[[bgp.neighbor]]
address = "2001:db8::1"
remote-as = 65001
passive = true
extended-nexthop = true
The example sets ebgp-require-policy = false for this isolated two-router test. For deployment, attach explicit import and export filters as in the configuration guide.
Verify the route in Linux
From the checkout root on Linux with iproute2 and user/network namespaces enabled:
bash scripts/bgp-unnumbered-smoke.sh
| Inspect | What the lab checks |
|---|---|
wren show bgp neighbors | 2001:db8::2 AS 65002 Established |
wren show bgp | 10.99.0.0/24 has an IPv6 next hop |
ip -4 route show proto bgp | 10.99.0.0/24 via inet6 … dev veth0 |
For a directly connected peer the next hop may be link-local. Check the egress interface alongside that address. If the peer is up but the route is absent, check address-family negotiation and eBGP policy first. Full test fixture.
Filter what an eBGP peer can exchange
The default eBGP policy requires explicit filters for each direction. The configuration example admits one prefix per direction. Run bash scripts/bgp-default-deny-smoke.sh to compare the four cases: neither filter, import only, export only, and both. A peer can remain Established throughout while its usable route set changes.
Session states
wren show bgp neighbors prints each peer’s RFC 4271 state:
stateDiagram-v2
[*] --> Idle
Idle --> Connect: start
Connect --> OpenSent: TCP up
Connect --> Active: TCP failed
Active --> OpenSent: TCP up
Active --> Connect: ConnectRetry
OpenSent --> OpenConfirm: OPEN received
OpenConfirm --> Established: KEEPALIVE received
Established --> Idle: hold timer, NOTIFICATION or TCP failure
A manual stop or a received NOTIFICATION returns any state to Idle. An UPDATE in OpenSent or OpenConfirm, a KEEPALIVE in OpenSent, or a second OPEN is an FSM error: Wren sends NOTIFICATION code 5, drops the connection and returns to Idle.
Change and observe sessions
Add or remove a peer while other sessions stay up. For other protocol mechanisms, each linked lab below includes both ends and the assertions made on the receiver. From the checkout root, run bash scripts/<lab-name>-smoke.sh.
Select and propagate paths
| Capability | What to verify | Lab |
|---|---|---|
| Four-octet ASNs | Negotiate a four-byte ASN across a peering session. | bgp-4octet |
| Equal-cost next hops | Check that two eligible paths produce a multipath kernel route. | bgp-multipath |
| ADD-PATH | Compare one path with multiple path IDs announced to an IPv4 peer. | bgp-add-path |
| Redistribution | Originate selected routes from another protocol in BGP. | bgp-redistribute |
| Transit | Observe the AS path after an advertisement crosses a transit AS. | bgp-propagate |
| Route reflection | Relay a route between iBGP clients without a direct client-to-client session. | bgp-route-reflection |
| Confederations | Compare AS paths inside the confederation and at the external edge. | bgp-confederation |
| Default origination | Limit which neighbor receives the advertised default. | bgp-default-originate |
| Address aggregation | Compare the summary and its contributing prefixes. | bgp-aggregate |
Tag and validate routes
| Capability | What to verify | Lab |
|---|---|---|
| Standard communities | Recognize community attributes at the receiving peer. | bgp-community |
| Per-prefix tags | Apply tags selectively with a neighbor export filter. | bgp-export-filter |
| Large communities | Observe the global administrator and two local values on a received route. | bgp-large-community |
| Extended communities | Inspect extended community attributes after exchange. | bgp-ext-community |
| Origin validation | Compare Valid, Invalid and NotFound results against local ROAs. | bgp-rpki |
| RTR cache | Fetch ROAs from a validating cache and check how invalid origins are handled. | bgp-rtr |
Operate sessions
| Capability | What to verify | Lab |
|---|---|---|
| Connection collisions | Check which session remains when both neighbors initiate. | bgp-collision |
| TTL security | Set the expected hop distance consistently on both peers. | bgp-ttl-security |
| TCP-MD5 | Configure matching peer authentication on a supported Linux kernel. | bgp-password-v6 |
| TCP-AO | Negotiate a session on a kernel with TCP-AO support. | bgp-tcp-ao |
| Maximum prefixes | Bound the number of prefixes accepted from one peer. | bgp-max-prefix |
| Route refresh | Request advertisements again over an established session. | bgp-route-refresh |
| Graceful restart | Observe retained routes on a helper when its peer restarts. | bgp-graceful-restart |