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:
parent
1b37bd6b4b
commit
7e0b03ae6d
4 changed files with 111 additions and 6 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue