Osnovni preduvijet je da je mikrotik router podešen, tj ima pristup internetu, podešen NAT, IP adrese i DNS.
1. Isključimo u firewallu fasttrack i dodamo portove za Purevpn (ostala pravila u filteru su osnovna mikrotik pravila).
Code: Select all
/ip firewall filter
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related disabled=yes hw-offload=yes
add action=accept chain=input dst-port=500,4500 protocol=udp
add action=accept chain=input protocol=ipsec-esp
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
Code: Select all
/ip firewall address-list
add address=10.0.0.11 list=local
add address=10.0.0.0/24 disabled=yes list=local
add address=192.168.11.0/24 list=local
3. Dodavanje certifikata u mikrotik.
Prema službenom uputstvu od PureVPN https://support.purevpn.com/en_US/route ... tik-router
vidimo da je link na službeni certifikat ovdje:https://jmp.sh/4OzUZvIY
Downloadamo navedeni certifikat i uploadamo ga mikrotik router.
Import radimo iz winboxa System-Certificates-Import kao što je prikazano na slici: 4. IP > IPsec podešavanja
Skracena verzija iz terminala:
Code: Select all
/ip ipsec mode-config
add name=PureVPN responder=no src-address-list=local use-responder-dns=no
/ip ipsec policy group
add name=PureVPN
/ip ipsec profile
add enc-algorithm=aes-256,aes-128,3des hash-algorithm=sha256 name=PureVPN
/ip ipsec peer
add address=nl-ddux-1.pointtoserver.com comment=Netherland disabled=yes name=\
PureVPN2 profile=PureVPN
add address=sx0407117-ikev.ptoserver.com comment=Germany name=PureVPN3 \
profile=PureVPN
add address=sx0510157-ikev.ptoserver.com comment=Netherland disabled=yes \
name=PureVPN profile=PureVPN
/ip ipsec proposal
add auth-algorithms=sha256 enc-algorithms=aes-256-cbc,aes-256-gcm,aes-128-cbc \
name=PureVPN
/ip ipsec identity
add auth-method=pre-shared-key-xauth generate-policy=port-strict mode-config=\
PureVPN peer=PureVPN policy-template-group=PureVPN username=\
purevpnusername
add auth-method=pre-shared-key-xauth generate-policy=port-strict mode-config=\
PureVPN peer=PureVPN2 policy-template-group=PureVPN username=\
purevpnusername
add auth-method=pre-shared-key-xauth generate-policy=port-strict mode-config=\
PureVPN peer=PureVPN3 policy-template-group=PureVPN username=\
purevpnusername
/ip ipsec policy
add comment=PureVPN dst-address=0.0.0.0/0 group=PureVPN src-address=0.0.0.0/0 \
template=yes
Naravno u wiboxu podesite pravi username i pasword koji je vidljiv u vašem PureVPN accountu https://my.purevpn.com/
kao što je prikazano na ovoj slici Settings - Subscriptions : Konačno sva podešavanja izgledaju kao što je prikazano na slikama:
Za razliku od službenog tutorijala ja opciju Use responder DNS postavljam na no , jer prema službenom tutorijalu nisam dobivao DNS response i stranice se nisu otvarale , tako da ja koristim vlastiti DNS tj mikrotik. Konačno provjera rada u mikrotiku: Vidimo lokane adrese , remote adrese , dinamičku dodijeljenu adresu i naravno byte kako rastu čim više surfamo tj imamo nekakvu internetsku aktivnost.
Također provjerimo dali je mikrotiku pravilno dodjeljena nova ip adresa: U firewalu također provjerimo da je generiran dinamički src-nat: također možemo provjeriti u terminalu:
Code: Select all
/ip firewall nat print
Code: Select all
Flags: X - disabled, I - invalid; D - dynamic
0 D ;;; ipsec mode-config
chain=srcnat action=src-nat to-addresses=172.94.9.13 src-address-list=local
dst-address-list=!local
Code: Select all
/system logging add action=memory topics=ipsec,!debug
rezultat izgleda ovako: To je to , mikrotik uredno radi sa PureVPN.