]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Configure a static MAC address on the LXC bridge
authorCam Cope <cam@dropbox.com>
Tue, 22 Nov 2016 23:16:32 +0000 (15:16 -0800)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 23 Nov 2016 04:10:23 +0000 (23:10 -0500)
Signed-off-by: Cam Cope <cam@dropbox.com>
config/init/common/lxc-net.in
lxc.spec.in

index d457e78ff0fb5a97300d3096225039b5ab709e79..4797f20c3cb419c00ff18237ae2e85405cc0dbf4 100644 (file)
@@ -9,6 +9,7 @@ varlib="@LOCALSTATEDIR@/lib"
 
 USE_LXC_BRIDGE="true"
 LXC_BRIDGE="lxcbr0"
+LXC_BRIDGE_MAC="00:16:3e:00:00:00"
 LXC_ADDR="10.0.3.1"
 LXC_NETMASK="255.255.255.0"
 LXC_NETWORK="10.0.3.0/24"
@@ -45,6 +46,7 @@ ifup() {
     MASK=`_netmask2cidr ${LXC_NETMASK}`
     CIDR_ADDR="${LXC_ADDR}/${MASK}"
     ip addr add ${CIDR_ADDR} dev $1
+    ip link set dev $1 address $LXC_BRIDGE_MAC
     ip link set dev $1 up
 }
 
index dadd73950b72204c0629c368985d9e5761ee8a08..0e64907e01cdcbf81dddf067596841f45bab4746 100644 (file)
@@ -195,6 +195,7 @@ USE_LXC_BRIDGE="true"
 # If you have the dnsmasq daemon installed, you'll also have to update
 # /etc/dnsmasq.d/lxc and restart the system wide dnsmasq daemon.
 LXC_BRIDGE="lxcbr0"
+LXC_BRIDGE_MAC="00:16:3e:00:00:00"
 LXC_ADDR="$SUBNET.1"
 LXC_NETMASK="255.255.255.0"
 LXC_NETWORK="$SUBNET.0/24"