Skip to content

Instantly share code, notes, and snippets.

@AAGaming00
Created December 28, 2022 04:32
Show Gist options
  • Save AAGaming00/af5fd579de51f55f68c0819f2b52fa77 to your computer and use it in GitHub Desktop.
Save AAGaming00/af5fd579de51f55f68c0819f2b52fa77 to your computer and use it in GitHub Desktop.
workaround for openwrt/openwrt#6110
#!/bin/sh
# for some reason DFS swaps disable these which breaks loopback nat
# https://github.com/openwrt/openwrt/issues/6110
# this works around it by checking them every 2 minutes and setting them back if they change
PORT=/sys/devices/virtual/net/br-lan/lower_wlan0
while true
do
hairpin=$(cat $PORT/brport/hairpin_mode)
multicast_to_unicast=$(cat $PORT/brport/multicast_to_unicast)
if [[ "$hairpin" == 0 ]]; then
echo "1" > $PORT/brport/hairpin_mode
fi
if [[ "$multicast_to_unicast" == 0 ]]; then
echo "1" > $PORT/brport/multicast_to_unicast
fi
sleep 120
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment