Switching default gateway issue in multi wan
-
i have 2 separate wan connections from same isp, i use one for p2p, surfing etc and second for voip, when both r connected, the gateway is the same as the isp is the same, wan1 is set to be the default gateway and wan2 default gateway unticked, now suppose if i wanted to switch the connections, make wan2 as default and wan1 as non default, general some1 would first goto wan1 and untick the default gateway and hit save and then goto wan2 routing and tick default gateway but this doesnt seems to work unless the 2 wan connections r from a different isp where the gateway ip would be different so i guess some smart coding is required in such a scenario so as to be able to make wan2 as default.
-
Why would you want to do that if its the same gateway?
Normally just use policy routing to do that.
-
the reason is the isp authenticates based on mac id and userid/pass so even if its 2 connections from same isp, the packages and speeds r different
changing all those complex rules would takes ages compared to flipping the default gateway
-
Well that is a downside of the routing table presently.
Maybe it will improve in later versions will see.For now the trick is that you do not play with the gateways in this case but leave them as autodetected and just flip the assignment.
The default gateway will come from the interface assigned as wan.With some mac address spoofing on them and depending what is wan you will have that be the default gw.
Its a workaround i know but its something better than nothing.
-
wouldnt it be easier to detect the interface on each entry and provide a flip default gateway switch or something like a drop down where some1 could select the interface to make as default gateway and hit save and it would change the default gateway to that
-
Well i did a commit to mpd5 to solve this.
It will behave correctly now by changing gateways in the gateways tab.You need to wait for a snapshot with a changed mpd5 to test.
-
so with this will i be able to untick default gateway in one and then go and tick it in the other or unticking one will automatically make the other the default?
-
bytheway i have another system with just one wan connection so obviously its set as default, now if i go edit it and untick default and save then the default flag goes away but still surfing etc keeps working fine, but if i edit it again and tick default gateway and hit save, then it wont flag it as default no matter how many times u try whereas in system log i see this
php: /system_gateways.php: ROUTING: setting default route to 203.109.65.1