f-56: agent: MTU unique network.mtu_vm, underlay à 9000 contrôlé à la création, option DHCP 26 et host_mtu #56

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-23 12:10:01 +02:00
commit 8cb5117cb2
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
37 changed files with 518 additions and 24 deletions

View file

@ -38,3 +38,11 @@ func LinkIPv4(name string) ([]net.IP, error) {
}
return ips, nil
}
func LinkMTU(name string) (int, error) {
link, err := netlink.LinkByName(name)
if err != nil {
return 0, err
}
return link.Attrs().MTU, nil
}

View file

@ -9,12 +9,12 @@ import (
"github.com/vishvananda/netlink"
)
func CreateTap(tapID int, bridgeName, vpcName string) error {
func CreateTap(tapID int, bridgeName, vpcName string, mtu int) error {
name := fmt.Sprintf("tap%d", tapID)
return netns.Call(vpcName, func() error {
tap := &netlink.Tuntap{
LinkAttrs: netlink.LinkAttrs{Name: name},
LinkAttrs: netlink.LinkAttrs{Name: name, MTU: mtu},
Mode: netlink.TUNTAP_MODE_TAP,
}
if err := netlink.LinkAdd(tap); err != nil {

View file

@ -4,7 +4,7 @@ package netif
import "errors"
func CreateTap(_ int, _, _ string) error {
func CreateTap(_ int, _, _ string, _ int) error {
return errors.New("netif: tap not supported on this platform")
}