Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to bridge between eth2 and br0 from ubuntu 11.04 within virtual box. There is network bridging to host physical machine.

From the guest OS after bridging I can ping from br0 but not from eth2. Why?

ping -I eth2 bbc.co.uk

PING bbc.co.uk (212.58.241.131) from 172.16.4.186 eth2: 56(84) bytes of data.
From VirtualBox.local (172.16.4.103) icmp_seq=2 Destination Host Unreachable
From VirtualBox.local (172.16.4.103) icmp_seq=3 Destination Host Unreachable

ping -I br0 bbc.co.uk

PING bbc.co.uk (212.58.241.131) from 172.16.4.186 br0: 56(84) bytes of data.
64 bytes from virtual-vip.thdo.bbc.co.uk (212.58.241.131): icmp_req=1 ttl=239 time=31.2 ms

My /etc/network/interfaces is as follows

auto lo
iface lo inet loopback

auto eth2
iface eth2 inet manual

auto br0
iface br0 inet static
        address 172.16.4.186
        network 172.16.4.255
        netmask 255.255.255.0
        broadcast 172.16.4.255
        gateway 172.16.4.1
        bridge_ports eth2
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0

the gateway is route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.16.4.1      0.0.0.0         UG    100    0        0 br0
172.16.4.0      0.0.0.0         255.255.255.0   U     0      0        0 br0
172.16.4.0      0.0.0.0         255.255.255.0   U     1      0        0 eth3

ifconfig

br0       Link encap:Ethernet  HWaddr 08:00:27:4a:08:57  
          inet addr:172.16.4.186  Bcast:172.16.4.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe4a:857/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2969 errors:0 dropped:0 overruns:0 frame:0
          TX packets:267 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:200777 (200.7 KB)  TX bytes:28141 (28.1 KB)

eth0      Link encap:Ethernet  HWaddr 08:00:27:df:f5:a7  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:36 errors:0 dropped:0 overruns:0 frame:0
          TX packets:392 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3904 (3.9 KB)  TX bytes:55700 (55.7 KB)

eth2      Link encap:Ethernet  HWaddr 08:00:27:4a:08:57  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19849 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1206 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1631595 (1.6 MB)  TX bytes:114927 (114.9 KB)

eth3      Link encap:Ethernet  HWaddr 08:00:27:50:00:2d  
          inet addr:172.16.4.103  Bcast:172.16.4.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe50:2d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19515 errors:0 dropped:0 overruns:0 frame:0
          TX packets:145 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1625905 (1.6 MB)  TX bytes:17450 (17.4 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:113 errors:0 dropped:0 overruns:0 frame:0
          TX packets:113 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:12544 (12.5 KB)  TX bytes:12544 (12.5 KB)
share|improve this question

3 Answers 3

up vote 5 down vote accepted

That is the intended behaviour. If you connect eth2 to a bridge then eth2 becomes unusable (even with an IP address). You use br0 on the software side, eth0 is used physically.

In general when talking about bridges it makes sense to give the output of brctl show

share|improve this answer

This is as it should be. Ping is a layer 3 thing. A bridged interface is a purely layer 2 thing. You can't ping from an Ethernet cable either for the same reason. Just like a pure switch has no idea what ping is, a pure switching interface has no idea what ping is either.

share|improve this answer

There is no ipaddress on interface eth2.

This is also the problem.

share|improve this answer
    
@mdpc, how is this not an answer? It seems pretty clear to me. If you want to ping something you must have an IP. NO Internet Protocol address basically means No Internet Protocol communication. –  Zoredache Feb 13 '13 at 17:41
    
Why is that a problem? eth2 is a bridging interface and shouldn't have an IP address. br0 has an IP address. –  David Schwartz Feb 13 '13 at 17:44
    
ping -I eth2 bbc.co.uk he forced ping to use interface eth2 with no ip address. –  High Ball Feb 13 '13 at 17:45
    
Right, so the problem is that he forced ping to use interface eth2, not that eth2 has no IP address. It should have no IP address. It just shouldn't be pinged from. –  David Schwartz Feb 13 '13 at 18:10
    
@DavidSchwartz You have to differentiate the best practice and how the software is behaving. I see no problem on sending a raw IP packet on an interface that has no IP address. For example you can send an UDP packet (like Wake On LAN) on the broadcast IP address with a unicast MAC address to wake up a computer, the source can be a layer 2 equipment, which does not care about the answer. –  Mircea Vutcovici Feb 13 '13 at 18:43

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.