Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
20.1 Legacy Series
»
Automate restart of WAN interface
« previous
next »
Print
Pages: [
1
]
Author
Topic: Automate restart of WAN interface (Read 8635 times)
dilby
Newbie
Posts: 8
Karma: 0
Automate restart of WAN interface
«
on:
March 10, 2020, 08:10:25 pm »
Hi,
I have a script that pings multiple addresses, and if all fails attempts to bring down then up the WAN interface using :
ifconfig vtnet1 down
delay(20)
ifconfig vtnet1 up
Whilst the internet is fully functioning, using the above two commands seems to work ok.
However, there has been an instance where the internet dropped and the above commands didn't work, but I am able to go into Interface->[WAN]->Untick Enable Interface->Apply, Then re-tick, then apply.
I'm just wondering is different in the process of using ifconfig vs. the Web UI.
Thanks Dilby.
Logged
dilby
Newbie
Posts: 8
Karma: 0
Re: Automate restart of WAN interface
«
Reply #1 on:
March 10, 2020, 10:08:43 pm »
I've replaced both ifconfig lines with :
Code:
[Select]
/usr/local/etc/rc.configure_interface wan
This is called by one of the predefined cron jobs called "Periodic interface reset" which I assume does what it says. I'll see if that works the next time there is an issue.
Logged
ark
Newbie
Posts: 10
Karma: 0
Re: Automate restart of WAN interface
«
Reply #2 on:
October 19, 2020, 10:26:15 pm »
sorry to ressurect this thread, can you share the scripts? because I have similar problem with wan interfaces that need restart every week due to subnet changes, thank you.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
20.1 Legacy Series
»
Automate restart of WAN interface