diff --git a/cmd/start.go b/cmd/start.go index 15d7f68..f8c5fc5 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -1009,11 +1009,15 @@ func setupVnetInterfaceJailSide(jail *Jail, hostepairs []string) error { } // Fix mac flapping and instabilities with bridged vnet network if gBridgeStaticMac { - log.Debugf("Set %s as static to %s in %s address cache\n") - cmd = fmt.Sprintf("/sbin/ifconfig %s static %s %s", bridge, nic, jsmac) + printablemac := hex.EncodeToString(jsmac) + for i := 2 ; i < len(printablemac) ; i += 3 { + printablemac = printablemac[:i] + ":" + printablemac[i:] + } + log.Debugf("Set %s.%d as static to %s in %s address cache\n", nic, jail.JID, printablemac, bridge) + cmd = fmt.Sprintf("/sbin/ifconfig %s static %s.%d %s", bridge, nic, jail.JID, printablemac) out, err := executeCommand(cmd) if err != nil { - return fmt.Errorf("Error adding member %s to %s: %v: %s\n", nic, bridge, err, out) + return fmt.Errorf("Error setting %s.%d static with %s on %s: %v: %s\n", nic, jail.JID, printablemac, bridge, err, out) } } }