Setting up Linux containers

How would you configure Linux containers on a Linode account? I would like to set up bridge interface and vlan for my containers. How should /etc/network/interfaces file look like? I have one public and one private address, and want to create multiple containers.

I was able to create a container and start it up (without vlan) however, it did not have access to the network, was closing my SSH session or crashed my host after 30-60 seconds. I think I have problem with basic network configuration. Could anyone guide me, please.

4 Replies

I forgot to mention some details - os: Ubuntu 10.04 LTS x64, kernel: 2.6.32-30, and I'm talking about 802.1q VLAN.

Without knowing what sort of 'container' is being used, it's difficult to know for sure. However, were you able to get network traffic from the container to the 'host' (your Linode, outside the container)? If that works, you'll need to set up NAT before you can get to the Internet (or even the internal inter-Linode network).

I use LXC linux containers. I followed steps described here: http://blog.bodhizazen.net/linux/lxc-co … ontainers/">http://blog.bodhizazen.net/linux/lxc-configure-ubuntu-lucid-containers/. I also use this project to create containers: https://github.com/phbaer/lxc-tools/.

I could connect from host to container using lxc-console. I wasn't able to make any outgoing connection.

Yup, sounds like it needs NAT. The iptables steps from the OpenVPN guide should do the trick. Obviously, skip the openvpn and dnsmasq stuff in that section.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct