# NordVPN (IPSEC/IKEv2) + killswitch (For ROS6)

**URL:** <https://forum.mikrotik.com/t/nordvpn-ipsec-ikev2-killswitch-for-ros6/144817>\
**Category:** Useful user articles\
**Created:** [November 20, 2020, 12:51am UTC](https://forum.mikrotik.com/t/nordvpn-ipsec-ikev2-killswitch-for-ros6/144817 "2020-11-20T00:51:19Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![erkexzcx](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/erkexzcx/32/2469_2.png) [@erkexzcx](https://forum.mikrotik.com/u/erkexzcx)\
**Post date:** [November 20, 2020, 12:51am UTC](https://forum.mikrotik.com/t/nordvpn-ipsec-ikev2-killswitch-for-ros6/144817/1 "2020-11-20T00:51:19Z")

</div>

**Overview**

- I’ve wasted hours making RouterOS to work perfectly with NordVPN and I wrote this guide, so you don’t have to waste your time.
- You must have RouterOS 6. It must be minimum version of 6.45. Some steps in ROS7 will be different.
- Nearly identical setup is possible with **Surfshark**. See [here](https://support.surfshark.com/hc/en-us/articles/360012906220-Mikrotik-router-tutorial-with-IKEv2).
- To get around geo restrictions (e.g. for bbc player, Netflix content) as well as [DNS leaking](https://nordvpn.com/features/dns-leak-test/), you must use [NordVPN DNS servers](https://support.nordvpn.com/General-info/1047409702/What-are-your-DNS-server-addresses.htm). **Disclaimer** : I did not test if it works.
- Below steps uses the “considered to be perfectly safe” ciphers & their levels, but NordVPN [does support higher levels](https://support.nordvpn.com/FAQ/1047408592/Which-protocol-should-I-choose.htm) of encryption. Check [what hardware acceleration is supported by your Mikrotik router](https://wiki.mikrotik.com/wiki/Manual:IP/IPsec#Hardware_acceleration) and you might want to use such encryption instead for below steps. P.S. “_SHA384 hash algorithm support for phase 1_” is supported since 6.48 (might be CLI only).
- Instead of reducing MSS size using below given commands, one can also do this using IPSEC functionality. See [here](http://forum.mikrotik.com/t/sector-writes-growing/160/1) for instructions.

**Preparation**

1. Get recommended NordVPN server from [here](https://nordvpn.com/servers/tools/). In below steps I used “[lv55.nordvpn.com](http://lv55.nordvpn.com)”.
2. Get your **Service Credentials** from [here](https://my.nordaccount.com/dashboard/nordvpn/) and use them for this setup.
3. Import NordVPN CA to your router:

```plaintext
/tool fetch url="https://downloads.nordcdn.com/certificates/root.der"
/certificate import file-name=root.der name="NordVPN CA" passphrase=""

```

**Use-case #1: Specific traffic (by source) routed through VPN server**

**Example** : You want only 2 LAN devices (192.168.88.10 and 192.168.88.11) to reach internet through VPN server, but the rest of LAN devices to reach internet normally (without VPN server).

```plaintext
# Mark traffic that you want to route through VPN server
/ip firewall address-list add address=192.168.88.10 list=under_nordvpn
/ip firewall address-list add address=192.168.88.11 list=under_nordvpn
/ip firewall mangle add action=mark-connection chain=prerouting src-address-list=under_nordvpn new-connection-mark=under_nordvpn passthrough=yes

# IPsec/IKEv2 configuration
/ip ipsec mode-config add connection-mark=under_nordvpn name="NordVPN mode config" responder=no
/ip ipsec policy group add name=NordVPN
/ip ipsec profile add dh-group=modp2048 enc-algorithm=aes-256 hash-algorithm=sha512 name="NordVPN profile"
/ip ipsec peer add address=lv55.nordvpn.com exchange-mode=ike2 name="NordVPN server" profile="NordVPN profile"
/ip ipsec proposal add auth-algorithms=sha256 enc-algorithms=aes-256-cbc lifetime=0s name="NordVPN proposal" pfs-group=none
/ip ipsec identity add auth-method=eap certificate="NordVPN CA" eap-methods=eap-mschapv2 generate-policy=port-strict mode-config="NordVPN mode config" password=XXXXXXXXXX peer="NordVPN server" policy-template-group=NordVPN username=XXXXXXXXXX
/ip ipsec policy add dst-address=0.0.0.0/0 group=NordVPN proposal="NordVPN proposal" src-address=0.0.0.0/0 template=yes

# In "/ip ipsec policy" you should be able to see a new dynamic rule added next to your NordVPN policy. It MUST exist, otherwise configuration is not working.

# (OPTIONAL) Implement a killswitch
/interface bridge add name=nordvpn_blackhole protocol-mode=none
/ip route add gateway=nordvpn_blackhole routing-mark=nordvpn_blackhole
/ip firewall mangle add chain=prerouting src-address-list=under_nordvpn action=mark-routing new-routing-mark=nordvpn_blackhole passthrough=yes

# Exclude such VPN traffic from fasttrack
/ip firewall filter add action=accept chain=forward connection-mark=under_nordvpn place-before=[find where action=fasttrack-connection]

# Reduce MSS (should be about 1200 to 1400, but 1360 worked for me)
/ip firewall mangle add action=change-mss chain=forward new-mss=1360 passthrough=yes protocol=tcp connection-mark=under_nordvpn tcp-flags=syn tcp-mss=!0-1360

```

**Use-case #2: Specific traffic (by destination) routed through VPN server**

**Example** : You want to reach website [wtfismyip.com](https://wtfismyip.com/) via VPN server, but the rest of the traffic should go as it is (without VPN).

**Note** : You can’t effectively route all the traffic of Youtube, Netflix or any other big websites through VPN. They have many different domains and IP addresses which constantly change. Instead, route all the traffic of your device through VPN.

**Note 2** : You might be able to route all traffic of the company, but you might end up routing 30-40% of the websites under NordVPN if company uses popular hosting, e.g. Amazon AWS or Linode. For example, [Mikrotik.com](http://Mikrotik.com) resolves to “159.148.147.196”. [Quick google revealed](https://ipinfo.io/159.148.147.196) the [Mikrotik has it’s own ASN](https://ipinfo.io/AS51894) which contains 512 ips, or in other words, If you wish to access Mikrotik services/websites under NordVPN, you should add 159.148.147.0/24 and 159.148.172.0/24 to your address list using this (2nd) method.

```plaintext
# Mark traffic that you want to route through VPN server
/ip firewall address-list add address=wtfismyip.com list=under_nordvpn
/ip firewall mangle add action=mark-connection chain=prerouting dst-address-list=under_nordvpn new-connection-mark=under_nordvpn passthrough=yes

# IPsec/IKEv2 configuration
/ip ipsec mode-config add connection-mark=under_nordvpn name="NordVPN mode config" responder=no
/ip ipsec policy group add name=NordVPN
/ip ipsec profile add dh-group=modp2048 enc-algorithm=aes-256 hash-algorithm=sha512 name="NordVPN profile"
/ip ipsec peer add address=lv55.nordvpn.com exchange-mode=ike2 name="NordVPN server" profile="NordVPN profile"
/ip ipsec proposal add auth-algorithms=sha256 enc-algorithms=aes-256-cbc lifetime=0s name="NordVPN proposal" pfs-group=none
/ip ipsec identity add auth-method=eap certificate="NordVPN CA" eap-methods=eap-mschapv2 generate-policy=port-strict mode-config="NordVPN mode config" password=XXXXXXXXXX peer="NordVPN server" policy-template-group=NordVPN username=XXXXXXXXXX
/ip ipsec policy add dst-address=0.0.0.0/0 group=NordVPN proposal="NordVPN proposal" src-address=0.0.0.0/0 template=yes

# In "/ip ipsec policy" you should be able to see a new dynamic rule added next to your NordVPN policy. It MUST exist, otherwise configuration is not working.

# (OPTIONAL) Implement a killswitch
/interface bridge add name=nordvpn_blackhole protocol-mode=none
/ip route add gateway=nordvpn_blackhole routing-mark=nordvpn_blackhole
/ip firewall mangle add chain=prerouting dst-address-list=under_nordvpn action=mark-routing new-routing-mark=nordvpn_blackhole passthrough=yes

# Exclude such VPN traffic from fasttrack
/ip firewall filter add action=accept chain=forward connection-mark=under_nordvpn place-before=[find where action=fasttrack-connection]

# Reduce MSS (should be about 1200 to 1400, but 1360 worked for me)
/ip firewall mangle add action=change-mss chain=forward new-mss=1360 passthrough=yes protocol=tcp connection-mark=under_nordvpn tcp-flags=syn tcp-mss=!0-1360

```

---

_[View the full topic](https://forum.mikrotik.com/t/nordvpn-ipsec-ikev2-killswitch-for-ros6/144817)._
