<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 2011-06-30 20:55, Jason McKellar wrote:
<blockquote
cite="mid:BANLkTimsAM7_CE7VizzUcPDCDULy7Op18A@mail.gmail.com"
type="cite">
<pre wrap="">Hello,
I have been trying for quite sometime to get the network setup in an
LXC container (I am using debian wheezy where LXC comes standard).
I have created the container and can start it fine, but no networking works.
My host /etc/networking/interfaces is:
auto br0
iface br0 inet static
bridge_ports eth0
bridge_fd 0
address 192.168.10.74
netmask 255.255.255.248
gateway 192.168.10.73
dns-nameservers 8.8.8.8
iface br0:0 inet static
address 192.168.10.75
netmask 255.255.255.248
gateway 192.168.10.73
Which works fine, ifconfig shows br0 and br0:0 with the correct addresses.
I have my lxc config as:
lxc.tty = 4
lxc.pts = 1024
lxc.rootfs = /var/lib/lxc/vm0/rootfs
lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm
# mounts point
lxc.mount.entry=proc /var/lib/lxc/vm0/rootfs/proc proc nodev,noexec,nosuid 0 0
lxc.mount.entry=devpts /var/lib/lxc/vm0/rootfs/dev/pts devpts defaults 0 0
lxc.mount.entry=sysfs /var/lib/lxc/vm0/rootfs/sys sysfs defaults 0 0
lxc.utsname = vm0
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0:0
lxc.network.ipv4 = 192.168.10.75/29
lxc.network.veth.pair = vethvm0
</pre>
</blockquote>
<br>
Here you can define also the iface of the container:<br>
lxc.network.name = eth0<br>
<br>
The network.link can be br0 (actually I don't know, it could work
also with br0:0, but i'm not sure).<br>
<br>
In the interfaces file supposed to be this:<br>
<br>
<pre wrap="">auto br0
iface br0 inet static
bridge_ports eth0
bridge_fd 0
address 192.168.10.74
netmask 255.255.255.248
gateway 192.168.10.73
<b> bridge_stp off
bridge_maxwait 0</b>
<b>auto br0:0</b>
iface br0:0 inet static
address 192.168.10.75
netmask 255.255.255.248
# not necessary gateway 192.168.10.73</pre>
<br>
So try it with these changes, I hope it will be enough and help:)<br>
<br>
tamas<br>
</body>
</html>