f-41: frr, sysctl, netif: primitives du L3VNI #41
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
0f31b2faf4
commit
94c2f82867
11 changed files with 910 additions and 0 deletions
16
internal/netif/vrf.go
Normal file
16
internal/netif/vrf.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package netif
|
||||
|
||||
import (
|
||||
"github.com/vishvananda/netlink"
|
||||
)
|
||||
|
||||
func CreateVRF(name string, table uint32) error {
|
||||
vrf := &netlink.Vrf{
|
||||
LinkAttrs: netlink.LinkAttrs{Name: name},
|
||||
Table: table,
|
||||
}
|
||||
if err := netlink.LinkAdd(vrf); err != nil {
|
||||
return err
|
||||
}
|
||||
return netlink.LinkSetUp(vrf)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue