Skip to contentSkip to conversation

Simple bridge, something's wrong

Bridge Michael Jinks 2 participants 3 messages Oct 8, 2007 Ethernet bridge

lore
Share & tools
lore
#0 lore raw

Hi, list.

I'm trying to set up a bridging VPN and having trouble. The VPN part seems to be working well, but for some reason bridging doesn't.

To make things as simple as possible for tracking down what I'm doing wrong, I've set up a test network with three Linux machines connected to two ethernet segments, no VPN stuff involved:

Host A Host B Host C
10.1.1.15--[segment 1]--[br0, no IP]--[segment 2]--10.1.1.16

                        (eth1, eth2)

On Host B:

  $ /sbin/brctl show
  bridge name     bridge id               STP enabled     interfaces
  br0             8000.000c299eefe7       no              eth1
                                                          eth2

If I try to ping Host C from Host A, I get "Destination host unreachable". Watching tcpdump on Host B at the same time, I see "who-has" arp requests coming in, but nothing going back out and no replies. brctl shows that the bridge has learned the MAC of Host A, but not Host C.

  $ sudo tcpdump -n -i br0
  tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
  listening on br0, link-type EN10MB (Ethernet), capture size 96 bytes
  01:46:37.542316 arp who-has 10.1.1.15 tell 10.1.1.16
  01:46:38.543744 arp who-has 10.1.1.15 tell 10.1.1.16
  01:46:39.544740 arp who-has 10.1.1.15 tell 10.1.1.16
  $ /sbin/brctl showmacs br0
  port no mac addr                is local?       ageing timer
    1     00:0c:29:9e:ef:e7       yes                0.00
    2     00:0c:29:9e:ef:f1       yes                0.00
    1     00:0c:29:d9:59:d8       no                 1.83

(00:0c:29:d9:59:d8 is correct for Host A.)

If I try to ping the other direction at the same time -- to Host A from Host C -- ping on host C doesn't produce any output at all, I don't see any arp traffic from Host C on Host B, and brctl doesn't show anything new.

But, a few seconds after I stop pinging from Host A, Host B starts to produce "host unreachable" messages, Host B sees C's arp requests, and for a short while brctl shows both systems' MAC addresses, until the record for A eventually times out:

  $ /sbin/brctl showmacs br0
  port no mac addr                is local?       ageing timer
    2     00:0c:29:25:1a:00       no                 0.74
    1     00:0c:29:9e:ef:e7       yes                0.00
    2     00:0c:29:9e:ef:f1       yes                0.00
    1     00:0c:29:d9:59:d8       no                10.85

So, traffic is reaching the bridge, but it seems that nothing is ever repeated onto the other segment, and whichever host pings the bridge first "squashes" any traffic from the other.

I've tried various combinations of settings under /proc. ip_forward set to both 1 and 0; /proc/sys/net/bridge/bridge-nf-* all set to 0 or all set to 1. That doesn't seem to make any difference.

I thought I might have a firewall rule getting in the way, and I'm not sure I've eliminated that possibility, but I've tried lots of different settings there too, including a complete flush of everything in iptables and ebtables. Nothing has helped, but I did use ebtables logging to generate this, a three-line pattern typical of what I see on host B (hostname "frail") when .15 is trying to ping .16:

  Oct  8 02:16:37 frail ebtables-broute IN=eth2 OUT= MAC source = 00:0c:29:25:1a:00 MAC dest = ff:ff:ff:ff:ff:ff proto = 0x0806 ARP HTYPE=1, PTYPE=0x0800, OPCODE=1 ARP MAC SRC=00:0c:29:25:1a:00  ARP IP SRC=10.1.1.15 ARP MAC DST=00:00:00:00:00:00  ARP IP DST=10.1.1.16
  Oct  8 02:16:37 frail ebtables-forward IN=eth2 OUT=eth1 MAC source = 00:0c:29:25:1a:00 MAC dest = ff:ff:ff:ff:ff:ff proto = 0x0806 ARP HTYPE=1, PTYPE=0x0800, OPCODE=1 ARP MAC SRC=00:0c:29:25:1a:00  ARP IP SRC=10.1.1.15 ARP MAC DST=00:00:00:00:00:00  ARP IP DST=10.1.1.16
  Oct  8 02:16:37 frail ebtables-in IN=eth2 OUT= MAC source = 00:0c:29:25:1a:00 MAC dest = ff:ff:ff:ff:ff:ff proto = 0x0806 ARP HTYPE=1, PTYPE=0x0800, OPCODE=1 ARP MAC SRC=00:0c:29:25:1a:00  ARP IP SRC=10.1.1.15 ARP MAC DST=00:00:00:00:00:00  ARP IP DST=10.1.1.16

That's with a broute rule set to ACCEPT everything. If I DROP instead, as the ebtables manpage seems to say I should in this case, the "ebtables-forward" and "ebtables-in" lines disappear, but packets still don't cross the bridge.

