Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've got a virtual machine running under virtualbox, and in that virtual machine I've got an LXC container I'm trying to bridge to virtualbox's NAT interface:

-------------      -----------      -----------      ----------      ----------
| LXC       | ---> | Host OS | ---> | Virtual | ---> | Laptop | ---> | Router |
| Container |      | Linxu   |      | Box     |      |        |      |        |
-------------      -----------      -----------      ----------      ----------
eth0 10.1.0.35     br0 <-> eth0     NAT GW:          192.168.1.33    GW:
gw 10.1.0.2        br0 10.1.0.5      10.1.0.2/16                      192.168.1.1
                   gw 10.1.0.2

Ping 10.1.0.2      ping 10.1.0.2
 FAIL               OK

I cannot ping from the LXC container to the virtualbox gateway, but I can from the Host OS.

Note: running tcpdump on the host OS, I can sing pings being sent from the container to the router, and the reply from the router to the container, but tcpdump on the container shows no traffic.

LXC eth0

eth0      Link encap:Ethernet  HWaddr 00:16:3e:ed:82:b8
          inet addr:10.1.0.35  Bcast:10.1.255.255  Mask:255.255.0.0
          inet6 addr: fe80::216:3eff:feed:82b8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:585 errors:0 dropped:0 overruns:0 frame:0
          TX packets:588 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:58003 (58.0 KB)  TX bytes:56447 (56.4 KB)

Host OS:

root@ubuntuserver:/# ifconfig
br0       Link encap:Ethernet  HWaddr 08:00:27:ca:5f:7a
          inet addr:10.1.0.5  Bcast:10.1.255.255  Mask:255.255.0.0
          inet6 addr: fe80::a00:27ff:feca:5f7a/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:2012 errors:0 dropped:0 overruns:0 frame:0
          TX packets:882 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:158794 (158.7 KB)  TX bytes:139083 (139.0 KB)

eth0      Link encap:Ethernet  HWaddr 08:00:27:ca:5f:7a
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:2968 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2404 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:281188 (281.1 KB)  TX bytes:312109 (312.1 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:180 errors:0 dropped:0 overruns:0 frame:0
          TX packets:180 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:14376 (14.3 KB)  TX bytes:14376 (14.3 KB)

vethStvXMU Link encap:Ethernet  HWaddr fe:9a:36:3a:84:1c
          inet6 addr: fe80::fc9a:36ff:fe3a:841c/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:557 errors:0 dropped:0 overruns:0 frame:0
          TX packets:554 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:53465 (53.4 KB)  TX bytes:55003 (55.0 KB)


root@ubuntuserver:/# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.080027ca5f7a       no              eth0
                                                        vethStvXMU
share|improve this question
    
What does cat /proc/sys/net/ipv4/ip_forward say? Can you ping the local ip's of your containers from the host? –  Abhishek Amralkar Mar 29 '13 at 6:25
    
It was disabled, but I enabled it previously. But in this case, we're not forwarding packets I don't think. We're physically bridging the LXC interface and eth0, so I think forwarding isn't required. –  David Parks Mar 29 '13 at 6:28
    
Are the nameservers configured in /etc/resolv.conf ? If not, this might work: cat /etc/resolvconf/resolv.conf.d/original > /etc/resolvconf/resolv.conf.d/tail /etc/init.d/resolvconf restart –  Abhishek Amralkar Mar 29 '13 at 6:30
    
It's a good though, but they are, and I'm just trying to ping the gateway by IP: 10.1.0.2. Interestingly if I run tcpdump ICMP on the host I can see the gateway receive the ping and reply, but it never makes it to the LXC container –  David Parks Mar 29 '13 at 7:33
    
Please don't post answers that merely ask for more information. That's what comemnts are for. –  Dennis Kaarsemaker Mar 30 '13 at 9:10
show 1 more comment

migrated from serverfault.com Mar 30 '13 at 9:56

This question came from our site for professional system and network administrators.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.