feature-21, ajoute de la gestion des subnets #24

Manually merged
nicolas.boufideline merged 44 commits from feature-21 into main 2026-04-26 14:16:57 +00:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 71aaaacf7b - Show all commits

f-21: debug: make mtu parametrable in full netif

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
GnomeZworc 2026-04-26 14:56:17 +02:00
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632

View file

@ -4,7 +4,7 @@ import (
"github.com/vishvananda/netlink"
)
func CreateVxlan(name string, vxlanID int, localIface string) error {
func CreateVxlan(name string, vxlanID int, localIface string, mtu int) error {
link, err := netlink.LinkByName(localIface)
if err != nil {
return err
@ -12,6 +12,7 @@ func CreateVxlan(name string, vxlanID int, localIface string) error {
vxlan := &netlink.Vxlan{
LinkAttrs: netlink.LinkAttrs{
Name: name,
MTU: mtu,
},
VxlanId: vxlanID,
Port: 4789,

View file

@ -86,7 +86,7 @@ func CreateSubnet(db *badger.DB, subnetName string) error {
}
// vxlan
if err := netif.CreateVxlan(vxlanIface, vxlanID, localIface); err != nil {
if err := netif.CreateVxlan(vxlanIface, vxlanID, localIface, 1500); err != nil {
return fmt.Errorf("create vxlan: %w", err)
}