Skip to content

Commit

Permalink
Merge pull request #1314 from ccope/static-mac
Browse files Browse the repository at this point in the history
Configure a static MAC address on the LXC bridge
  • Loading branch information
Christian Brauner committed Nov 23, 2016
2 parents dea1cfb + 8443262 commit 8f227cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/init/common/lxc-net.in
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions lxc.spec.in
Expand Up @@ -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"
Expand Down

0 comments on commit 8f227cd

Please sign in to comment.