Contents
How do I setup LXC guest so that it gets a DHCP address?
With this the container will get public ip addresses from the dhcp server just like the host. I used the default Ubuntu LXC settings, and configured my router to send all traffic on 10.0.3.xxx to the Ubuntu machine. On a DD-WRT enabled router, the settings look something like the screenshot below.
How to setup a network bridge for your LXC containers?
Create /etc/lxc/dhcp.conf, and define you CTs as following: To tell lxc-net to load the configuration, add this line in /etc/default/lxc-net: A quick tip: you can define a default domain for you containers using lxc-net. With our bridge, containers can access to the internet, but cannot be accessed.
Do you need to install Dnsmasq for LXC containers?
Also, if you’re using LXD to manage your LXC containers, this isn’t necessary as it does everything automatically. That’s pretty easy, as lxc-net is a part of LXC, it’s already installed. lxc-net uses dnsmasq to manage DHCP and DNS. Do not install the dnsmasq package.
How does a LXD container communicate with a host?
The Entire network layout looks something like this. The container uses the veth device inside the bridge (which LXD creates). The host adds the raw vlan device to the bridge as well and they both use the actual bond device, which in turn uses the physical NICs.
How to set up static route with LXC?
Replace 192.168.1.137 with the IP of the machine running LXC. Other routers should have similar options to set up a static route (here are static route instructions for Linksys, for example).
What’s the IP of my Ubuntu LXC router?
I used the default Ubuntu LXC settings, and configured my router to send all traffic on 10.0.3.xxx to the Ubuntu machine. On a DD-WRT enabled router, the settings look something like the screenshot below. Replace 192.168.1.137 with the IP of the machine running LXC.
What do I need to setup a LXC bridge?
Basically you need to setup a bridge and bind your network card and container to it. Here is the article I followed: Sounds as if like me, you require the ‘bridge’ solution rather than the NAT solution. I also turned off the default LXC bridge setup (which is NAT’ed).