Skip to contentSkip to conversation

Static arp entries in showmacs?

Bridge Matthew Hall 2 participants 5 messages May 14, 2004 Ethernet bridge

lore
Share & tools
lore
#0 lore raw

Hi all,

	You'll have to excuse me if i'm replicating questions asked before;

i've googled till I died and couldn't find anything on the list archives on this subject.

I'm having a little problem with my bridge and its interaction with a 'Windows Load Balanced Server' (whoopee, guess where the problem lies ;) ). To give a little background, we've got a windows server hosted on a bridged lan behind our linux firewall (kern: 2.4.21). The ip of the server itself is an alias shared by 3 load balanced windows machines.
The symptoms of our problem are that incoming web traffic to our firewall is being dnatted to the internal ip and that traffic is being passed out of all the bridged interfaces. This is happening because the bridge does not have a mac address nextentry for what the kernel believes is the mac address of that machine. The bridge doesn't have a mac address for it because when our box makes an arp request for the ip address, all three windows servers' reply at the same time, with the same arp layer address, but with differing ether addresses; e.g.

  1   0.000000 00:50:c2:11:34:9d ->              ARP Who has 10.0.0.21?  Tell 10.0.0.1
  2   0.000108 00:08:02:a1:e6:a1 ->              ARP 10.0.0.21 is at 03:bf:0a:00:00:15
  3   0.000112 00:08:02:47:be:16 ->              ARP 10.0.0.21 is at 03:bf:0a:00:00:15
  4   0.000136 00:02:a5:eb:f8:45 ->              ARP 10.0.0.21 is at 03:bf:0a:00:00:15

This seems to confuse the bridge somewhat (at least it seems that way to me, but could be the intended behaviour); as the bridge updates it's arp tables with the ether source addresses ('pointing' to the correct physical interface); yet the kernel arp tables contain the arp layer address (03:bf) 'pointing' to the bridge; e.g:

# brctl showmacs br0
port no mac addr                is local?       ageing timer
  2     00:02:a5:eb:f8:45       no                 0.15
  2     00:08:02:a1:e6:a1       no                 0.12
  2     00:08:02:47:be:16       no                 0.01
# arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
10.0.0.21                ether   03:BF:0A:00:00:15   C                     br0

As I see it:
When packets are dnatted to the internal ip, the kernel modifies the destination ip and ethernet address of the packet to send to 03:bf; it's then passed to the bridge, the bridge can't correlate the 03:bf hardware address with any particular interface, fails 'open' and sends the frame out of all the interfaces on the bridge (to the 03:bf ether address).

