Commit 6d14aa2b by Cam Cope Committed by Stéphane Graber

Configure a static MAC address on the LXC bridge

Signed-off-by: 's avatarCam Cope <cam@dropbox.com>
parent 0d7574d5
...@@ -9,6 +9,7 @@ varlib="@LOCALSTATEDIR@/lib" ...@@ -9,6 +9,7 @@ varlib="@LOCALSTATEDIR@/lib"
USE_LXC_BRIDGE="true" USE_LXC_BRIDGE="true"
LXC_BRIDGE="lxcbr0" LXC_BRIDGE="lxcbr0"
LXC_BRIDGE_MAC="00:16:3e:00:00:00"
LXC_ADDR="10.0.3.1" LXC_ADDR="10.0.3.1"
LXC_NETMASK="255.255.255.0" LXC_NETMASK="255.255.255.0"
LXC_NETWORK="10.0.3.0/24" LXC_NETWORK="10.0.3.0/24"
...@@ -45,6 +46,7 @@ ifup() { ...@@ -45,6 +46,7 @@ ifup() {
MASK=`_netmask2cidr ${LXC_NETMASK}` MASK=`_netmask2cidr ${LXC_NETMASK}`
CIDR_ADDR="${LXC_ADDR}/${MASK}" CIDR_ADDR="${LXC_ADDR}/${MASK}"
ip addr add ${CIDR_ADDR} dev $1 ip addr add ${CIDR_ADDR} dev $1
ip link set dev $1 address $LXC_BRIDGE_MAC
ip link set dev $1 up ip link set dev $1 up
} }
......
...@@ -195,6 +195,7 @@ USE_LXC_BRIDGE="true" ...@@ -195,6 +195,7 @@ USE_LXC_BRIDGE="true"
# If you have the dnsmasq daemon installed, you'll also have to update # If you have the dnsmasq daemon installed, you'll also have to update
# /etc/dnsmasq.d/lxc and restart the system wide dnsmasq daemon. # /etc/dnsmasq.d/lxc and restart the system wide dnsmasq daemon.
LXC_BRIDGE="lxcbr0" LXC_BRIDGE="lxcbr0"
LXC_BRIDGE_MAC="00:16:3e:00:00:00"
LXC_ADDR="$SUBNET.1" LXC_ADDR="$SUBNET.1"
LXC_NETMASK="255.255.255.0" LXC_NETMASK="255.255.255.0"
LXC_NETWORK="$SUBNET.0/24" LXC_NETWORK="$SUBNET.0/24"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment