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

Devon B. devon.b at virtualcomplete.com
Sun Mar 22 16:42:05 UTC 2015


To start with, you have inconsistencies between your config and
interfaces.  10.0.0.15/8 would be  netmask 255.0.0.0, broadcast
10.255.255.255.  I'm not sure if that makes a difference but you should
probably be consistent and learn what the prefix size means.  You're
using prefix=24 in interfaces and prefix=8 in config.

Now, the gateway (or router) is set to 10.0.0.1.  Is this an actual
router that will forward the routes from 10.0.0.15 to a public
interface?   How is the interface configured on the host?  When you're
using a bridge, the container will connect directly to the router just
like the host, so the netmask, broadcast, and gateway should be the same
as the host in most circumstances.



> Geordie <mailto:geordi at kos.net>
> Sunday, March 22, 2015 11:53 AM
> /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
>
>
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150322/fa6f6ff0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compose-unknown-contact.jpg
Type: image/jpeg
Size: 770 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150322/fa6f6ff0/attachment.jpg>


More information about the lxc-users mailing list