Hello
Nordvpn and mikrotik ?
go or not go ?
I find on nordvpn site
https://support.nordvpn.com/Connectivit ... outers.htm
what you say ?
Thanks for the link, msatter! In short: currently EAP authentication as initiator is not possible for IKEv2. So the website is right, no-go with Mikrotik.
MAJOR CHANGES IN v6.45.1:
----------------------
[b]!) ike2 - added support for EAP authentication methods (eap-tls, eap-ttls, eap-peap, eap-mschapv2) as initiator;[/b]
IPsec mode-config relieves you from the need to track the changes of the address you get from the responder by means of a dynamically generated (and dynamically updated) src-nat rule - you specify a name of an address-list which will be used in this rule as src-address-list. So traffic whose source IP matches that address list gets src-nated to the IP currently assigned to you by the responder, and thus caught by the IPsec policy.So, eap-mschapv2 is here and supported for IKEv2. We have nice manual for setting up NordVPN connection https://wiki.mikrotik.com/wiki/IKEv2_EA ... the_tunnel. But can anyone help with how to route through IPSec tunnel only traffic to some predetermined www sites (list is created in Firewall -> Address Lists)? I believe I need static NAT rule where dst-address-list will be set to my list of www sites? How to solve the problem of possible changes in IP from NordVPN side (scripts)? Maybe someone can share working example?
Any examples of such a script? Also I believe I need to remove dynamic NAT rule, correct?As this rule is placed to the very first position in the srcnat chain, there is no way to create exceptions from it. So one way to src-nat only packets towards listed destinations is to periodically schedule a script which would update the to-addresses item in a manually created action=src-nat rule as @mrz suggests, another way is described here but in my opinion the script way is much simpler.
You need to prevent the dynamic NAT rule from being created, which simply means not to set the address-list item in the request-only (responder=no) row in /ip ipsec mode-config you refer to from the /ip ipsec identity row you use for NordVPN.Any examples of such a script? Also I believe I need to remove dynamic NAT rule, correct?
if ([:len [/system script environment find name=lastIP]] = 0) do={global lastIP 8.8.8.8};
local currentIP [/ip address get [find dynamic !(address in your.wan.subnet.ip/mask) interface~"if-name"] address];
if ($lastIP != $currentIP) do={
ip firewall nat set [find chain=srcnat action=src-nat dst-address-list~"nordvpn-targets"] to-addresses=$currentIP;
system script environment set lastIP value=$currentIP;
}
Of course there is, but you may end up with the same issue I've mentioned above. You may have more than one IPsec policy in place (or even more than one dynamic address assigned by an IKEv2 peer using mode-config), so the match criteria used to select the proper address have to be tailored to your environment in any case, regardless whether you fetch it from the dynamically assigned IP addresses or from the dynamically created IPsec policies (or both).when connected, the src-address in ipsec policy is the current ip address asinged by ikev2, is there a way to use this ip in script?
local currentIP [/ip ipsec policy get [find peer~"pure"] src-address];