[lxc-users] Network connection on a Debian unstable host

Geordie geordi at kos.net
Sun Mar 22 15:53:26 UTC 2015


/etc/lxc/default.conf
lxc.utsname =lsmb1
lxc.network.type=veth
lxc.network.flags=up
lxc.network.link=br0
lxc.network.hwaddr=ac:de:48:00:00:15
lxc.network.ipv4=10.0.0.15
lxc.id_map = u 0 100000 65536
lxc.id_map = g 0 100000 65536

/etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

auto br0
iface br0 inet static
  bridge_ports eth0
  bridge_fd 0
  address   10.0.0.15
  netmask   255.255.255.0
  network   10.0.0.0
  broadcast 10.0.0.255
  gateway   10.0.0.1
  bridge_maxwait 0

/var/lib/lxc/lsmb1/config
# Distribution configuration
lxc.include = /usr/share/lxc/config/debian.common.conf
lxc.include = /usr/share/lxc/config/debian.userns.conf
lxc.arch = x86_64

# Container specific configuration
lxc.utsname = lsmb1
lxc.id_map = u 0 100000 65536
lxc.id_map = g 0 100000 65536
lxc.rootfs = /var/lib/lxc/lsmb1/rootfs
lxc.utsname = lsmb1

# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.hwaddr = ac:de:48:00:00:15
lxc.network.ipv4 = 10.0.0.15/8

/var/lib/lxc/lsmb1/rootfs/etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

lxc-info -n lsmb1
Name:           lsmb1
State:          RUNNING
PID:            3366
IP:             10.0.0.15
CPU use:        1.27 seconds
BlkIO use:      92.30 MiB
Link:           vethQINE7U
 TX bytes:      2.25 KiB
 RX bytes:      19.37 KiB
 Total bytes:   21.62 KiB

I can ping the container, and ssh from the container to another
computer on the lan. I cannot access the WAN  from the container when I
ssh  to the host  from the container I get the hosts root at laptop:~# I
find that strange

lxc: Installed: 1:1.0.7-1 Kernel: 3.16.0-4-amd64 x86_64 (64 bit) Debian
Unstable

So what is needed to connect to the internet and I will admit that my
iptables-foo knowledge is severely lacking 

Thanks
Geordie





More information about the lxc-users mailing list