[MT] OpenVPN Server and static route gateway issue
Posted: Wed Mar 11, 2020 9:24 pm
Hello,
I have MT at home with OpenVPN server configured onto it. There's an OpenVPN client, on a different location, dialling in to the home OpenVPN server.
Home subnet is 192.168.1.0/24 (MT lan ip is 192.168.1.1)
OpenVPN server ip address is: 10.0.2.5
Remote subnet is: 192.168.144.0/24
Remote OpenVPN client ip address is: 10.0.5.10 (dynamically assigned once the openvpn link is established).
I want to configure a static route for accessing the remote subnet (192.168.144.0/24) from home subnet (192.168.1.0/24).
As I read in wiki, OpenVPN server implementation in MT does not support configuring static routes on the ovpn server itself ?
So, I tried setting a static route on MT ...
I've configured the OpenVPN client with a static route for reaching home subnet (192.168.1.0/24).
Everything works as expected, the only problem is ... once the OpenVPN link drops, then the static route from MT side is going inactive (which is expected).
However, when ovpn link is back, the static route is still unable to reach the gateway=<ovpn-client>, even though the interface is up.
So, to overcome the problem I have to edit static route and manually select <ovpn-client> as the gateway, each time the ovpn tunnel drops and comes back.
Is there a better way to handle this ? possibly with a script ?
Thanks,
Yannis
I have MT at home with OpenVPN server configured onto it. There's an OpenVPN client, on a different location, dialling in to the home OpenVPN server.
Home subnet is 192.168.1.0/24 (MT lan ip is 192.168.1.1)
OpenVPN server ip address is: 10.0.2.5
Remote subnet is: 192.168.144.0/24
Remote OpenVPN client ip address is: 10.0.5.10 (dynamically assigned once the openvpn link is established).
I want to configure a static route for accessing the remote subnet (192.168.144.0/24) from home subnet (192.168.1.0/24).
As I read in wiki, OpenVPN server implementation in MT does not support configuring static routes on the ovpn server itself ?
So, I tried setting a static route on MT ...
/ip route add dst-address=192.168.144.0/24 gateway=<ovpn-client> gateway-status=<ovpn-client> check-gateway=ping distance=1
I've configured the OpenVPN client with a static route for reaching home subnet (192.168.1.0/24).
Everything works as expected, the only problem is ... once the OpenVPN link drops, then the static route from MT side is going inactive (which is expected).
However, when ovpn link is back, the static route is still unable to reach the gateway=<ovpn-client>, even though the interface is up.
So, to overcome the problem I have to edit static route and manually select <ovpn-client> as the gateway, each time the ovpn tunnel drops and comes back.
Is there a better way to handle this ? possibly with a script ?
Thanks,
Yannis