Skip to content

Instantly share code, notes, and snippets.

@amanaplan
Created August 22, 2022 08:49
Show Gist options
  • Save amanaplan/043a7b8731a6b3292bccc1699fbdc6b7 to your computer and use it in GitHub Desktop.
Save amanaplan/043a7b8731a6b3292bccc1699fbdc6b7 to your computer and use it in GitHub Desktop.
#!/bin/sh
## 98-vlan8_to_wan2.sh
## A script to add policy-based routing to send VLAN8 to WAN2 on the UDM-Pro
## Includes monitoring to re-add rules in the event of config changes
vlan8_to_wan2_monitor() {
(while :; do
ip rule show | grep 32400 &> /dev/null ||
(ip rule add pref 32400 from all iif br8 lookup 202)
sleep 1
done) &
}
vlan8_to_wan2_monitor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment