Host Linux server 4.15.0-22-generic #24-Ubuntu SMP x86_64 GNU/Linux
Container Linux hpot 4.15.0-22-generic #24-Ubuntu SMP x86_64 GNU/Linux (albeit chosen a Debian Stretch amd64 image)
LXC 3.0
I have been reading different places and perhaps suffer some misconception along the line but having trouble to get an ip for the container, both - host and container
/etc/default/lxc-net
USE_LXC_BRIDGE="true"
LXC_BRIDGE="lxcbr0"
LXC_ADDR="172.24.120.1"
LXC_NETMASK="255.255.255.0"
LXC_NETWORK="172.24.120.0/24"
LXC_DHCP_RANGE="172.24.120.2,172.24.120.254"
LXC_DHCP_MAX="253"
LXC_DHCP_CONFILE=/etc/lxc/dnsmasq.conf
/etc/lxc/dnsmasq.conf
dhcp-host=hpot,172.24.120.100
/etc/dnsmasq.d-available/lxc
bind-interfaces
except-interface=lxcbr0
/srv/lxc/hpot/config
# Distribution configuration
lxc.include = /usr/share/lxc/config/common.conf
lxc.include = /usr/share/lxc/config/userns.conf
lxc.arch = linux64
# Container specific configuration
lxc.start.auto = 1
lxc.group = onboot
lxc.start.delay = 10
lxc.start.order = 0
lxc.idmap = u 0 100000 65536
lxc.idmap = g 0 100000 65536
lxc.ephemeral = 0
lxc.rootfs.path = dir:/srv/lxc/hpot/rootfs
lxc.uts.name = hpot
# Network configuration
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:cf:07:18
With the above I would expect the container being assiged 172.24.120.100 (from dnsmasq.conf
) in the host but apparently it is not:
**host ifconfig**
lxcbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.24.120.1 netmask 255.255.255.0 broadcast 0.0.0.0
ether 00:16:3e:00:00:00 txqueuelen 1000 (Ethernet)
vethEM0DWJ: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether fe:26:d8:64:21:08 txqueuelen 1000 (Ethernet)
**container ifconfig**
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:16:3e:cf:07:18 txqueuelen 1000 (Ethernet)
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)