Enabling bridge hairpin mode

I have an Askey RT4230W running OpenWRT 22.03.2. I'm using it as more or less a "dumb" AP (no routing), but multiple VLANs going to multiple SSIDs.

I had a problem where a client on 5 GHz couldn't talk to a client on 2.4 GHz on the same SSID. I was able to fix it by running:

/bin/echo 1 > /sys/devices/virtual/net/br-vlan102/lower_us5g/brport/hairpin_mode
/bin/echo 1 > /sys/devices/virtual/net/br-vlan102/lower_us2g/brport/hairpin_mode

I added that to rc.local and thought I was done. A power outage proved me wrong, presumably rc.local runs before the bridge is up.

What's the correct place to set hairpin_mode? Thanks.

What about a hotplug script in /etc/hotplug.d/iface?

1 Like

Sorry, took me a while to get to this. I created /etc/hotplug.d/iface/91-hairpin and put the following inside:

/bin/echo 1 > /sys/devices/virtual/net/br-vlan102/lower_us5g/brport/hairpin_mode
/bin/echo 1 > /sys/devices/virtual/net/br-vlan102/lower_us2g/brport/hairpin_mode

After a reboot,

cat /sys/devices/virtual/net/br-vlan102/lower_us5g/brport/hairpin_mode

still shows 0. Oddly,

cat /sys/devices/virtual/net/br-vlan102/lower_us2g/brport/hairpin_mode

shows 1, but I'm not sure where it's getting set. Any other suggestions? Thanks.

You'll need to put a conditional expression around these lines and check the value of the DEVICE or INTERFACE parameter passed in before calling these two lines