What's new

ASUS WAN Setup - Dual or other config

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

nucleartrousers

Occasional Visitor
Hi,
Here's my scenario:

My kit is an ASUS RT-AC5300 running Merlin 384.6 firmware with a second AC5300 working as a hard wired AP.

I have terrible UPLOAD on my home broadband. I mean TERRIBLE. It is on average 0.4Mbps! My download on home broadband is 12-18Mbps. I've spoken to everyone and tried everything, without a leased line this is what I have.

I also have a 4G router that gives me 4-16Mbps DOWNLOAD and 8-18Mbps UPLOAD most of the time (when the weather is good and the local mobile network isn't particularly busy).

I have configured my AC5300 for dual WAN. The PRIMARY is to my home broadband and anything that doesn't really need to UPLOAD I want to use this primary WAN.

My mobile carrier (EE) signal is non existent in the house too and so we HAVE to use WiFi calling which uses our Internet connection to give us a phone signal. Of course, the home broadband at 0.4Mbps is simply unusable for this purpose, especially if more than 1 person / device is trying to UPLOAD 'stuff'.

So I need to route all of the mobile phones that come into the house out of the router's SECONDARY WAN, the 4G.

I see that with dual WAN enabled I can enable routing rules but this requires that I enter the IP for every single device I need to route and if I don't then the devices that aren't governed by routing rules are load balanced at a ratio of 9:1 PRIMARY to SECONDARY WAN. I set this ratio as ideally I don't want anything load balancing but the option is this or failover. I don't want failover so I set the ratio to use the PRIMARY WAN as much as I can.

So, my question is... is this the best configuration for what I want to do?

Of course, I can setup a different WiFi SSID on the 4G router but then my main network facilities like printing, monitoring and security aren't being used and frankly it's a pain having to swap networks when we want to print something, use the phone, etc.

Ideally I'd setup a routing rule to say that a set IP range, say 192.168.0.2 to 192.168.0.20 all goes out of the SECONDARY WAN and another range,say 192.168.0.21 to 192.168.0.254 all goes out of the PRIMARY WAN. Then set all of the hones to use an IP in the first range... this still doesn't get around the fact that new phones have to be setup in the router before they will work which is again a nuisance.

I just want UPLOAD intensive devices to use the SECONDARY WAN for their Internet and DOWNLOAD intensive devices to use the PRIMARY WAN for their Internet.

I thought about routing based upon the whole subnet (192.168.0.0) with destination 'all' using the primary WAN and then putting specific exceptions in the routing rules for each device I want to use the SECONDARY WAN but that doesn't seem to work... and it's a pain when new devices come onto the network and I'm not available to set them up correctly in the router.

I also thought about setting the routing rules based upon destination but as that is subject to change by the carrier it's not too practical.

Any advice would be greatly appreciated :)
 
Hi,
Here's my scenario:

My kit is an ASUS RT-AC5300 running Merlin 384.6 firmware with a second AC5300 working as a hard wired AP.

I have terrible UPLOAD on my home broadband. I mean TERRIBLE. It is on average 0.4Mbps! My download on home broadband is 12-18Mbps. I've spoken to everyone and tried everything, without a leased line this is what I have.

I also have a 4G router that gives me 4-16Mbps DOWNLOAD and 8-18Mbps UPLOAD most of the time (when the weather is good and the local mobile network isn't particularly busy).

I have configured my AC5300 for dual WAN. The PRIMARY is to my home broadband and anything that doesn't really need to UPLOAD I want to use this primary WAN.

My mobile carrier (EE) signal is non existent in the house too and so we HAVE to use WiFi calling which uses our Internet connection to give us a phone signal. Of course, the home broadband at 0.4Mbps is simply unusable for this purpose, especially if more than 1 person / device is trying to UPLOAD 'stuff'.

So I need to route all of the mobile phones that come into the house out of the router's SECONDARY WAN, the 4G.

I see that with dual WAN enabled I can enable routing rules but this requires that I enter the IP for every single device I need to route and if I don't then the devices that aren't governed by routing rules are load balanced at a ratio of 9:1 PRIMARY to SECONDARY WAN. I set this ratio as ideally I don't want anything load balancing but the option is this or failover. I don't want failover so I set the ratio to use the PRIMARY WAN as much as I can.

So, my question is... is this the best configuration for what I want to do?

Of course, I can setup a different WiFi SSID on the 4G router but then my main network facilities like printing, monitoring and security aren't being used and frankly it's a pain having to swap networks when we want to print something, use the phone, etc.

Ideally I'd setup a routing rule to say that a set IP range, say 192.168.0.2 to 192.168.0.20 all goes out of the SECONDARY WAN and another range,say 192.168.0.21 to 192.168.0.254 all goes out of the PRIMARY WAN. Then set all of the hones to use an IP in the first range... this still doesn't get around the fact that new phones have to be setup in the router before they will work which is again a nuisance.

I just want UPLOAD intensive devices to use the SECONDARY WAN for their Internet and DOWNLOAD intensive devices to use the PRIMARY WAN for their Internet.

I thought about routing based upon the whole subnet (192.168.0.0) with destination 'all' using the primary WAN and then putting specific exceptions in the routing rules for each device I want to use the SECONDARY WAN but that doesn't seem to work... and it's a pain when new devices come onto the network and I'm not available to set them up correctly in the router.

I also thought about setting the routing rules based upon destination but as that is subject to change by the carrier it's not too practical.

Any advice would be greatly appreciated :)

