Skip to contentSkip to conversation

Strange DHCP behaviour with bridging

Bridge Stephen Hemminger 3 participants 3 messages Mar 16, 2004 – Mar 23, 2004 1 message not in the archive Ethernet bridge

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 2 lines · On Tue, 16 Mar 2004 09:28:37 +0100 <[email protected]> wrote:

I sent this message to the briding mailing list, but I didn't get any answer and I can't find how to subscribe; I think you are the mailing list manager so I send this hoping for better luck.

http://lists.osdl.org/mailman/listinfo/bridge

Quoted 4 lines

Here is the scenario: I have one server with kernel 2.4.24 with a bridge br0 made of 2 interfaces, eth0 and tap0 (the last is an OpenVPN tunnel), and one remote computer connetting through tap0.

Quoted 16 lines

If I assign a static IP to the remote computer, the bridge works perfecly (so I think the problem is not OpenVPN-related). If I start a DHCPd on the server and I configure the remote client to get the IP from it, something strange happens: if I "sniff" on the br0 interface, I can see the DHCP requests coming from the client (from 0.0.0.0.bootpc to 255.255.255.bootps) and the DHCPd answers going back from ip.of.the.server.bootps to 255.255.255.255.bootpc; also sniffing on eth0 gives the same result, but if I sniff on the tap0 interface, I don't see the replies! So the client never get its own IP. What I'm doing wrong? To add some mistery, sometimes (one try out of 10) the reply flows correctly to the remote client. All the three interfaces (eth0, br0, tap0) doesn't have firewalling enabled, and under /proc ip_forwarding is enabled and rp_filter is disabled for all interfaces. brctl showmacs br0 correctly shows the remote virtual interface MAC address as not local.Both eth0 and tap0 have been configured with ifconfig 0.0.0.0 promisc up.

So the packet makes it into the tap0 device, but the bridge doesn't know where to send the output. Are you running spanning tree protocol or not? Look at the contents of the forwarding table (brctl showmacs br0) Spanning tree does take a while to settle on startup so it could be that you need to wait about a minute till the bridge starts running.

Or may the tap device doesn't have a real hardware mac address is confusing it.

#2 lore raw
Quoted 3 lines · you

So the packet makes it into the tap0 device, but the bridge doesn't know where to send the output. Are you running spanning tree protocol or not?

No, btrcl showstp br0 says it's disabled

Quoted 6 lines

Look at the contents of the forwarding table (brctl showmacs br0) Spanning tree does take a while to settle on startup so it could be that you need to wait about a minute till the bridge starts running.

Or may the tap device doesn't have a real hardware mac address is confusing it.

brctl showmacs br0 shows the mac address of the local virtual tap interface as local, and shows the mac address of the remote virtual interface as remote (which I think it's correct)

#3 lore raw
In reply to Stephen Hemminger
Quoted 23 lines · Stephen Hemminger
Quoted 4 lines · On Tue, 16 Mar 2004 09:28:37 +0100 <[email protected]> wrote:

Here is the scenario: I have one server with kernel 2.4.24 with a bridge br0 made of 2 interfaces, eth0 and tap0 (the last is an OpenVPN tunnel), and one remote computer connetting through tap0.

Quoted 16 lines

If I assign a static IP to the remote computer, the bridge works perfecly (so I think the problem is not OpenVPN-related). If I start a DHCPd on the server and I configure the remote client to get the IP from it, something strange happens: if I "sniff" on the br0 interface, I can see the DHCP requests coming from the client (from 0.0.0.0.bootpc to 255.255.255.bootps) and the DHCPd answers going back from ip.of.the.server.bootps to 255.255.255.255.bootpc; also sniffing on eth0 gives the same result, but if I sniff on the tap0 interface, I don't see the replies! So the client never get its own IP. What I'm doing wrong? To add some mistery, sometimes (one try out of 10) the reply flows correctly to the remote client. All the three interfaces (eth0, br0, tap0) doesn't have firewalling enabled, and under /proc ip_forwarding is enabled and rp_filter is disabled for all interfaces. brctl showmacs br0 correctly shows the remote virtual interface MAC address as not local.Both eth0 and tap0 have been configured with ifconfig 0.0.0.0 promisc up.

Quoted 8 lines

So the packet makes it into the tap0 device, but the bridge doesn't know where to send the output. Are you running spanning tree protocol or not? Look at the contents of the forwarding table (brctl showmacs br0) Spanning tree does take a while to settle on startup so it could be that you need to wait about a minute till the bridge starts running.

Or may the tap device doesn't have a real hardware mac address is confusing it.

Hello,

I have been trying to get bridging with tap devices working for a few days; it would appear as though the bridge is unable to properly forward traffic to the remote end of a tap device from another tap (specifically between 2 UMLs).

If I enslave 2 tap devices to the bridge and then start 2 UMLs that supply the remote (non-local) ends of the tap the bridge shows:

snitm@amstel:~> sudo brctl showmacs br0

port no mac addr                is local?       ageing timer
  1     00:ff:33:9f:43:45       yes                0.00
  2     00:ff:91:17:3a:d5       yes                0.00
  1     fe:fd:c0:a8:00:02       no                30.74
  2     fe:fd:c0:a8:00:03       no                 0.27

NOTE:
local #1 is tap0
local #2 is tap1
non-local #1 is uml0's eth0
non-local #2 is uml1's eth0

From within either guest UML I can ping the host but I cannot ping the other guest UML. On the host I can ping each eth0 interface of the guest UMLs. If I go ahead and enslave an ethernet device on the host (making other machines available through that device) the UML guests can't ping those machines either. Meanwhile the bridge (host/umlhost) is able to ping all enslaved members of the switch (local or non-local).

I even have iptables MASQ going on the host so that traffic from br0 is routed out eth0 to the greater internet; the guest UMLs can get out to the net fine.

SO ultimately attempts to communicate through a tap device to other members of the ethernet bridge fail (except for the bridge's IP and other physical devices on the host machine).

My findings with pinging other machines that are available through a eth device that I enslave closely mirror what was describved earlier on this list:

http://lists.osdl.org/pipermail/bridge/2004-February/000188.html

Any insight into the bridging code's ability to _really_ work with tap devices would be greatly appreciated.

I've attached a script that I use to easily start and stop the bridge and tap devices; maybe it could help others trying to reproduce these tap issues with bridging.

Regards,
Mike

FYI.
I've subscribed to the bridge list but haven't been approved yet.