1

I have two different VPN connections on a server as below:

  1. The first connection from a mikrotik server (192.168.100.128 as the client) to the main server (192.168.100.99 as the host with ppp0).

  2. The second connection from the local Mikrotik (192.168.100.129 as the client) to main server (192.168.100.99 as the host with ppp1) .

We have set the routes for each of these VPN connections as below:

192.168.100.128 dev ppp0 proto kernel scope link src 192.168.100.99
192.168.100.129 dev ppp1 proto kernel scope link src 192.168.100.99

The problem is when the main server switches off for any reason and disconnects from the both connections at a same time and re-establishes the connections, as ppp0 and ppp1 will be set by the main server itself, it is possible that it sets ppp0 and ppp1 shifted and certainly there will be big problems on that situation and we have to set the right names manually.

What is the solution for this to force the main server to set ppp0 and ppp1 for the specified VPN connections?

configuration:

xl2tp.conf:

[global]
listen-addr = 185.120.220.67
ipsec saref = yes
[lns default]
ip range = 192.168.100.128-192.168.100.129
local ip = 192.168.100.99
require chap = yes
refuse pap = yes
require authentication = yes
name = LinuxVPNserver
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes

etc/ppp/option.xl2tpd:

ipcp-accept-local
ipcp-accept-remote
require-mschap-v2
ms-dns  8.8.8.8
ms-dns  4.2.2.4
noccp
auth
crtscts
idle 1800
mtu 1410
mru 1410
nodefaultroute
debug
lock
proxyarp
connect-delay 5000

l2tp_psk.conf:

conn L2TP-PSK-NAT
     rightsubnet=vhost:%priv
     also=L2TP-PSK-noNAT
conn L2TP-PSK-noNAT
     authby=secret
     pfs=no
     auto=add
     keyingtries=3
     dpddelay=30
     dpdtimeout=120
     dpdaction=clear
     rekey=no
     ikelifetime=8h
     keylife=1h
     type=transport
     left=185.120.220.67
     leftprotoport=17/1701
     right=%any
     rightprotoport=17/%any
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
kia
  • 11
  • 2
  • These routes should come up correct regardless of which client reconnects first and gets `ppp0`. Is this causing a problem somewhere else? Please describe the actual problem. – Michael Hampton Jul 29 '20 at 13:43

0 Answers0