I have a lan-to-lan via PPTP setup on two CCR1009 running RouterOS 6.31. One of the CCR1009 is managed by me and the other one by another company.
I created some routes on IP | Routes to connect to the remote LAN and everything works fine. The problem is when the PPTP connection restarts the Gateway become unreachable and have to go to IP | Routes, open each of this routes and put the Gateway back to the PPTP interface.
Is there a way for the router dont loose the configuration each time the connection goes down?
First thing I would ask myself is why is the PPTP restarting?
Do these CCRs have latest firmware (3.27 as of this time)? I’d also keep both un the latest bugfix-only release, 6.32.3 right now:
What’s new in 6.32.3 (2015-Oct-19 11:13):
*) ppp, pptp, l2tp, pppoe: fixed router dead locked if compression was enabled on link;
*) pptp,l 2tp, sstp, pppoe: do not send data packets before we have negotiated connection with other
side (happens on dial-on-demand interfaces), this brakes when connecting to other party servers;
*) pptp, l2tp, sstp - make it work when add-default-route & dial-on-demand both are enabled;
*) pptp, l2tp, sstp, pppoe clients - fixed problem where they failed to connect
at startup and only reboot helped;
Don’t you get the same IP for the PPTP each time it reconnects?
An /ip print and /ip route print will help.
You could also set the PPTP interface directly as gateway when setting the routes, as it’s a point to point link…
The PPTP restarts every time we have an internet outage or if we have a power outage and the UPS dosen’t work. The connection is initiated by the other router, which is not managed by me, so the PPTP interface is dynamic.
On the routes I’ve setup as gateway the PPTP interface. Here’s the /ip route export
Go into PPP > Secrets and edit the account for the remote site, and there is a field “Routes”
Add the remote LAN to this, e.g. 192.168.12.0/24 and this route will be created each time the account authenticates.
(I’d first try specifying multiple routes in that route field, but if that fails, do this:)
Give the remote site a static remote IP address, and then create 4 static routes whose next hop is that static IP.
So if you set remote-address=192.168.255.254 (or whatever) in the secret, create as many static routes as you like, but with that IP as the next hop. You could even create a black hole route for 192.168.255.254/32 with a distance of 254 so that whenever the VPN is down, the remote networks are also routed to the black hole and not out your Internet connection.
Or - if the remote networks are all part of a contiguous supernet, route that supernet:
192.168.4.0/22 = 192.168.4.0 - 192.168.7.255
Or if you’re really feeling froggy, enable OSPF on the VPN.
EDIT: I’ve tested this in my lab, and you can specify multiple routes in the PPP secret - just put them in separated by commas. e.g.: 192.168.10.0/24,192.168.55.0/24,172.16.0.0/16
This is what I’ve done: on secrets I assigned a static IP to the user in the Remote Address field, then on IP | Routes for each route I created before I set the Gateway with the IP I assigned on the secret.
The problem was that in the secret I had no static IP, and in Profile I was using a VPN_Pool of address in Remote Address . I was complicating a simple question