Since updating firmware the router will not establish a successful VPN connection. When rebooting we have no internet access.
Workaround: Disable, save, then enable save the Wireguard VPN on the VPN menu. This brings the internet alive and allows for correct routing.
Observations:
The connection on the Mobile ISP takes longer on the new version and I wonder if the VPN is trying to connect before the ISP is ready.
Is there a way to put a time delay or write a custom script to do the VPN off/on automatically at every reboot (and all the back ground policy writing that goes with switching that switch)
I have downgraded to the previous version and although connection to the VPN can take 5 min it seems to retry for a period so allowing the mobile connection to come up.
I have tried resetting to factory defaults on new firmware but this made no difference.
This happened to me in a previous version and I believe the developers had to write something for the delay or retry?
Line commented out, connect to the internet now but routing does not allow it through the VPN or into the internet. Pinging any address outside (numerical) brings no reply, and pinging FQDN brings no DNS.
I think another command is needed to do something.
Your Allowed IPs list seems incorrect, if you want to send all traffic through the wg tunnel it should be: 0.0.0.0/1 + 128.0.0.0/1 + ::/0
Then of course there is a catch there must be an exception for the traffic to the wg server at the other end this one must go directly through the mobile or wan interface. One way to achieve that is to play with the metrics, set the metric of the wg interface (in Advanced Settings) to 3 and create a stactic route to the wg server via the mob1s?a1 interface with a lower metric. 2 will do.
There is no need to specify a gateway for this route.
Good. The type is effectively Unicast.
I would like to know if it still works if the commented line in the script is put back in use. Could you try that at least once (with a reboot of course) and report the result ?
The VPN stayed up all through the night and with a reboot this morning, I could see the script working to have a second go at connection - the CPU bar increased and then the internet connected, so clearly something that TELTONIKA need to look at putting in as standard. Furthermore the static route is also working nicely- why can’t that be written when the VPN is entered by the user!
I have now removed the # from the first post advice from @flebourse and all is well so for anyone needing this post in the future the answers are even simpler.
A. Go to your router web console
B. Go into the Wireguard settings you have already created and choose advanced settings, enter a Metric number (3???) Take note of this number as you will need it for further stages.
C. Save and apply
D. Find static routes:
E. Add a static route where the Interface is your normal internet traffic - WAN or the Mobile sim slot
F. Enter the Target as the VPN endpoint address
G. Choose metric as lower than the VPN metric (2??)
H. MTU as 1400
I. Ignore all other fields except the last one and choose Unicast.
Now go into the CLI
PUTTY or SSH into the router - remember username is root and not admin but password is your admin password
type vi /etc/crontabs/root
user arrow keys to get to the bottom of the text
Press i and then insert
* * * * * * /usr/bin/wireguard_watchdog
press Escape :wq! [enter]
Reboot the router and be patient.
Some things you might see happen.
The router will come back on line and you can get into it but it could take 3-4 mins after you are in for internet to reconnect based on the script calling for reconnection after the router is fully up and running.
The CPU bar on the router may climb as the script is running and then you may see your connection restored.
I use DNS Leak Test to see what my IP is before and after connection.
Hi, this discussion has already been very helpful. Thank you very much.
However, I have the problem that the Wireguard connection is not established after a restart where the power was completely lost. KeepAlive is set to 25. When I manually deactivate and reactivate the VPN in the interface, a connection is established.
Does anyone have an idea of what can be done so that the connection can be reliably re-established after a restart, IP change or start after a power failure?
5.2 KiB sent … Sure, but where ?
At the moment the simplest is to add a route and change the metrics as described above.
There is a cleaner solution you can look at it here it works for me but the other user is still struggling with it. If you want to give it a try …