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

35
internal/subnet/fabric.go Normal file
View file

@ -0,0 +1,35 @@
package subnet
import (
"git.g3e.fr/syonad/two/internal/nft"
)
func VxlanFabricPort(vethI, gatewayIP string) nft.Port {
return nft.Port{
Name: vethI,
Forward: []string{nft.DropARPRequestTo(gatewayIP), nft.DropDHCPFrom(gatewayIP)},
}
}
func AnycastFabricPort(vethI, mac, gatewayIP, relayIP string) nft.Port {
return nft.Port{
Name: vethI,
Prerouting: []string{nft.DropSourceMAC(mac)},
Forward: []string{
nft.DropSourceMAC(mac),
nft.DropARPRequestTo(gatewayIP),
nft.DropARPRequestTo(relayIP),
nft.DropDHCPFrom(gatewayIP),
nft.DropDHCPFrom(relayIP),
},
Output: []string{nft.DropSourceMAC(mac)},
}
}
func BridgeFabricPort(vethI, gatewayIP string) nft.Port {
return nft.Port{
Name: vethI,
Forward: []string{nft.DropARPRequestTo(gatewayIP), nft.DropDHCPFrom(gatewayIP)},
Output: []string{nft.DropARPFrom(gatewayIP), nft.DropDHCPFrom(gatewayIP)},
}
}