Difference between revisions of "Mikrotik: OpenVPN - Server ke PC dari wiki mikrotik"

From OnnoWiki
Jump to navigation Jump to search
Line 16: Line 16:
  
  
==Client==
+
==Client Mikrotik==
  
 
  /interface ovpn-client
 
  /interface ovpn-client
Line 24: Line 24:
 
   add dst-address=192.168.55.0/24 gateway=ovpn-client1
 
   add dst-address=192.168.55.0/24 gateway=ovpn-client1
 
  /ip firewall nat add chain=srcnat action=masquerade out-interface=ovpn-client1
 
  /ip firewall nat add chain=srcnat action=masquerade out-interface=ovpn-client1
 +
 +
 +
 +
==Client Linux==
 +
 +
dev tun
 +
proto tcp-client
 +
remote 2.2.2.2 1194
 +
tls-client
 +
user nobody
 +
group nogroup
 +
#comp-lzo # Do not use compression.
 +
# More reliable detection when a system loses its connection.
 +
ping 15
 +
ping-restart 45
 +
ping-timer-rem
 +
persist-tun
 +
persist-key
 +
mute-replay-warnings
 +
verb 3
 +
cipher BF-CBC
 +
auth SHA1
 +
pull
 +
auth-user-pass auth.cfg
 +
  
  

Revision as of 12:21, 29 December 2022

Sumber: https://wiki.mikrotik.com/wiki/Manual:Interface/OVPN

Ipsec-road-warrior (1).png


Server

/ip pool add name=ovpn-pool range=192.168.77.2-192.168.77.254

/ppp profile add name=ovpn local-address=192.168.77.1 remote-address=ovpn-pool
/ppp secret
  add name=client1 password=123 profile=ovpn
  add name=client2 password=234 profile=ovpn
/interface ovpn-server server set enabled=yes certificate=server


Client Mikrotik

/interface ovpn-client
  add name=ovpn-client1 connect-to=2.2.2.2 user=client1 password=123 disabled=no
/ip route 
  add dst-address=10.5.8.20 gateway=ovpn-client1
  add dst-address=192.168.55.0/24 gateway=ovpn-client1
/ip firewall nat add chain=srcnat action=masquerade out-interface=ovpn-client1


Client Linux

dev tun
proto tcp-client
remote 2.2.2.2 1194
tls-client
user nobody
group nogroup
#comp-lzo # Do not use compression.
# More reliable detection when a system loses its connection.
ping 15
ping-restart 45
ping-timer-rem
persist-tun
persist-key
mute-replay-warnings
verb 3
cipher BF-CBC
auth SHA1
pull
auth-user-pass auth.cfg 


Referensi