f-15: ia: first subnet try

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-04-11 23:27:07 +02:00
commit cad1a9f46b
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
7 changed files with 445 additions and 0 deletions

20
internal/netif/vxlan.go Normal file
View file

@ -0,0 +1,20 @@
package netif
import (
"net"
"github.com/vishvananda/netlink"
)
func CreateVxlan(name string, vxlanID int, localIP net.IP) error {
vxlan := &netlink.Vxlan{
LinkAttrs: netlink.LinkAttrs{
Name: name,
},
VxlanId: vxlanID,
Port: 4789,
SrcAddr: localIP,
Learning: false,
}
return netlink.LinkAdd(vxlan)
}