Contents
How to configure external IP addresses for LXC?
EACH OF THE CONTAINERS HAS IT OWN IP, (local) AVAILABLE ON THE LAN. U CAN SSH EACH INDIVIDUAL LOCAL IP, TO TEST USING PUTTY! After that im pretty sure u should figure out how to run them via internet after, example, vhost to container ip / load balancers / proxy / etc..
How to set external network for Linux Containers ( LXC )?
The objective of the post is to setup LXC container which can connect to external networks. There are multiple network modes that can be used in setting up LXC. By default, the lxc-oracle template script sets up networking by setting up a veth bridge.
Where does the bridge need to be created in LXC?
Otherwise, the bridge has to be created on the system before starting the container. lxc won’t handle any configuration outside of the container. In router mode static routes are created on the host for the container’s IP addresses pointing to the host side veth interface.
Why do we need a network in LXC?
The network plays an important role in containers. We can configure the network as per our infrastructure. At Bobcares, we often get requests to configure a network in LXC as part of our Server Management Services. Today, let’s get into the details and see how our Support Engineers configure the network.
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 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).