Hi,
I'm looking for a way to select the wan used by a process running on the router.
I know about mwan3 use
or the wrapper, but I come from shorewall and I'm used to the source IP address of the wan I want to use (the loose option is not set).
Example ip rule list
, where wan has 10.0.2.15 and wanb 10.20.30.1:
1501: from 10.0.2.15 lookup 1
1502: from 10.20.30.1 lookup 2
The LARTC example configuration of split access uses the same rules.
Do you know why mwan3 doesn't set up these rules?
Thanks.
P.S. Here's the patch to mwan3 I'm using to implement additional source rules:
--- mwan3.sh 2024-09-23 12:34:46.000000000 +0000
+++ /lib/mwan3/mwan3.sh 2024-10-10 10:35:36.895237021 +0000
@@ -527,7 +527,10 @@
mwan3_delete_iface_rules "$1"
+ network_get_ipaddr wan_addr "${1}"
+
$IP rule add pref $((id+1000)) iif "$2" lookup "$id"
+ $IP rule add pref $((id+1500)) from ${wan_addr} lookup "$id"
$IP rule add pref $((id+2000)) fwmark "$(mwan3_id2mask id MMX_MASK)/$MMX_MASK" lookup "$id"
$IP rule add pref $((id+3000)) fwmark "$(mwan3_id2mask id MMX_MASK)/$MMX_MASK" unreachable
}