[lxc-users] Ubuntu container IP address
Robert Koretsky
bobk48 at gmail.com
Thu Nov 19 20:42:16 UTC 2015
I have successfully installed and created/started an LXC container on
Ubuntu 15.10, but cannot get it to be visible on my home network. I do an
ifconfig on both the host and in the container, and see the IPv4 address of
lxcbr0 as 10.0.3.1, but after reading many, many convoluted and complex
references, cannot figure out how to get my router to assign the container
an IP address, like 192.168.0.20 say, that is accessible from my home
network. One of these references even had a 100-line long bash script to
totally reconfigure iptables, and I'm not even sure if that would have
accomplished even part of what I wanted!
I think one of the purposes of containerized OS's is putting web-facing
stuff in them securely. So I don't follow the reasoning behind putting the
container in it's own sub-net with the host, and then not having some
readily available docs to explain how to get the container to face the
network. Also some very simple technique to achieve the connection of a
container to a home networ, or to any lan or wan. Someone at Ubuntu forums
suggested that since many networks have different configurations,
explaining how to hook up LXC to all of them would be difficult. I don't
follow the reasoning for the default initial setup being to connect the new
container to some host-container only network with an address like 10.0.3.1.
Not to bash LXC, I think it's a great piece of software, very beautifully
implemented, but in VirtualBox, or PCBSD Jails, Solaris Zones, bridging the
VM guest NIC is almost a trivial operation. Not so in LXC, IMHO.
And I have a vanilla installation of Ubuntu 15.10 running on dedicated
hardware, and the default LXC packages from the Ubuntu repository.
I would appreciate anyone coming up with some clearly articulated procedure
for connecting the container to a home network, with an address of
192.168.0.x (so it is on the subnet that the host is on!), so I can either
have it automatically assigned an IP address by my router, or even done
manually somehow.
Thanks!
Sincerely,
Robert M. Koretsky
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20151119/97e9c9ec/attachment.html>
More information about the lxc-users
mailing list