Hi,<br><br>I'm facing a connectivity problem to get connection between an lxc guest(192.168.56.100) to a vbox host(192.68.56.1) having Destination Host Unreachable after pinging each other.<br><br><br>This is my topology:<br>
<br>Internet ------- vBox Host(VirtualBox) ------------------------------- LXC host------------ LXC guest <br> (eth0) (vboxnet0) (br0) (eth0) (eth0) <br>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>VBOX<br><br>
eth0 Link encap:Ethernet HWaddr 00:90:f5:d3:be:c0 <br> inet addr:192.168.5.58 Bcast:192.168.5.255 Mask:255.255.255.0<br> inet6 addr: fe80::290:f5ff:fed3:bec0/64 Scope:Link<br> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br>
RX packets:185122 errors:0 dropped:315 overruns:0 frame:0<br> TX packets:156027 errors:0 dropped:0 overruns:0 carrier:0<br> collisions:0 txqueuelen:1000 <br> RX bytes:191082114 (191.0 MB) TX bytes:18932999 (18.9 MB)<br>
<br>vboxnet0 Link encap:Ethernet HWaddr 0a:00:27:00:00:00 <br> inet addr:192.168.56.1 Bcast:192.168.56.255 Mask:255.255.255.0<br> inet6 addr: fe80::800:27ff:fe00:0/64 Scope:Link<br> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br>
RX packets:0 errors:0 dropped:0 overruns:0 frame:0<br> TX packets:3218 errors:0 dropped:0 overruns:0 carrier:0<br> collisions:0 txqueuelen:1000 <br> RX bytes:0 (0.0 B) TX bytes:213032 (213.0 KB)<br>
<br>Kernel IP routing table<br>Destination Gateway Genmask Flags Metric Ref Use Iface<br>0.0.0.0 192.168.5.1 0.0.0.0 UG 0 0 0 eth0<br>169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0<br>
192.168.5.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0 <---------------------------- Internet <br>192.168.56.0 0.0.0.0 255.255.255.0 U 0 0 0 vboxnet0<br><br><br>
? (192.168.56.100) at 08:00:27:88:6f:08 [ether] on vboxnet0<br>? (192.168.5.1) at 00:0c:42:bc:e7:42 [ether] on eth0<br><br>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br clear="all">
LXC HOST<br><br>/etc/sysconfig/network-scripts/ifcfg-eth0 <br> DEVICE=eth0<br> ONBOOT=yes<br> TYPE=Ethernet<br> USERCTL=no<br> BRIDGE=br0<br><br>/etc/sysconfig/network-scripts/ifcfg-br0 <br> DEVICE=br0<br> TYPE=Bridge<br>
BOOTPROTO=static<br> DNS1=8.8.8.8<br> DNS2=8.8.4.4<br> GATEWAY=192.168.56.1<br> IPADDR=192.168.56.254<br> NETMASK=255.255.255.0<br> ONBOOT=yes<br><br>Kernel IP routing table <br>Destination Gateway Genmask Flags Metric Ref Use Iface<br>
192.168.56.0 0.0.0.0 255.255.255.0 U 0 0 0 br0<br>169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 br0<br>0.0.0.0 192.168.56.1 0.0.0.0 UG 0 0 0 br0<br>
<br>#brctl show<br>bridge name bridge id STP enabled interfaces<br>br0 8000.080027ff67a8 no eth0<br> veth62vD6v<br>
<br>#sysctl -p | grep forward<br>net.ipv4.ip_forward = 1<br><br>#arp -a<br>? (192.168.56.1) at 0a:00:27:00:00:00 [ether] on br0<br>? (192.168.56.100) at 0a:c8:4d:9a:e5:12 [ether] on br0<br><br><br>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>LXC Guest<br><br>/etc/sysconfig/network-scripts/ifcfg-eth0 <br> DEVICE=eth0<br> ONBOOT=yes<br> TYPE=Ethernet<br> DNS1=8.8.8.8<br> DNS2=8.8.4.4<br> IPADDR=192.168.56.100<br> NETMASK=255.255.255.0<br> BOOTPROTO=static<br>
USERCTL=yes<br><br>Kernel IP routing table<br>Destination Gateway Genmask Flags Metric Ref Use Iface<br>192.168.56.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0<br>169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0<br>
<br>#arp -a<br>? (192.168.56.254) at 08:00:27:ff:67:a8 [ether] on eth0<br>? (192.168.56.1) at 0a:00:27:00:00:00 [ether] on eth0<br><br>#ping 192.168.56.1<br>PING 192.168.56.1 (192.168.56.1) 56(84) bytes of data.<br>From 192.168.56.100 icmp_seq=10 Destination Host Unreachable<br>
>From 192.168.56.100 icmp_seq=11 Destination Host Unreachable<br><br>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
Finally LXC Config:<br><br>lxc.utsname = model<br>lxc.network.type = veth<br>lxc.network.flags = up<br>lxc.network.link = br0<br>lxc.network.ipv4 = 192.168.1.100<br><a href="http://lxc.network.name">lxc.network.name</a> = eth0<br>
lxc.tty = 4<br>lxc.pts = 1024<br>lxc.rootfs = /var/lib/lxc/model/rootfs<br>lxc.mount = /var/lib/lxc/model/fstab<br><br><br><br><br>I'm blocked, I don't know if it's a routing problem, a problem with virtual box or an lxc misconfiguration. I appreciate any suggestions to get a workaround.<br>
<br>Greetings,<br><br><br><br>-- <br>Luis M. Ibarra