f-15: ia: first subnet try
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
bf00d74a26
commit
cad1a9f46b
7 changed files with 445 additions and 0 deletions
20
internal/netif/vxlan.go
Normal file
20
internal/netif/vxlan.go
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue