[lxc-users] Ubuntu container IP address

Mark Constable markc at renta.net
Fri Nov 20 01:45:51 UTC 2015


On 20/11/15 09:53, Robert Koretsky wrote:
> And what generally is the tone of communication on this user mailing list?
>  Helpful and friendly, or contentious and unfriendly?

A few replies were posted to your other thread, including some boilerplate
configs from me and some pertinent links and suggestion from others, and you
seemed to ignore that and repost the same question again as a different thread.
That kind of behavior will annoy some people.

Back to exposing your containers to your local private 192.168.0.0 network.
My simple method involved disabling the default lxcbr0 setup but reuse that
bridge name and set it up via /etc/network/interfaces instead. That also
involves not using the default lxc dnsmasq setup but using the standard
dnsmasq readily available from all distros. You then control what containers
get what IP via one single /etc/dnsmasq.conf file with the added bonus that
cached DNS queries are provided for the host as well as the containers. It
also means that you can use the hosts dnsmasq as the main local LAN network
DNS resolver for both internal and cached external DNS lookups. If you also
disable DHCP on your 192.168.0.1 gateway router then the DHCP assignments
from your main hosts dnsmasq can also provide IP mappings for your entire
internal LAN including containers on any other host (handy when moving
containers between hosts) all from a single config file. No iptable rules
involved. Swap internal 192.168.0.0 network IPs for public IPs and this
strategy still works for a simple public server setup.


More information about the lxc-users mailing list