From: Cam Cope Date: Tue, 22 Nov 2016 23:16:32 +0000 (-0800) Subject: Configure a static MAC address on the LXC bridge X-Git-Tag: lxc-2.1.0~254^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1314%2Fhead;p=thirdparty%2Flxc.git Configure a static MAC address on the LXC bridge Signed-off-by: Cam Cope --- diff --git a/config/init/common/lxc-net.in b/config/init/common/lxc-net.in index d457e78ff..4797f20c3 100644 --- a/config/init/common/lxc-net.in +++ b/config/init/common/lxc-net.in @@ -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 } diff --git a/lxc.spec.in b/lxc.spec.in index 94a9504c2..e31115deb 100644 --- a/lxc.spec.in +++ b/lxc.spec.in @@ -196,6 +196,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"