I'm trying to make ASUSwrt-merlin's dual WAN setup work in a specific way, and I'm not sure if I even can.
ASUS router with dual wan turned on in active. LAN side is 192.168.30.1/24
WAN 1 goes to a cable modem. The cable modem is in bridge mode and assigns a public IPv4 address to WAN1. It's configuration/status page is also reachable at 192.168.100.1
WAN 2 goes to a 4G modem. This modem is in bridge mode and assigns a public IPv4 address to WAN2. It's configuration/status page is also reachable at 192.168.5.1
When WAN1 is up:
I want traffic leaving the router, from any LAN client, to public IPs exit via WAN1.
I want traffic destined for 192.168.100.1 to exit via WAN1.
I want traffic destined for 192.168.5.1 to exit via WAN2.
I expect inbound request from WAN1 to match the NAT rules and pass through to LAN IPs as appropriate.
I want inbound requests from WAN2 to be dropped.
When WAN1 is down:
I want traffic leaving the router, from specific LAN clients, to public IPs exit via WAN2.
I want traffic leaving the router, from all other LAN clients, to public IPs to be dropped.
I want traffic destined for 192.168.100.1 to exit via WAN1.
I want traffic destined for 192.168.5.1 to exit via WAN2.
I expect inbound request from WAN2 to match the NAT rules and pass through to LAN IPs as appropriate.
To determine If WAN1 is up/down, I don't want to use the built in "ping some IP" check, but rather use a script to periodically connect to http://192.168.100.1 and parse the response.
I think what I need is a script that does the up/down check via cron, and based on the results swaps between 2 different iptables and interface route definitions. As I try to build this out, the issue I think I am running into is an issue with the default WAN management functionality fighting me. Has anyone gotten something like what I describe above working; and if so, can you share your set up?
ASUS router with dual wan turned on in active. LAN side is 192.168.30.1/24
WAN 1 goes to a cable modem. The cable modem is in bridge mode and assigns a public IPv4 address to WAN1. It's configuration/status page is also reachable at 192.168.100.1
WAN 2 goes to a 4G modem. This modem is in bridge mode and assigns a public IPv4 address to WAN2. It's configuration/status page is also reachable at 192.168.5.1
When WAN1 is up:
I want traffic leaving the router, from any LAN client, to public IPs exit via WAN1.
I want traffic destined for 192.168.100.1 to exit via WAN1.
I want traffic destined for 192.168.5.1 to exit via WAN2.
I expect inbound request from WAN1 to match the NAT rules and pass through to LAN IPs as appropriate.
I want inbound requests from WAN2 to be dropped.
When WAN1 is down:
I want traffic leaving the router, from specific LAN clients, to public IPs exit via WAN2.
I want traffic leaving the router, from all other LAN clients, to public IPs to be dropped.
I want traffic destined for 192.168.100.1 to exit via WAN1.
I want traffic destined for 192.168.5.1 to exit via WAN2.
I expect inbound request from WAN2 to match the NAT rules and pass through to LAN IPs as appropriate.
To determine If WAN1 is up/down, I don't want to use the built in "ping some IP" check, but rather use a script to periodically connect to http://192.168.100.1 and parse the response.
I think what I need is a script that does the up/down check via cron, and based on the results swaps between 2 different iptables and interface route definitions. As I try to build this out, the issue I think I am running into is an issue with the default WAN management functionality fighting me. Has anyone gotten something like what I describe above working; and if so, can you share your set up?