One last bit of screen output, suggested by a recent thread in the list archive, not sure if it's helpful or not:

  $ /sbin/ip -s -s link show br0
  9: br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue 
      link/ether 00:0c:29:9e:ef:e7 brd ff:ff:ff:ff:ff:ff
      RX: bytes  packets  errors  dropped overrun mcast   
      119116     2587     0       0       0       2584   
      RX errors: length  crc     frame   fifo    missed
                 0        0       0       0       0      
      TX: bytes  packets  errors  dropped carrier collsns 
      336        4        0       0       0       0      
      TX errors: aborted fifo    window  heartbeat
                 0        0       0       0 

...and that's everything I can think of right now. Any suggestions for where else to look? Useful information I've left out?

Thanks,
--Michael

#1 lore raw
Quoted 5 lines · On Mon, 8 Oct 2007 02:50:42 -0500 Michael Jinks <[email protected]> wrote:

Hi, list.

I'm trying to set up a bridging VPN and having trouble. The VPN part seems to be working well, but for some reason bridging doesn't.

Quoted 7 lines

To make things as simple as possible for tracking down what I'm doing wrong, I've set up a test network with three Linux machines connected to two ethernet segments, no VPN stuff involved:

Host A Host B Host C
10.1.1.15--[segment 1]--[br0, no IP]--[segment 2]--10.1.1.16

                        (eth1, eth2)

Does Host B have an IP address or is it a pure bridge?

Quoted 6 lines

On Host B:

  $ /sbin/brctl show
  bridge name     bridge id               STP enabled     interfaces
  br0             8000.000c299eefe7       no              eth1
                                                          eth2

Did you wait for the forwarding delay (30 sec) to expire after setting up bridge?

/sbin/brctl showstp br0

Quoted 38 lines

If I try to ping Host C from Host A, I get "Destination host unreachable". Watching tcpdump on Host B at the same time, I see "who-has" arp requests coming in, but nothing going back out and no replies. brctl shows that the bridge has learned the MAC of Host A, but not Host C.

  $ sudo tcpdump -n -i br0
  tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
  listening on br0, link-type EN10MB (Ethernet), capture size 96 bytes
  01:46:37.542316 arp who-has 10.1.1.15 tell 10.1.1.16
  01:46:38.543744 arp who-has 10.1.1.15 tell 10.1.1.16
  01:46:39.544740 arp who-has 10.1.1.15 tell 10.1.1.16
  $ /sbin/brctl showmacs br0
  port no mac addr                is local?       ageing timer
    1     00:0c:29:9e:ef:e7       yes                0.00
    2     00:0c:29:9e:ef:f1       yes                0.00
    1     00:0c:29:d9:59:d8       no                 1.83

(00:0c:29:d9:59:d8 is correct for Host A.)

If I try to ping the other direction at the same time -- to Host A from Host C -- ping on host C doesn't produce any output at all, I don't see any arp traffic from Host C on Host B, and brctl doesn't show anything new.

But, a few seconds after I stop pinging from Host A, Host B starts to produce "host unreachable" messages, Host B sees C's arp requests, and for a short while brctl shows both systems' MAC addresses, until the record for A eventually times out:

  $ /sbin/brctl showmacs br0
  port no mac addr                is local?       ageing timer
    2     00:0c:29:25:1a:00       no                 0.74
    1     00:0c:29:9e:ef:e7       yes                0.00
    2     00:0c:29:9e:ef:f1       yes                0.00
    1     00:0c:29:d9:59:d8       no                10.85
Quoted 8 lines

So, traffic is reaching the bridge, but it seems that nothing is ever repeated onto the other segment, and whichever host pings the bridge first "squashes" any traffic from the other.

I've tried various combinations of settings under /proc. ip_forward set to both 1 and 0; /proc/sys/net/bridge/bridge-nf-* all set to 0 or all set to 1. That doesn't seem to make any difference.

Have you setup filter rules?? or just plan to in future.

Signature · 1 line
Stephen Hemminger <[email protected]>
#2 lore raw
Quoted 12 lines · Stephen Hemminger
Quoted 9 lines · On Mon, 8 Oct 2007 02:50:42 -0500 Michael Jinks <[email protected]> wrote:

Hi, list.

I'm trying to set up a bridging VPN and having trouble. The VPN part seems to be working well, but for some reason bridging doesn't.

To make things as simple as possible for tracking down what I'm doing wrong, I've set up a test network with three Linux machines connected to two ethernet segments, no VPN stuff involved:

Quoted 5 lines
Quoted 3 lines

Host A Host B Host C
10.1.1.15--[segment 1]--[br0, no IP]--[segment 2]--10.1.1.16

                        (eth1, eth2)

Does Host B have an IP address or is it a pure bridge?

No IP, pure bridge.

Early on I tried giving it an IP and found that A and C could both ping B if I set it to 10.1.1.17.

Quoted 11 lines
Quoted 6 lines

