8
cat >> /etc/default/lxc-net << EOF
9
# Leave USE_LXC_BRIDGE as "true" if you want to use lxcbr0 for your
10
# containers. Set to "false" if you'll use virbr0 or another existing
11
# bridge, or mavlan to your host's NIC.
14
# If you change the LXC_BRIDGE to something other than lxcbr0, then
15
# you will also need to update your /etc/lxc/default.conf as well as the
16
# configuration (/var/lib/lxc/<container>/config) for any containers
17
# already created using the default config to reflect the new bridge
19
# If you have the dnsmasq daemon installed, you'll also have to update
20
# /etc/dnsmasq.d/lxc and restart the system wide dnsmasq daemon.
23
LXC_NETMASK="255.255.255.0"
24
LXC_NETWORK="10.0.$i.0/24"
25
LXC_DHCP_RANGE="10.0.$i.2,10.0.$i.254"
33
cat > /etc/default/lxc-net << EOF
34
# This file is auto-generated by lxc.postinst if it does not
35
# exist. Customizations will not be overridden.
37
# if lxcbr0 exists, keep using the same network
38
if ip addr show lxcbr0 > /dev/null 2>&1 ; then
39
i=`ip addr show lxcbr0 | grep "inet\>" | awk '{ print $2 }' | awk -F. '{ print $3 }'`
43
# if no lxcbr0, find an open 10.0.a.0 network
44
for l in `ip addr show | grep "inet\>" |awk '{ print $2 }' | grep '^10\.0\.' | sort -n`; do
45
j=`echo $l | awk -F. '{ print $3 }'`
46
if [ $j -gt $i ]; then
52
if [ $i -ne 254 ]; then
59
if [ ! -f /etc/default/lxc-net ]; then
66
echo "preinst called with unknown argument (${1})"