Skip to content

Commit 15fb427

Browse files
committed
feat: pin BGP source address via numbered underlay links
Replace BGP unnumbered (link-local) underlay peering with numbered IPv6 /64 subnets between workers and transit routers. Add BGP_LOCAL_ADDRESS env var to the galactic-router overlay DaemonSet so GoBGP pins the TCP source address to the node SRv6 loopback. Underlay: configure numbered IPv6 links and route-maps to set source address on FRR BGP advertisements (SRv6 SID/forwarding prefixes). GoBGP runtime: accept localAddress in NewRuntimeFactory, propagate to peerFromDesired, set Transport.LocalAddress on every peer. Docs: update containerlab README to reflect numbered links.
1 parent 6bc5683 commit 15fb427

16 files changed

Lines changed: 115 additions & 47 deletions

File tree

cmd/galactic-router/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ func main() {
5050
bgpListenPort = int32(p)
5151
}
5252

53+
bgpLocalAddr := os.Getenv("BGP_LOCAL_ADDRESS")
54+
5355
var factory galacticruntime.RuntimeFactory
5456
switch routerRole {
5557
case "tenant":
56-
factory = gobgp.NewRuntimeFactory(bgpListenPort)
58+
factory = gobgp.NewRuntimeFactory(bgpListenPort, bgpLocalAddr)
5759
case "fabric":
5860
factory = frr.NewRuntimeFactory()
5961
default:

deploy/containerlab/README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Three Kind clusters (dfw, iad, sjc) connected over an IPv6 SRv6 transit mesh. Each cluster
44
runs FRR as a node routing daemon (hostNetwork DaemonSet) to peer with the transit layer via
5-
BGP unnumbered. galactic-router runs alongside FRR on the workers to distribute EVPN routes
5+
eBGP over numbered IPv6 links. galactic-router runs alongside FRR on the workers to distribute EVPN routes
66
over iBGP to the route reflector on iad-rr.
77

88
## Topology
@@ -36,10 +36,10 @@ over iBGP to the route reflector on iad-rr.
3636
### BGP design
3737

3838
```
39-
AS 65000 (dfw-underlay / FRR) ──eBGP unnumbered── tr1 (AS 65100)
40-
AS 65000 (iad-underlay / FRR) ──eBGP unnumbered── tr3:eth5 (AS 65100)
41-
AS 65000 (iad-rr-underlay / FRR) ──eBGP unnumbered── tr3:eth4 (AS 65100)
42-
AS 65000 (sjc-underlay / FRR) ──eBGP unnumbered── tr2 (AS 65100)
39+
AS 65000 (dfw-underlay / FRR) ──eBGP── tr1 (AS 65100)
40+
AS 65000 (iad-underlay / FRR) ──eBGP── tr3:eth5 (AS 65100)
41+
AS 65000 (iad-rr-underlay / FRR) ──eBGP── tr3:eth4 (AS 65100)
42+
AS 65000 (sjc-underlay / FRR) ──eBGP── tr2 (AS 65100)
4343
4444
AS 65000 (dfw-overlay / galactic-router) ──iBGP── iad-rr (AS 65000 RR)
4545
AS 65000 (iad-overlay / galactic-router) ──iBGP── iad-rr (AS 65000 RR)
@@ -48,7 +48,7 @@ AS 65000 (sjc-overlay / galactic-router) ──iBGP── iad-rr (AS 65000 RR)
4848

4949
- All clusters use a single AS (65000) for both the FRR underlay and the galactic-router overlay.
5050
- The transit mesh carries IPv6 unicast (SRv6 locator prefixes and loopbacks) via iBGP within AS 65100.
51-
- FRR PE nodes originate their SRv6 forwarding prefix (`2001:db8:ffXX::/48`) and SRv6 SID block (`fc00:0:X::/48`) toward the transit layer via eBGP unnumbered.
51+
- FRR PE nodes originate their SRv6 forwarding prefix (`2001:db8:ffXX::/48`) and SRv6 SID block (`fc00:0:X::/48`) toward the transit layer via eBGP over numbered IPv6 links.
5252
- `allowas-in 1` is configured on all cluster FRR instances so each site accepts prefixes that carry AS 65000 in the path — necessary because the transit reflects routes from one AS 65000 site to another.
5353
- galactic-router instances on dfw/iad/sjc workers peer with iad-worker-rr over iBGP (AS 65000) for `l2vpn-evpn` routes. GoBGP runs with outbound-only mode (`listenPort=-1`); all BGP sessions are initiated outbound.
5454

@@ -74,14 +74,14 @@ AS 65000 (sjc-overlay / galactic-router) ──iBGP── iad-rr (AS 65000 RR)
7474
| tr2–tr4 | 2001:db8:0:24::/64 |
7575
| tr3–tr4 | 2001:db8:0:34::/64 |
7676

77-
### Worker–TR links (BGP unnumbered, link-local only)
77+
### Worker–TR links (numbered, eBGP)
7878

79-
| Link | TR interface |
80-
|------------------------|--------------|
81-
| dfw-worker – tr1 | eth1 |
82-
| sjc-worker – tr2 | eth1 |
83-
| iad-worker – tr3 | eth5 |
84-
| iad-worker-rr – tr3 | eth4 |
79+
| Link | Subnet | TR address | Worker address |
80+
|------------------------|---------------------|----------------|------------------|
81+
| dfw-worker – tr1 | 2001:db8:1:10::/64 | 2001:db8:1:10::1 | 2001:db8:1:10::2 |
82+
| sjc-worker – tr2 | 2001:db8:1:20::/64 | 2001:db8:1:20::1 | 2001:db8:1:20::2 |
83+
| iad-worker – tr3 | 2001:db8:1:30::/64 | 2001:db8:1:30::1 | 2001:db8:1:30::2 |
84+
| iad-worker-rr – tr3 | 2001:db8:1:31::/64 | 2001:db8:1:31::1 | 2001:db8:1:31::2 |
8585

8686
### Cluster SRv6 addressing
8787

@@ -237,8 +237,7 @@ docker exec sjc-control-plane kubectl get bgprouters -A
237237
- All three Kind clusters use `disableDefaultCNI: true`. Cilium is installed by the
238238
`kindest/node:galactic` bootstrap script. cert-manager and Multus are only installed
239239
on iad and sjc.
240-
- Worker–TR links use BGP unnumbered (IPv6 link-local only). No numbered addresses are
241-
configured on worker data-plane interfaces.
240+
- Worker–TR links use numbered IPv6 subnets (/64) with eBGP peering.
242241
- Cilium's iptables rules block BGP by default; the bootstrap script inserts
243242
`ip6tables -I INPUT` rules for TCP/179 before Cilium starts on each worker.
244243
- iad-worker-rr peers with tr3 as AS 65000, the same AS used by all three clusters.

deploy/containerlab/node_files/tr1/frr.conf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ interface lo
77
ipv6 address fc00:0:1::1/128
88
!
99
interface eth1
10-
description iad-worker-facing
10+
description dfw-worker-facing
11+
ipv6 address 2001:db8:1:10::1/64
1112
!
1213
interface eth2
1314
description tr2-facing
@@ -27,13 +28,13 @@ router bgp 65100
2728
no bgp default ipv4-unicast
2829
no bgp ebgp-requires-policy
2930
bgp log-neighbor-changes
30-
neighbor eth1 interface remote-as 65000
31+
neighbor 2001:db8:1:10::2 remote-as 65000
3132
neighbor eth2 interface remote-as 65100
3233
neighbor eth3 interface remote-as 65100
3334
neighbor eth4 interface remote-as 65100
3435
!
3536
address-family ipv6 unicast
36-
neighbor eth1 activate
37+
neighbor 2001:db8:1:10::2 activate
3738
neighbor eth2 activate
3839
neighbor eth2 next-hop-self
3940
neighbor eth3 activate

deploy/containerlab/node_files/tr2/frr.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ interface lo
88
!
99
interface eth1
1010
description sjc-worker-facing
11+
ipv6 address 2001:db8:1:20::1/64
1112
!
1213
interface eth2
1314
description tr1-facing
@@ -27,13 +28,13 @@ router bgp 65100
2728
no bgp default ipv4-unicast
2829
no bgp ebgp-requires-policy
2930
bgp log-neighbor-changes
30-
neighbor eth1 interface remote-as 65000
31+
neighbor 2001:db8:1:20::2 remote-as 65000
3132
neighbor eth2 interface remote-as 65100
3233
neighbor eth3 interface remote-as 65100
3334
neighbor eth4 interface remote-as 65100
3435
!
3536
address-family ipv6 unicast
36-
neighbor eth1 activate
37+
neighbor 2001:db8:1:20::2 activate
3738
neighbor eth2 activate
3839
neighbor eth2 next-hop-self
3940
neighbor eth3 activate

deploy/containerlab/node_files/tr3/frr.conf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,32 @@ interface eth3
2020
!
2121
interface eth4
2222
description iad-rr-worker-facing
23+
ipv6 address 2001:db8:1:31::1/64
2324
!
2425
interface eth5
2526
description iad-worker-facing
27+
ipv6 address 2001:db8:1:30::1/64
2628
!
2729
router bgp 65100
2830
bgp router-id 10.255.255.102
2931
no bgp default ipv4-unicast
3032
no bgp ebgp-requires-policy
3133
bgp log-neighbor-changes
34+
neighbor 2001:db8:1:30::2 remote-as 65000
35+
neighbor 2001:db8:1:31::2 remote-as 65000
3236
neighbor eth1 interface remote-as 65100
3337
neighbor eth2 interface remote-as 65100
3438
neighbor eth3 interface remote-as 65100
35-
neighbor eth4 interface remote-as 65000
36-
neighbor eth5 interface remote-as 65000
3739
!
3840
address-family ipv6 unicast
41+
neighbor 2001:db8:1:30::2 activate
42+
neighbor 2001:db8:1:31::2 activate
3943
neighbor eth1 activate
4044
neighbor eth1 next-hop-self
4145
neighbor eth2 activate
4246
neighbor eth2 next-hop-self
4347
neighbor eth3 activate
4448
neighbor eth3 next-hop-self
45-
neighbor eth4 activate
46-
neighbor eth5 activate
4749
network fc00:0:6::1/128
4850
exit-address-family
4951
!
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: overlay
5+
spec:
6+
template:
7+
spec:
8+
containers:
9+
- name: galactic-router
10+
env:
11+
- name: BGP_LOCAL_ADDRESS
12+
value: "fc00:0:2::1"

deploy/containerlab/resources/overlay/dfw/daemonset/kustomization.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ namespace: galactic-system
33
resources:
44
- ../../base
55
- namespace.yaml
6+
patches:
7+
- path: daemonset-patch.yaml
8+
target:
9+
kind: DaemonSet
10+
name: overlay

deploy/containerlab/resources/overlay/iad/daemonset/daemonset-patch.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ spec:
1616
operator: In
1717
values:
1818
- pop
19+
containers:
20+
- name: galactic-router
21+
env:
22+
- name: BGP_LOCAL_ADDRESS
23+
value: "fc00:0:4::1"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: overlay
5+
spec:
6+
template:
7+
spec:
8+
containers:
9+
- name: galactic-router
10+
env:
11+
- name: BGP_LOCAL_ADDRESS
12+
value: "fc00:0:3::1"

deploy/containerlab/resources/overlay/sjc/daemonset/kustomization.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ namespace: galactic-system
33
resources:
44
- ../../base
55
- namespace.yaml
6+
patches:
7+
- path: daemonset-patch.yaml
8+
target:
9+
kind: DaemonSet
10+
name: overlay

0 commit comments

Comments
 (0)