routeros: IPv6 BGP peering for c1, reject-all output filter #152

Merged
ginjiruu merged 1 commit from bgp-v6-145 into master 2026-11-18 18:56:33 +00:00
Owner

Implements lab/iac#145 (IPv6 over BGP for c1) and folds in the explicit
output filter from lab/iac#125. TCP MD5 and the input route filters stay
in #125.

What changes

  • modules/site: c1 think peers gain addr6 (their ULA on VLAN 20).
  • modules/router/bgp.tf: each dual-stack peer gets a second, v6-only
    routeros_routing_bgp_connection (address_families = "ipv6")
    sourced from the router's own ULA in the peer's net. v6 NLRI over the
    v4 session would carry a v4-mapped next hop RouterOS cannot forward
    on, hence a parallel session. Every connection (v4 and v6) now sets
    output.filter_chain to a reject-all chain: RouterOS re-advertises
    to every connection whatever it learns from one of them (proven live:
    each think received 23 prefixes it does not need), and the chain makes
    "routers advertise nothing" structural instead of incidental.
  • modules/router/firewall6.tf: per-peer in-bgp6-* input accepts
    (Cilium dials out, so the routers must accept :179 from the peers'
    ULAs), src as /128 because RouterOS normalises v6 filter addresses
    and a plain-address config never converges.
  • routeros/sim: the lab CHR pair now runs a real dual-stack eBGP pair
    (r1 AS 64512 <-> r2 AS 65003 over VLAN 20, v4+v6) so the sim root
    exercises all of the above.

Proof (lab CHR pair, RouterOS 7.25.1)

  • routeros_routing_filter_rule with rule = "reject" is accepted and
    lands as /routing/filter/rule chain=bgp-out.
  • All four sessions established both directions, v4 and v6 over the
    ULA pair (/routing/bgp/session: established=true,
    prefix-count=0).
  • Out-filter semantics control test: with output.filter-chain=bgp-out
    plus default-originate=always the router advertises nothing
    (/routing/bgp/advertisements empty); removing only the filter chain
    makes 0.0.0.0/0 appear instantly.
  • tofu validate clean for rb5009-a/b, crs309, sim;
    tofu plan -detailed-exitcode = 0 on the lab after apply.

Follow-up: flux-clusters PR adds the matching v6 peers + v6-only
peerconfig to c1's Cilium; #125 shrinks to MD5 + input filters.

Implements lab/iac#145 (IPv6 over BGP for c1) and folds in the explicit output filter from lab/iac#125. TCP MD5 and the input route filters stay in #125. ## What changes - `modules/site`: c1 think peers gain `addr6` (their ULA on VLAN 20). - `modules/router/bgp.tf`: each dual-stack peer gets a second, v6-only `routeros_routing_bgp_connection` (`address_families = "ipv6"`) sourced from the router's own ULA in the peer's net. v6 NLRI over the v4 session would carry a v4-mapped next hop RouterOS cannot forward on, hence a parallel session. Every connection (v4 and v6) now sets `output.filter_chain` to a reject-all chain: RouterOS re-advertises to every connection whatever it learns from one of them (proven live: each think received 23 prefixes it does not need), and the chain makes "routers advertise nothing" structural instead of incidental. - `modules/router/firewall6.tf`: per-peer `in-bgp6-*` input accepts (Cilium dials out, so the routers must accept :179 from the peers' ULAs), src as `/128` because RouterOS normalises v6 filter addresses and a plain-address config never converges. - `routeros/sim`: the lab CHR pair now runs a real dual-stack eBGP pair (r1 AS 64512 <-> r2 AS 65003 over VLAN 20, v4+v6) so the sim root exercises all of the above. ## Proof (lab CHR pair, RouterOS 7.25.1) - `routeros_routing_filter_rule` with `rule = "reject"` is accepted and lands as `/routing/filter/rule chain=bgp-out`. - All four sessions established both directions, v4 and v6 over the ULA pair (`/routing/bgp/session`: `established=true`, `prefix-count=0`). - Out-filter semantics control test: with `output.filter-chain=bgp-out` plus `default-originate=always` the router advertises **nothing** (`/routing/bgp/advertisements` empty); removing only the filter chain makes `0.0.0.0/0` appear instantly. - `tofu validate` clean for rb5009-a/b, crs309, sim; `tofu plan -detailed-exitcode` = 0 on the lab after apply. Follow-up: flux-clusters PR adds the matching v6 peers + v6-only peerconfig to c1's Cilium; #125 shrinks to MD5 + input filters.
Dual-stack peers (modules/site bgp peers with addr6) get a second,
v6-only connection sourced from the router's own ULA in the peer's net.
v6 NLRI over the v4 session would carry a v4-mapped next hop RouterOS
cannot forward on, so it is a parallel session, not an address-family
bolted onto the v4 one (lab/iac#145).

Every connection now references an explicit reject-all output chain
(lab/iac#125's output-filter item): RouterOS re-advertises to every
connection whatever it learns from one of them - proven live 2026-11-18,
each c1 think received 23 prefixes (mini's LB /32s + the other thinks'
PodCIDRs) that Cilium counts but never installs. The chain keeps that
impossible. TCP MD5 and input filters stay in #125.

firewall6 gains the per-peer BGP6 input accepts (src as /128: RouterOS
normalises v6 filter addresses, so a plain-address config never
converges).

Proven on the lab CHR pair (RouterOS 7.25.1, routeros/sim): rule
"reject" accepted; v4+v6 sessions established both directions; with
default-originate=always on a filtered connection the router advertises
nothing, and removing only the filter chain makes 0.0.0.0/0 appear;
tofu plan -detailed-exitcode = 0.
ginjiruu merged commit 1479163a35 into master 2026-11-18 18:56:33 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/iac!152
No description provided.