Migration from DD-WRT (OpenVPN server)

Hello ROS community!

I have just got my RB2011UiAS-2HnD-IN and start a migration process from DD-WRT, hope that somebody will find time to help me :slight_smile: Thank you in advance.

First of all, what I have now: Server[10.1.0.1/24] has been set up and started, 2 clients(dd-wrt[10.2.0.1/24], win10[have no interest in the subnet]) are successfully connected, but one of them(dd-wrt) is constantly lost a connection with warning: 20170910 11:44:03 I [mikrotik_host] Inactivity timeout (–ping-restart) restarting. Both clients do not specify ping or ping-restart, but I assume that these values can be hardcoded in dd-wrt. First question: How to configure ping/ping-restart on the mikrotik server-side? The second thing which is not pretty straight-forward is client-to-client directive. Does Mikrotik’s OpenVPN have something similar? I guess that I can achieve this with bridging, but not sure. The third question is about routing. My previous OpenVPN Server had in a config:

push "route 10.1.0.0 255.255.255.0"
route 10.2.0.0 255.255.255.0
push "route 10.2.0.0 255.255.255.0"

…to make everyone able to get 10.2.0.0/24 and 10.1.0.0/24 networks and make 10.2.0.0/24 accessible from server side. Is there any way to push routes from RouterOS?

The last question is about client-config-dir. I had a bunch of configs for each client where I specified static IP from OpenVPN pool(10.7.0.0/24) and iroutes where I need to have an access to

root@gw1:/jffs/etc/openvpn/ccd# cat gw2
iroute 10.2.0.0 255.255.255.0
ifconfig-push 10.7.0.2 255.255.255.0
root@gw1:/jffs/etc/openvpn/ccd# cat da2
ifconfig-push 10.7.0.9 255.255.255.0

I found out that static IP can be assigned by specifying Remote Address is Secrets, but how I can replace iroute directive?

[root@gw1] /interface ovpn-server> server print
                     enabled: yes
                        port: 1194
                        mode: ethernet
                     netmask: 24
                     max-mtu: 1500
           keepalive-timeout: disabled
             default-profile: openvpn
                 certificate: server.crt_0
  require-client-certificate: yes
                        auth: sha1,md5
                      cipher: blowfish128,aes128,aes256

[root@gw1] /ppp profile> print
 1   name="openvpn" local-address=10.7.0.1 remote-address=openvpn0 use-mpls=default use-compression=default use-encryption=default only-one=default change-tcp-mss=default use-upnp=default address-list="" on-up="" on-down="" 

[root@gw1] /ip pool> print
 # NAME                                                                                                                                                                                                                     RANGES                         
 0 dhcp                                                                                                                                                                                                                     10.1.0.100-10.1.0.254          
 2 openvpn0                                                                                                                                                                                                                 10.7.0.2-10.7.0.254

windows10 client:

proto tcp-client
remote xxx 1194
dev tap

nobind
persist-key

tls-client
ca ca.crt
cert da2.crt
key da2.key
#ping 10
verb 3
ns-cert-type server
cipher AES-256-CBC
auth SHA1
pull

auth-user-pass auth.cfg

dd-wrt client:

root@gw2:~# cat /tmp/openvpncl/openvpn.conf
ca /tmp/openvpncl/ca.crt
cert /tmp/openvpncl/client.crt
key /tmp/openvpncl/client.key
management 127.0.0.1 16
management-log-cache 100
verb 3
mute 3
syslog
writepid /var/run/openvpncl.pid
client
resolv-retry infinite
nobind
persist-key
persist-tun
script-security 2
dev tap1
proto tcp-client
cipher aes-128-cbc
auth sha1
auth-user-pass /tmp/openvpncl/credentials
remote xxx 1194
comp-lzo no
tun-mtu 1500
mtu-disc yes

Well, one question has an answer:

First question: How to configure ping/ping-restart on the mikrotik server-side?

This can be configured by “Keepalive Timeout” option and server actually pushes ping&ping-restart to each client:

20170910 16:53:22 PUSH: Received control message: 'PUSH_REPLY ping 20 ping-restart 60 route-gateway 10.7.0.1 ifconfig 10.7.0.2 255.255.255.0' 
20170910 16:53:22 OPTIONS IMPORT: timers and/or timeouts modified

Looks like everything is ok, but client constantly was loosing a connection.
Finally, I have disabled “keepalive-timeout” on the ROS side and connection looks stable now.