[Lxc-users] question about bridged networking
Jun Yang
jyang825 at gmail.com
Sun Sep 18 04:20:02 UTC 2011
Hi all,
I am trying to set up a VPS using LXC 0.7.4. I want the VPS to have a
static IP address on the same subnet as the host. Here is what I have in
host (Ubuntu 11.04)'s /etc/network/interfaces:
auto eth0
iface eth0 inet static
address 192.168.0.202
netmask 255.255.255.0
gateway 192.168.0.1
auto br101
iface br101 inet static
address 192.168.0.101
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
bridge_ports eth0
bridge_stp off
bridge_maxwait 5
post-up /usr/sbin/brctl setfd br101 0
Problem 1, when I reboot the host, the host's br101 get 192.168.0.101
(expected) but eth0 gets no IP address. I can bring up eth0 manually at
this point and it gets 192.168.0.202 (expected). But at this point,
192.168.0.101 is really an IP address of the host. I set up my VPS as:
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br101
lxc.utsname = vps101
lxc.tty = 4
lxc.pts = 1024
lxc.rootfs = /var/lib/lxc/vps101/rootfs
lxc.mount = /var/lib/lxc/vps101/fstab
...
I can bring it up. But when I do "ssh root at 192.168.0.101", I get into host
rather than the guest.
How is bridged networking supposed to work in this case? I thought
192.168.0.101 would be routed to the guest. Thanks!
Jun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20110918/e3ff177a/attachment.html>
More information about the lxc-users
mailing list