feature-21, ajoute de la gestion des subnets #24
2 changed files with 3 additions and 2 deletions
f-21: debug: make mtu parametrable in full netif
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
commit
71aaaacf7b
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue