No internet after disabling OpenVPN

Hello everyone!

I have some trouble with my new config/vpn setup: my internet is gone after turning off OpenVPN connection. I cannot ping or access any sites. When pinging from luci, it says ping: bad address 'openwrt.org'. Even after reconnecting to this same VPN config, I get nothing but the same result. The only solution I found for myself is manually reconnect wan interface, which is a little bit time-wasting.

My device and OpenWRT version: Xiaomi Mi Router 3 Pro, OpenWrt 22.03.1
My OpenVPN config:

client
;explicit-exit-notify
proto udp
remote vpn.myserver.com 53
dev tun
auth-user-pass /etc/openvpn/VPN.auth
persist-key
persist-tun
nobind
;block-outside-dns

key-direction 1
remote-cert-tls server
cipher AES-256-CBC
route-method exe
route-delay 0
route 0.0.0.0 0.0.0.0
script-security 2

Thanks for any advice!

Its could be a DNS problem. Try setting it manually to a public server like 1.1.1.1 on a client machine. If that gives you internet, theres your issue.

Unfortunately, that's not an issue. Every single device on my lan gets 1.1.1.1 DNS which is advertised by lan interface by setting 6,1.1.1.1,1.0.0.1:

Even though my wan uses custom DNS servers:

I found this to be very useful, cant see if you followed through with the firewall rules:

1 Like

Nope, still not a solution :frowning:

I can guess, but I think it is because of port 53 on vpn server..

This rewrites the existing default route via the wan interface.
When you stop the openvpn service, the new default route (through the vpn interface) is deleted, but the original one (via the wan interface) is not restored.
Тherefore, you lose access to the Internet, including the public DNS resolvers.

Change that line to

route 0.0.0.0 128.0.0.0
route 128.0.0.0 128.0.0.0

or set a metric for the wan interface.

image

4 Likes

I prefer to perform service network restart, it restores default route.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.