Try adding the following RPDB rules....

Code:
#!/bin/sh

Say(){
   echo -e $$ $@ | logger -st "($(basename $0))"
}

# For UPLOAD (phone) clients 192.168.0.2-192.168.0.20 you can copy'n'paste the following commands

# ip rule add from 192.168.0.2/31  lookup 200 prio 102
# ip rule add from 192.168.0.4/30  lookup 200 prio 102
# ip rule add from 192.168.0.8/29  lookup 200 prio 102
# ip rule add from 192.168.0.16/30 lookup 200 prio 102
# ip rule add from 192.168.0.20/32 lookup 200 prio 102

# For DOWNLOAD clients 192.168.0.21-192.168.0.254 you can copy'n'paste the following commands

# ip rule add from 192.168.0.21/32  lookup 100 prio 101
# ip rule add from 192.168.0.22/31  lookup 100 prio 101
# ip rule add from 192.168.0.24/29  lookup 100 prio 101
# ip rule add from 192.168.0.32/27  lookup 100 prio 101
# ip rule add from 192.168.0.64/26  lookup 100 prio 101
# ip rule add from 192.168.0.128/26 lookup 100 prio 101
# ip rule add from 192.168.0.192/27 lookup 100 prio 101
# ip rule add from 192.168.0.224/28 lookup 100 prio 101
# ip rule add from 192.168.0.240/29 lookup 100 prio 101
# ip rule add from 192.168.0.248/30 lookup 100 prio 101
# ip rule add from 192.168.0.252/31 lookup 100 prio 101
# ip rule add from 192.168.0.254/32 lookup 100 prio 101

# but a little script is less tedious ;-)

LAN_PREFIX="192.168.0"

DOWNLOAD=".21/32 .22/31 .24/29 .32/27 .64/26 .128/26 .192/27 .224/28 .240/29 .248/30 .252/31 .254/32"

for ITEM in $DOWNLOAD
    do
        ip rule del from ${LAN_PREFIX}$ITEM lookup 100 prio 101 2>/dev/null
        ip rule add from ${LAN_PREFIX}$ITEM lookup 100 prio 101
        Say "Download:"${LAN_PREFIX}$ITEM "will be routed via Primary WAN0 (100)"
    done

UPLOAD=".2/31 .4/30 .8/29 .16/30 .20/32"

for ITEM in $UPLOAD
    do
        ip rule del from ${LAN_PREFIX}$ITEM lookup 200 prio 102 2>/dev/null
        ip rule add from ${LAN_PREFIX}$ITEM lookup 200 prio 102
        Say "Upload:"${LAN_PREFIX}$ITEM "will be routed via Secondary WAN1 (200)"
    done
 
ip route flush cache

ip rule

exit 0

EDIT: Use prio 101 and 102 to retain/honour any Dual-WAN GUI Selective routing entries (prio 100) as higher priority.
 
Last edited:
Thanks so much for posting this Martineau.

I've not run script or direct commands against my router before.Is this via ssh, something like putty.exe or another way? Do I have to copy this into a .sh file or something?
 
I've not run script or direct commands against my router before.

Is this via ssh, something like putty.exe or another way?

Do I have to copy this into a .sh file or something?

So you can either copy'n'paste the commands individually into the command line for testing, but to have the rules applied automatically then you will need to use scripting.

If you use windows, then I recommend using WinSCP as the editor to create the script...see Mini WinSCP tutorial and use an appropriate name for this script, although the Wiki has examples where you need to manually SSH into the router (using either Xshell or MobaXterm although basic PuTTY will suffice) and use either of the router's editors - vi or nano, and also remember to mark the script as executable.
 
Last edited:
Thanks Martineau, I've created the script using WinSCP and it does what I wanted like a charm! When I execute the command 'ip rule' it shows the IP's using the correct WAN so big YAY there!

However, the routing rules don't persist past reboot :(

- I've created the file using WinSCP and using your mini tutorial, so the format should be good
- I've saved the script file in /jffs/scripts/ and marked it as executable
- It's not got a file extension e.g .sh (although I did try with and without the .sh extension)
- 'Enable JFFS custom scripts and config' is enabled in Administration-System

It works if I open WinSCP and execute the file directly but that's not very efficient when I've not always got the laptop on.
 
Thanks Martineau, I've created the script using WinSCP and it does what I wanted like a charm! When I execute the command 'ip rule' it shows the IP's using the correct WAN so big YAY there!

However, the routing rules don't persist past reboot :(

- I've created the file using WinSCP and using your mini tutorial, so the format should be good
- I've saved the script file in /jffs/scripts/ and marked it as executable
- It's not got a file extension e.g .sh (although I did try with and without the .sh extension)
- 'Enable JFFS custom scripts and config' is enabled in Administration-System

It works if I open WinSCP and execute the file directly but that's not very efficient when I've not always got the laptop on.

What are we talking about? ....wait!...it's slowly all coming back to me... :p:p:p

What name have you given your script?

I recommend that you always use the '.sh' suffix for your custom scripts, to avoid potential conflicts with the reserved system scripts. So, as per the RMerlin Wiki, unless your script name accidentally matches one of the system scripts, it will not be executed automatically during the boot sequence.
Consequently you will need to create/modify one of the auto-execute system scripts, and include the call to execute your custom script from it:

e.g. /jffs/scripts/nat-start
Code:
#!/bin/sh

sh /jffs/scripts/your_script.sh
 
Last edited:

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top