Problem after disconnecting OpenVPN-client

Hi. I am running both OpenVPN-client, and OpenVPN-server, on the same router. OpenVPN-server uses TCP, so policy in vpn-policy-routing has been configured. All works fine, but till the moment, the client disconnects. It results in messages in log: daemon.err openvpn(custom_config_client)[XXXX]: RESOLVE: Cannot resolve host address: (Try again) At the same time server stops to accept incoming connections, and no messages appear in log. How to reconfigure router to accept incoming connections? I added event in hotplug.d/iface:

if [ "${ACTION}" = "ifdown" ] && (! ip a s tun0 up); then
        sleep 1800 && reboot

Is there more elegant solution?

I have noticed, that after disconnect default route disappears. Restart of network results in accept of incoming connections, but I can not login to router from OpenVPN-tunnel via SSH. Additional restart of firewall results in reject of incoming connections.

Restart of vpn-policy-routing results in accept of incoming connections. It seems, that policy is very sensitive to reconfiguration.

The behavior is VERY STRANGE. I have not managed to make it work. I have tried to restart firewall, network, openvpn, vpn-policy-routing. The result is very bad: filter table in firewall remains the same, OpenVPN-connection is established, but SSH connection to IP of VPN-server does not work.

Router Xiaomi Mi 4C. It is very cheap router, but the operation is VERY UNSTABLE and VERY UNPREDICTABLE.

OK, thank you, but the problem is much deeper. So server stops to work also, that is the main problem. I will try another router, and write here.

1 Like

I have installed Padavan firmware on Xiaomi Router 4C, it works fine. At least now. It works much faster, than OpenWRT. So I will see, how it works.