On Host B:

  $ /sbin/brctl show
  bridge name     bridge id               STP enabled     interfaces
  br0             8000.000c299eefe7       no              eth1
                                                          eth2

Did you wait for the forwarding delay (30 sec) to expire after setting up bridge?

/sbin/brctl showstp br0

Yes, that's one of the things I thought might be causing problems, but after leaving it overnight with one host pinging, still no joy. Here's what showstp looks like currently:

$ /sbin/brctl showstp br0
br0
 bridge id              8000.000c299eefe7
 designated root        8000.000c299eefe7
 root port                 0                    path cost                  0
 max age                  20.00                 bridge max age            20.00
 hello time                2.00                 bridge hello time          2.00
 forward delay            15.00                 bridge forward delay      15.00
 ageing time             300.00
 hello timer               1.91                 tcn timer                  0.00
 topology change timer     0.00                 gc timer                   0.06
 flags  

eth1 (0)

 port id                0000                    state                forwarding
 designated root        8000.000c299eefe7       path cost                100
 designated bridge      8000.000c299eefe7       message age timer          0.00
 designated port        8001                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.91

flags

eth2 (0)

 port id                0000                    state                forwarding
 designated root        8000.000c299eefe7       path cost                100
 designated bridge      8000.000c299eefe7       message age timer          0.00
 designated port        8002                    forward delay timer        0.00
 designated cost           0                    hold timer                 0.91

flags

<snip>

Quoted 1 line

Have you setup filter rules?? or just plan to in future.

Initially I didn't set any filter rules (at least, not with ebtables; I do have iptables rules on this box). My plan eventually is to give machines on either end of the bridge as much access as they'd have if they were on the same network segment, so currently I don't plan to do any filtering.

Here's the present output from ebtables, first for the broute table:

  $ sudo /sbin/ebtables -t broute -L
  Bridge table: broute

Bridge chain: BROUTING, entries: 1, policy: DROP
--log-level debug --log-prefix "ebtables-broute" --log-ip --log-arp -j ACCEPT

then for the filter table:

  $ sudo /sbin/ebtables -t filter -L
  Bridge table: filter

Bridge chain: INPUT, entries: 1, policy: ACCEPT --log-level debug --log-prefix "ebtables-in" --log-ip --log-arp -j ACCEPT

Bridge chain: FORWARD, entries: 1, policy: ACCEPT --log-level debug --log-prefix "ebtables-forward" --log-ip --log-arp -j ACCEPT

Bridge chain: OUTPUT, entries: 1, policy: ACCEPT --log-level debug --log-prefix "ebtables-out" --log-ip --log-arp -j ACCEPT

I put in all those log directives to see if I could tell what was happeninng as packets cross the machine, but it just reinforced what I'd already found, that packets appear to reach the bridge, they traverse the "broute", "forward", and "input" chains, but they're never output again.

Here's a typical three-line log snippet, generated when .16 sends a single ping packet to .15:

  Oct  8 12:16:52 frail ebtables-broute IN=eth1 OUT= MAC source = 00:0c:29:d9:59:d8 MAC dest = ff:ff:ff:ff:ff:ff proto = 0x0806 ARP HTYPE=1, PTYPE=0x0800, OPCODE=1 ARP MAC SRC=00:0c:29:d9:59:d8  ARP IP SRC=10.1.1.16 ARP MAC DST=00:00:00:00:00:00  ARP IP DST=10.1.1.15
  Oct  8 12:16:53 frail ebtables-broute IN=eth1 OUT= MAC source = 00:0c:29:d9:59:d8 MAC dest = ff:ff:ff:ff:ff:ff proto = 0x0806 ARP HTYPE=1, PTYPE=0x0800, OPCODE=1 ARP MAC SRC=00:0c:29:d9:59:d8  ARP IP SRC=10.1.1.16 ARP MAC DST=00:00:00:00:00:00  ARP IP DST=10.1.1.15
  Oct  8 12:16:54 frail ebtables-broute IN=eth1 OUT= MAC source = 00:0c:29:d9:59:d8 MAC dest = ff:ff:ff:ff:ff:ff proto = 0x0806 ARP HTYPE=1, PTYPE=0x0800, OPCODE=1 ARP MAC SRC=00:0c:29:d9:59:d8  ARP IP SRC=10.1.1.16 ARP MAC DST=00:00:00:00:00:00  ARP IP DST=10.1.1.15

My iptables setup is a lot more extensive, but mostly applies to eth0, a public-facing interface. Still, just in case something I'd overlooked might be getting in the way, I tried flushing all my rules and setting all defaults to ACCEPT, with no effect. I also tried adding log directives similar to the ones I'm currently using with ebtables, and they showed the same stuff: arp requests come in, but they don't go back out again.

I've tried adding and removing "promisc" from both interfaces, and on the bridge device itself, again no effect that I saw. Based on someone's web page, currently I'm running both NICs in promiscuous mode, but the bridge is not.

Thanks,
-m