f-95: netif: MAC de chaque NIC figée sur son tap (static sticky) #95

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-31 21:26:08 +01:00
commit 7e0b03ae6d
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
4 changed files with 111 additions and 6 deletions

View file

@ -53,7 +53,11 @@ func StartVM(db *badger.DB, name string, cfg *configuration.Config) error {
}
for _, n := range d.nics {
if err := netif.CreateTap(n.tapID, n.bridge, n.vpcName, cfg.Network.VM()); err != nil {
mac, err := net.ParseMAC(n.mac)
if err != nil {
return fmt.Errorf("mac of interface %d: %w", n.index, err)
}
if err := netif.CreateTap(n.tapID, n.bridge, n.vpcName, cfg.Network.VM(), mac); err != nil {
return fmt.Errorf("create tap of interface %d: %w", n.index, err)
}
}