What's new

OpenVPN Reconnect - Network is unreachable (code=101)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

wpai004

New Around Here
Hi there,

I've setup my Asus RT-AC86U for OpenVPN for my home LAN. When I'm not using the network the router will disconnect from the internet and then reconnect every so often (I assume this is normal).

I have found that when my internet disconnects and reconnects again, my VPN goes down but does not reconnect properly. The public IP for the vpn becomes "unknown". The system log shows the following:

Jan 14 06:41:13 ovpn-client1[14440]: UDP link local: (not bound)
Jan 14 06:41:13 ovpn-client1[14440]: UDP link remote: [AF_INET]185.94.31.100:1200
Jan 14 06:41:13 pppd[7771]: Serial link appears to be disconnected.
Jan 14 06:41:15 ovpn-client1[14440]: write UDP: Network is unreachable (code=101)
Jan 14 06:41:15 ovpn-client1[14440]: Network unreachable, restarting
Jan 14 06:41:15 ovpn-client1[14440]: SIGUSR1[soft,network-unreachable] received, process restarting
Jan 14 06:41:15 ovpn-client1[14440]: Restart pause, 5 second(s)
Jan 14 06:41:19 pppd[7771]: Connection terminated.
Jan 14 06:41:19 pppd[7771]: Modem hangup
Jan 14 06:41:20 ovpn-client1[14440]: WARNING: --ns-cert-type is DEPRECATED. Use --remote-cert-tls instead.
Jan 14 06:41:20 ovpn-client1[14440]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Jan 14 06:41:20 ovpn-client1[14440]: TCP/UDP: Preserving recently used remote address: [AF_INET]185.94.31.100:1200
Jan 14 06:41:20 ovpn-client1[14440]: Socket Buffers: R=[524288->524288] S=[524288->524288]
Jan 14 06:41:20 ovpn-client1[14440]: UDP link local: (not bound)
Jan 14 06:41:20 ovpn-client1[14440]: UDP link remote: [AF_INET]185.94.31.100:1200
Jan 14 06:41:20 ovpn-client1[14440]: write UDP: Network is unreachable (code=101)
Jan 14 06:41:20 ovpn-client1[14440]: Network unreachable, restarting
Jan 14 06:41:20 ovpn-client1[14440]: SIGUSR1[soft,network-unreachable] received, process restarting
Jan 14 06:41:20 ovpn-client1[14440]: Restart pause, 5 second(s)
Jan 14 06:41:25 ovpn-client1[14440]: WARNING: --ns-cert-type is DEPRECATED. Use --remote-cert-tls instead.
Jan 14 06:41:25 ovpn-client1[14440]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Jan 14 06:41:25 ovpn-client1[14440]: TCP/UDP: Preserving recently used remote address: [AF_INET]185.94.31.100:1200
Jan 14 06:41:25 ovpn-client1[14440]: Socket Buffers: R=[524288->524288] S=[524288->524288]
Jan 14 06:41:25 ovpn-client1[14440]: UDP link local: (not bound)
Jan 14 06:41:25 ovpn-client1[14440]: UDP link remote: [AF_INET]185.94.31.100:1200
Jan 14 06:41:25 ovpn-client1[14440]: write UDP: Network is unreachable (code=101)
Jan 14 06:41:25 ovpn-client1[14440]: Network unreachable, restarting
Jan 14 06:41:25 ovpn-client1[14440]: SIGUSR1[soft,network-unreachable] received, process restarting
Jan 14 06:41:25 ovpn-client1[14440]: Restart pause, 5 second(s)

I want the OpenVPN to reconnect without having to "start-stop" the service again.

My settings are as follows:

upload_2019-1-14_18-26-18.png


upload_2019-1-14_18-27-4.png


Any help will be appreciated.

Thanks.
 
Who are you using for your VPN service? As VPN providers have migrated towards the most current OpenVPN the custom settings required to make the service work may be different than previously recommended. I know with PIA I had to make a few changes to you may need to check with support for whomever is providing your VPN.
 
Who are you using for your VPN service? As VPN providers have migrated towards the most current OpenVPN the custom settings required to make the service work may be different than previously recommended. I know with PIA I had to make a few changes to you may need to check with support for whomever is providing your VPN.

Thanks for your reply.

The VPN provider I'm using is vpn.ht.

I have found that when my internet reconnects and the VPN public IP address becomes "unknown", I am able to get it to work if I just toggle the "Service state" from off to on again. I presume there is a script I can run to do this? Would service stop_vpnclient1 and service start_vpnclient1 do the trick?
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top