I do not know why someone has wrotten one script to do what can be made with simply two settings...
(cross-routes check is another question, but in this case one wan are by pppoe)
do not use any script, simply:
REMOVE ALL STATIC ROUTE(S) with 0.0.0.0/0 (generated by script)
set pppoe-out1 default route distance = 10
set dhcp-client (you use this???) default route distance=20
if you use static IP for fastweb, instead of dhcp client (dhcp client for me is preferred),
add default route with dst. address 0.0.0.0/0 , gateway 192.168.78.1 and distance=20
if pppoe go down, it use automatically other connection.
BUT (Script or not) some NAT connection still locked on other gateway until they go on timeout or connection are closed (=VoIP problems)
user can lose some data or experience interruptions.
when pppoe go up again, automatically all go back to normal
BUT the estabilished connections trough NAT do NOT STOP working until they go on timeout or connection are closed.
this prevent the user to lose some data or experience interruptions.
Thank you for your answer.
I deleted the script and I used your tips as simply as workly. Thank you!
In your post you talk about some connections that remain "hanging" on the routes of the fault wan, especially the SIP traffic. Well, I think I've found a way around this problem.
The much hated "SIP ALG" that everyone disables as a first operation, in this case it helped me. I set the "SIP Timeout" to a very low value "02 seconds" and in case of gateway switch every two seconds it drops the previous route, the client will establish a new one on the new gateway.
I tested this setup for a few hours and it seems to work perfectly, without any problems or disturbances during calls
Use my script here, for the same problem, this is valid for all services, not only SIP. Setting low timeout sometime interrupt the call, if the phone voip device are not configured correctly...
Hello,
I’ve found a “problem” when default route changes, the SIP connections keep active with old IP adress and SIP couldn’t registry with the new route.
I’m searching for a solution but I can’t find, so I’ve tried to do this script, but its not workting…
Can someone help-me?
{
/tool fetch url="http://myip.dnsomatic.com/" mode=http dst-path=mypublicip.txt
local newIP [file get mypublicip.txt contents ]
put $newIP
}
:local cIP;
:if ($newIP != $cIP) do={
:put "ip address $cIP changed t…
just add on ppp profile (used by pppoe-out1) on script menu, both on on-up and on-down sections:
/ip fire conn
:foreach idc in=[find where timeout>60 and reply-dst-address~$"local-address"] do={
remove [find where .id=$idc]
}
do not change $"local-address": is one variable automatically filled by pppoe-out1 inside the script, everytime the service go up or down
P.S.: I'm a WISP and on my 4000 CPEs ftp, pptp, tftp and sip alg are everytime active ;)) as I give one public IP to CPE without NAT anywere, except on end user LAN.