Answer the question
In order to leave comments, you need to log in
How to set up persistent reverse routing using ip route?
- There is a VPN server 192.168.42.1
- VPN clients (mikrotik branches) have static IPs 192.168.42.0/24
- An application is running behind the VPN server that requires reverse routing, i.e. obtaining access to the client's local network.
But, since the clients may not be permanent (the connection fell off, the Internet ended, Baba Zina washed the floor, etc.), the route may fall off after the clients disconnect, and, after a reverse connection, the routes are not restored, you have to manually restart write ip route add 192.168.3.0/24 via 192.168.42.2
How can I set up a permanent route for these clients so that routes are saved or restored after reconnection?
Answer the question
In order to leave comments, you need to log in
On the vpn server, in the /etc/ppp/if-up and /etc/ppp/if-down scripts, add / remove routes, depending on the client. man ppp
Looks like it's a job for dynamic routing. Set up ospf on mikrotik and vpn server (quagga, bird).
root if route | grep -q 10.11.12.0 ; then:; else if ping -qW1 -c1 172.18.203.139 >/dev/null; then route add -net 10.11.12.0 netmask 255.255.255.0 gw 172.18.203.139; fi; fi in crown
On an iota, the connection constantly fell off ..
#!/bin/bash
&& route add -net 192.168.50.0 netmask 255.255.255.0 gw 192.168.50.225 dev ppp0 && echo "reUP!"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question