f-41: subnet: MAC de gateway anycast dérivée de la VNI #41
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
e3b95cdfa4
commit
0f31b2faf4
5 changed files with 102 additions and 0 deletions
|
|
@ -1,6 +1,8 @@
|
|||
package netif
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/vishvananda/netlink"
|
||||
)
|
||||
|
||||
|
|
@ -19,3 +21,11 @@ func LinkSetDown(name string) error {
|
|||
}
|
||||
return netlink.LinkSetDown(link)
|
||||
}
|
||||
|
||||
func LinkSetHardwareAddr(name string, mac net.HardwareAddr) error {
|
||||
link, err := netlink.LinkByName(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return netlink.LinkSetHardwareAddr(link, mac)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue