You are not logged in.

#1 2016-02-08 09:55:17

dretech
Member
Registered: 2016-02-08
Posts: 7

Help needed with configuring (bridge) network in LXC container

I want to use LXC. I installed LXC successfully on Archlinux following https://wiki.archlinux.org/index.php/Linux_Containers. The IP number of the host system is: 192.168.2.189. This is a wired connection.

The contents of /etc/netctl/lxcbridge on the host is:
Description="LXC bridge"
Interface=br0
Connection=bridge
BindsToInterfaces=(eth0)
IP=dhcp
## Ignore (R)STP and immediately activate the bridge
SkipForwardingDelay=yes

I also succesfully created my first LXC container (with also Arch Linux). That LXC must directly communicate with my internet router. When using DHCP in the container I got no working network connection. Therefore I used a static IP for the container. The contents of  /var/lib/lxc/CONTAINER_NAME/config is:
# Template used to create this container: /usr/share/lxc/templates/lxc-archlinux
# Parameters passed to the template:
# For additional config options, please look at lxc.container.conf(5)
#lxc.network.type = empty
lxc.rootfs = /var/lib/lxc/webserver/rootfs
lxc.utsname = webserver
lxc.arch = x86_64
lxc.include = /usr/share/lxc/config/archlinux.common.conf

## network
lxc.network.type = veth
lxc.network.name = eth0
lxc.network.flags = up
lxc.network.link = br0
lxc.network.ipv4 = 192.168.2.190/24
lxc.network.ipv4.gateway = 192.168.2.1

## systemd within the lxc
lxc.autodev = 1
lxc.pts = 1024
lxc.kmsg = 0
lxc.hook.autodev=/var/lib/lxc/webserver/autodev

When I log in in the container I am only able to ping to the host (192.168.2.189). Pinging to my router e.g. is impossible.

Can anyone help me to tell what is wrong in my config file(s)?

Thanks in advance!

Last edited by dretech (2016-02-08 19:43:23)

Offline

#2 2016-02-09 20:10:22

dretech
Member
Registered: 2016-02-08
Posts: 7

Re: Help needed with configuring (bridge) network in LXC container

After spending a lot of time of searching on internet I found the cause of the problem: For testing purposes I was running a Virtual Box Virtual Machine and that Virtual Box Machine is the cause of the problem. I installed LXC on a real machine and the problem is gone!

Offline

Board footer

Powered by FluxBB