f-76: nft: règles de pont en nftables, ebtables retiré #76

internal/nft pose les règles d'un port en une transaction, dans une table
bridge two par netns de VPC. Subnets, gateway anycast et watchdog l'utilisent,
même filtrage qu'avec ebtables. bootstrap_kvm.sh et le lab installent
nftables ; helpers e2e, doc et notes 0.3.0 suivent.

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-25 22:39:36 +01:00
commit d98e42e0a8
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
27 changed files with 823 additions and 341 deletions

View file

@ -3,8 +3,9 @@ package watchdog
import (
"fmt"
"git.g3e.fr/syonad/two/internal/ebtables"
"git.g3e.fr/syonad/two/internal/netns"
"git.g3e.fr/syonad/two/internal/nft"
"git.g3e.fr/syonad/two/internal/subnet"
"git.g3e.fr/syonad/two/internal/watchdog/notify"
"git.g3e.fr/syonad/two/pkg/db/kv"
@ -21,13 +22,13 @@ func checkBridgeGateway(db *badger.DB, name, vpc, nsVeth string, n notify.Notifi
return
}
if err := netns.Call(vpc, func() error {
missing, err := ebtables.MissingGatewayRules(nsVeth, gatewayIP)
missing, err := nft.MissingRules(subnet.BridgeFabricPort(nsVeth, gatewayIP))
if err != nil {
n.Notify(kindSubnet, name, fmt.Sprintf("gateway ebtables rules unreadable in netns %s: %v", vpc, err))
n.Notify(kindSubnet, name, fmt.Sprintf("gateway nftables rules unreadable in netns %s: %v", vpc, err))
return nil
}
for _, rule := range missing {
n.Notify(kindSubnet, name, fmt.Sprintf("ebtables rule missing in netns %s: %s", vpc, rule))
n.Notify(kindSubnet, name, fmt.Sprintf("nftables rule missing in netns %s: %s", vpc, rule))
}
return nil
}); err != nil {