Same here: Working perfectly fine (coming from version 380.69_2) and using this approach/rules to redirect traffic to VPN connection.87U with VPN, no problems here.
Bad news for me...
I found another problem. The VPN rules works only if dualwan was disabled. When I enable the dualwan, the VPN rules don't work.
if [ "$TARGET_ROUTE" = "WAN" ]
then
TARGET_LOOKUP="main"
WAN_PRIO=$((WAN_PRIO+1))
RULE_PRIO=$WAN_PRIO
TARGET_NAME="WAN"
else
TARGET_LOOKUP=$VPN_TBL
VPN_PRIO=$((VPN_PRIO+1))
RULE_PRIO=$VPN_PRIO
TARGET_NAME="VPN client "$VPN_UNIT
fi
########################################################################################## Martineau Hack 2 of 10
DESC=$(echo $ENTRY | cut -d ">" -f 1)
#if [ "$TARGET_ROUTE" = "WAN" ]
if [ "$TARGET_ROUTE" = "WAN" ] || [ "$TARGET_ROUTE" = "WAN0" ] || [ "$TARGET_ROUTE" = "WAN1" ]
#################################################################################################################
then
TARGET_LOOKUP="main"
TARGET_NAME="WAN"
########################################################################################## Martineau Hack 2 of 10
# Allow GUI tagging for Dual WAN i.e. if DESC contains 'WAN1' then use it! - since drop down is 'WAN' only :-(
# NOTE: WAN0 entries preferably should precede tagged 'WAN1' entries in the GUI as they will share a single priority
# although they will both ALWAYS have a higher priority than the VPN entries
#if [ "$(nvram get wans_mode) == "lb" )];then # FO (Failover) / FB (Fallback) / LB (Load-Balancing)
#if [ -z "$(nvram get wans_dualwan | grep -io "none")" ];then
if [ "$TARGET_ROUTE" = "WAN1" ] || [ ! -z "$(echo "$DESC" | grep -owi "WAN1" )" ];then
TARGET_LOOKUP="200"
TARGET_NAME="WAN1"
my_logger"Dual-WAN will use WAN1 instead of WAN0 (table main)"
else
if [ "$TARGET_ROUTE" = "WAN0" ];then
TARGET_LOOKUP="100"
fi
fi
#fi
# v382.xx> for Dual WAN etc. uses prio 100,150,200 and 400 :-(
#WAN_PRIO=$((WAN_PRIO+1))
WAN_PRIO=$((WAN_PRIO+OFFSET))
################################################################################################################
RULE_PRIO=$WAN_PRIO
else
TARGET_LOOKUP=$VPN_TBL
########################################################################################## Martineau Hack 3 of 10
# v382.xx> for Dual WAN etc. uses prio 100,150,200 and 400 :-(
#VPN_PRIO=$((VPN_PRIO+1))
VPN_PRIO=$((VPN_PRIO+OFFSET))
################################################################################################################
RULE_PRIO=$VPN_PRIO
TARGET_NAME="VPN client "$VPN_UNIT
fi
START_PRIO=$((10000+(200*($VPN_UNIT-1))))
END_PRIO=$(($START_PRIO+199))
WAN_PRIO=$START_PRIO
VPN_PRIO=$(($START_PRIO+100))
########################################################################################## Martineau Hack 9 of 10
# v382.xx> for Dual WAN etc. uses prio 100,150,200 and 400? :-(
FIRMWARE=$(echo $(nvram get buildno) | awk 'BEGIN { FS = "." } {printf("%03d%02d",$1,$2)}')
if [ -z "$(ip rule | grep -Eo -m 1 "^[1|2|4]00:")" ];then
START_PRIO=$((10000+(200*($VPN_UNIT-1))))
END_PRIO=$(($START_PRIO+199))
VPN_PRIO=$(($START_PRIO+100))
OFFSET=1
else
START_PRIO=$VPN_UNIT"0" # Limit the VPN Clients to a single rule prio
END_PRIO=$(($START_PRIO+9))
VPN_PRIO=$(($START_PRIO+5))
OFFSET=0 # Limit the VPN Clients to a single (multiple) rule prio 10,15 and 20,25 etc.
fi
WAN_PRIO=$START_PRIO
#VPN_PRIO=$(($START_PRIO+100))
################################################################################################################
Thanks Mr Martineau, but I'm very sorry to ask another question.
How to patch?
I'm connect by ssh, but it's read-only system, and on https://github.com/RMerl/asuswrt-merlin/wiki/Custom-config-files I can't see vpnrouting.sh able to modify.
cp /usr/sbin/vpnrouting.sh /jffs/scripts/vpnrouting.sh
chmod +x /jffs/scripts/vpnrouting.sh
mount -o bind /jffs/scripts/vpnrouting.sh /usr/sbin/vpnrouting.sh
df
ip rule
umount /usr/sbin/vpnrouting.sh
UseHow does one make the mount -o bind permanent?
init-start
if [ -f /jffs/scripts/vpnrouting.sh ]; then
logger -st "init-start" "Custom Patching '/usr/sbin/vpnrouting.sh'"
mount -o bind /jffs/scripts/vpnrouting.sh /usr/sbin/vpnrouting.sh
fi
I just got this thing and apparently you're the man for everything I need to doUseinit-start
Code:if [ -f /jffs/scripts/vpnrouting.sh ]; then logger -st "init-start" "Custom Patching '/usr/sbin/vpnrouting.sh'" mount -o bind /jffs/scripts/vpnrouting.sh /usr/sbin/vpnrouting.sh fi
Sorry it's been a long day...., not 100% sure I follow your issue?I have to use the local wan0 in my openvpn profile, but it stops working if secondary WAN goes down in LB mode. I have to remove the local wan0 line for it to come up with a single WAN. Any solution?
wan0
to still be valid, clearly Secondary LB WAN wan1
wouldn't ?There are many posts regarding the reliability of flash drives. Personally I have had random failures - irrespective of price (cheap/expensive) or brand - regardless of where they were used.On an unrelated note: My router locked up the other day, and upon reboot my flash thumb drive was dead. Unreadable/unformattable on any device. Bad luck or is there a known issue?
Sorry it's been a long day...., not 100% sure I follow your issue?
If Secondary LB WAN goes DOWN, I would expect the Primary LB WANwan0
to still be valid, clearly Secondary LB WANwan1
wouldn't ?
There are many posts regarding the reliability of flash drives. Personally I have had random failures - irrespective of price (cheap/expensive) or brand - regardless of where they were used.
However, I've only ever had one that actually died on the router.. IIRC a metal cased HP 4GB drive, but they used to get very hot, so I now try to use a short USB extender to create a thermal air-gap.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!