I think quite obviously, this is the fault of the windows machines replying in unison with differing ether addresses to arp addresses, but I was wondering if there was a way to workaround the problem (and moving away from windows isn't a solution, at least for our client).

The most obvious method I could see is to set a static mac addr entry for the offending 03:bf address out of the right interface in the forwarding database; yet I'm unable to find any documentation on how to do so.
I've gone so far to look at the bridge-utils and kernel bridging code but alas, could not find that particular functionality; though the presence of is_static in the forwarding database (struct net_bridge_fdb_entry) would lead me to believe maybe it's is possible??. So I ask, whether there is such functionality, if so how so; or if not has anyone got any good ideas... (doing it this way, would be a 'clean' solution for me; though i'll probably try ebtables as a last resort, if I can't figure this out).

Thanks in advance,
Matt

#1 lore raw
Quoted 68 lines · On Fri, 14 May 2004 15:35:29 +0100 Matthew Hall <[email protected]> wrote:

Hi all,

	You'll have to excuse me if i'm replicating questions asked before;

i've googled till I died and couldn't find anything on the list archives on this subject.

I'm having a little problem with my bridge and its interaction with a 'Windows Load Balanced Server' (whoopee, guess where the problem lies ;) ). To give a little background, we've got a windows server hosted on a bridged lan behind our linux firewall (kern: 2.4.21). The ip of the server itself is an alias shared by 3 load balanced windows machines.
The symptoms of our problem are that incoming web traffic to our firewall is being dnatted to the internal ip and that traffic is being passed out of all the bridged interfaces. This is happening because the bridge does not have a mac address nextentry for what the kernel believes is the mac address of that machine. The bridge doesn't have a mac address for it because when our box makes an arp request for the ip address, all three windows servers' reply at the same time, with the same arp layer address, but with differing ether addresses; e.g.

  1   0.000000 00:50:c2:11:34:9d ->              ARP Who has 10.0.0.21?  Tell 10.0.0.1
  2   0.000108 00:08:02:a1:e6:a1 ->              ARP 10.0.0.21 is at 03:bf:0a:00:00:15
  3   0.000112 00:08:02:47:be:16 ->              ARP 10.0.0.21 is at 03:bf:0a:00:00:15
  4   0.000136 00:02:a5:eb:f8:45 ->              ARP 10.0.0.21 is at 03:bf:0a:00:00:15

This seems to confuse the bridge somewhat (at least it seems that way to me, but could be the intended behaviour); as the bridge updates it's arp tables with the ether source addresses ('pointing' to the correct physical interface); yet the kernel arp tables contain the arp layer address (03:bf) 'pointing' to the bridge; e.g:

# brctl showmacs br0
port no mac addr                is local?       ageing timer
  2     00:02:a5:eb:f8:45       no                 0.15
  2     00:08:02:a1:e6:a1       no                 0.12
  2     00:08:02:47:be:16       no                 0.01
# arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
10.0.0.21                ether   03:BF:0A:00:00:15   C                     br0

As I see it:
When packets are dnatted to the internal ip, the kernel modifies the destination ip and ethernet address of the packet to send to 03:bf; it's then passed to the bridge, the bridge can't correlate the 03:bf hardware address with any particular interface, fails 'open' and sends the frame out of all the interfaces on the bridge (to the 03:bf ether address).

I think quite obviously, this is the fault of the windows machines replying in unison with differing ether addresses to arp addresses, but I was wondering if there was a way to workaround the problem (and moving away from windows isn't a solution, at least for our client).

The most obvious method I could see is to set a static mac addr entry for the offending 03:bf address out of the right interface in the forwarding database; yet I'm unable to find any documentation on how to do so.
I've gone so far to look at the bridge-utils and kernel bridging code but alas, could not find that particular functionality; though the presence of is_static in the forwarding database (struct net_bridge_fdb_entry) would lead me to believe maybe it's is possible??. So I ask, whether there is such functionality, if so how so; or if not has anyone got any good ideas... (doing it this way, would be a 'clean' solution for me; though i'll probably try ebtables as a last resort, if I can't figure this out).

Quoted 3 lines

Thanks in advance,
Matt

What is the (pseudo) hardware address of the bridge (ie ifconfig br0)? Also, how is IP setup on the linux box. You need to assign an IP address to the bridge (br0) and not to the the ethernet ports (eth0,eth1,eth2...)

#2 lore raw
Quoted 3 lines · Stephen Hemminger

What is the (pseudo) hardware address of the bridge (ie ifconfig br0)? Also, how is IP setup on the linux box. You need to assign an IP address to the bridge (br0) and not to the the ethernet ports (eth0,eth1,eth2...)

It is like so, the bridge has the ip addr 10.0.0.1; the bridge itself contains the interfaces eth1,2,4 and 5; all of these interfaces _do not_ have an ip address; they are just "ip link set eth$ up'd"; e.g:

br0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue

    link/ether 00:50:c2:11:34:9d brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 brd 10.255.255.255 scope global br0
eth1: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:50:c2:11:34:9d brd ff:ff:ff:ff:ff:ff
eth2: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:50:c2:11:34:9e brd ff:ff:ff:ff:ff:ff
eth4: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:50:c2:11:36:50 brd ff:ff:ff:ff:ff:ff
eth5: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:50:c2:11:36:51 brd ff:ff:ff:ff:ff:ff
bridge name     bridge id               STP enabled     interfaces
br0             8000.0050c211349d       no              eth1

eth2 eth4 eth5

(The other interfaces are not part of the bridge, one is the external line (eth0); and the other a separate private network (eth3 - 192.168.x.x).

I will also add, I did a little research on msdn, and found out something about the MS way of loadbalancing; in that 03:bf:0a:00:00:15 address seems to be a multicast hardware address; frames sent to this would get sent to all of the hardware addresses in that 'group' (the other three windows machines (which is why i'm seeing 3 arp replies for 1 request, methinks)).

Happy to oblige with any more info, if required.

Cheers,
Matt

#3 lore raw
In reply to Matthew Hall

As you deduced, the way the MS load balancer works is to have a single IP address mapped to a multicast address. Then when a TCP connection starts it responds with an ARP packet to redirect traffic from that host.

Quoted 5 lines

When packets are dnatted to the internal ip, the kernel modifies the destination ip and ethernet address of the packet to send to 03:bf; it's then passed to the bridge, the bridge can't correlate the 03:bf hardware address with any particular interface, fails 'open' and sends the frame out of all the interfaces on the bridge (to the 03:bf ether address).

Since it is a multicast address, it isn't bound to any particular interface. The simplest fix would be to just add filtering rule to block that address leaking back out other interfaces.

#4 lore raw
Quoted 1 line · Stephen Hemminger

Since it is a multicast address, it isn't bound to any particular interface.

Ack. As I expected.

Quoted 2 lines

The simplest fix would be to just add filtering rule to block that address leaking back out other interfaces.

Yep, sounds like a plan, so onto ebtables I go.

Thanks,
Matt