/ip dns static set [find name=ikev2.wireshark.lan] address=[:resolve xxxxxxx.surfshark.com];
If you set the TTL then that could lead to the fact the server is not listening on that moment. Even 5 minutes seems to be long for Surfshark.I have opened a support ticket with Surfshark, they are slow but the do respond. So far they have not been very helpful though, just asking me to try different DNS servers and send them screenshots of ipleak.net.
funnily enough, I worked out a similar work around as msatter suggested regarding the scripted static DNS entry, except I am using made up vip.surfshark.local static DNS entries with a 5 min TTL and running the schedule every 8 hours. Works well enough, but it does pretty much still guarantee sessions to drop if they are active when the rotation script runs and changes the IP address - so streams will temporarily die and I get logged out of FFXIV. I can live with the minimal disruption for now, but hopefully surfshark will fix their DNS... or at least create some additional VIPs with longer TTL.
I'd question whether what RouterOS does is correct. I'm not saying that it definitely isn't, but it seems wrong, or at least not expected or desired.
If you have other kinds of VPN (SSTP, ...), they don't care about address changes. They take hostname when they connect, resolve it to IP address and connect to it. And as long as the tunnel is up and runnning, the hostname can change every second and they don't care about it. Only when tunnel fails, hostname is resolved again and new address used.
IPSec is not as simple as SSTP's one TCP connection. With this kind of client VPN it won't happen, but generally the tunnel can be initiated from both sides. So if remote peer is configured with hostname, RouterOS must periodically resolve it, to be prepared to accept requests for new tunnel from peer's new address, in case it changes.
But it seems wrong to tear down a perfectly fine and working tunnel. With site to site tunnels, maybe. But not with client to server configs like this, IMHO it should behave the same way as other VPN types, i.e. use the original address and switch to new one only when tunnel breaks.
My script config:shogunx can you maybe compare your script ?
What about only to request that script by rb start and after dropping the line and not every 8 hours ?
/ip dns static add address=180.149.228.117 name=syd-vip.surfshark.local ttl=5m type=A
/system script add dont-require-permissions=no name=update-sshark-vips owner=admin policy=read,write source="/ip dns static set [find where name=syd-vip.surfshark.local] address=[:resolve au-syd.prod.surfshark.com]"
/system scheduler add interval=8h name=rotate-sshark-dns on-event="/system script run update-sshark-vips" policy=read,write start-date=aug/29/2020 start-time=07:00:00
The difference is that IPSec is an IP (layer 3) protocol; SSTP, OpenVPN, and other SSL based VPNs are TCP/UDP protocols, they operate at layer 4 (and higher). SSL VPNs usually have application clients that run in user land to establish and manage the connection. When an SSL VPN initiates a connection, the client looks up the IP once and caches it for itself for the life of the connection.I'd question whether what RouterOS does is correct. I'm not saying that it definitely isn't, but it seems wrong, or at least not expected or desired.
If you have other kinds of VPN (SSTP, ...), they don't care about address changes. They take hostname when they connect, resolve it to IP address and connect to it. And as long as the tunnel is up and runnning, the hostname can change every second and they don't care about it. Only when tunnel fails, hostname is resolved again and new address used.
IPSec is not as simple as SSTP's one TCP connection. With this kind of client VPN it won't happen, but generally the tunnel can be initiated from both sides. So if remote peer is configured with hostname, RouterOS must periodically resolve it, to be prepared to accept requests for new tunnel from peer's new address, in case it changes.
But it seems wrong to tear down a perfectly fine and working tunnel. With site to site tunnels, maybe. But not with client to server configs like this, IMHO it should behave the same way as other VPN types, i.e. use the original address and switch to new one only when tunnel breaks.
Well for starters, this issue is specific to IPSec, so any client that uses the Openvpn protocol by default wouldn't be affected.Then how do other non-RouterOS clients deal with it? Do they also disconnect every five seconds? I'm guessing no, otherwise VPN provider could hardly use this config.
What's new in 6.48beta35 (2020-Sep-02 07:50):
...
*) ipsec - refresh peer's DNS only when phase 1 is down;
/ip ipsec mode-config
add connection-mark=VPN name=Surfshark_VPN responder=no
nslookup server_of_surfshark.prod.surfshark.com
/ip firewall mangle
add action=mark-connection chain=prerouting new-connection-mark=VPN passthrough=yes
/ip firewall mangle
add action=change-mss chain=forward new-mss=1360 protocol=tcp tcp-flags=syn tcp-mss=1453-65535
There is a better way than this just limiting to a MTU of 1360Fixing MSS for forward packages
/ip firewall mangle
add action=change-mss chain=forward new-mss=1360 protocol=tcp tcp-flags=syn tcp-mss=1453-65535
Did you read the thread?i have same problem with surfshark ikev2 , every few second killing ikev.. the getting new 1
hope mikrotik fix it.
i have read but i don't understand much about networking, i am a simple consumer who uses the mikrotik sxt modem outside. i tried to configure surfshark vpn as per guide. but once connected to the vpnthe connection has slowed down. now i installed the developement version on the router and for now everything works fine.Did you read the thread?i have same problem with surfshark ikev2 , every few second killing ikev.. the getting new 1
hope mikrotik fix it.
Might be being slow on a Sunday, but why is there a difference between the new MSS of 1360 and 1453 for the old MSS?Code: Select all/ip firewall mangle add action=change-mss chain=forward new-mss=1360 protocol=tcp tcp-flags=syn tcp-mss=1453-65535
Where have you been all this time? :-DThere is a better way than this just limiting to a MTU of 1360
hello, does this change solve the problem?Thank youThere is a better way than this just limiting to a MTU of 1360Fixing MSS for forward packages
/ip firewall mangle
add action=change-mss chain=forward new-mss=1360 protocol=tcp tcp-flags=syn tcp-mss=1453-65535
viewtopic.php?f=2&t=154449&p=796005&hil ... v2#p796005
I installed version 6.48beta 40, and the connection is stable, there are some slowdowns and blocking of the navigation but I can't understand why, I don't understand much about this os and networking. maybe it was better to buy a router for ordinary people. now I just have to tinker and try.No when I look at the subject of this thread. There is a workaround wich can be used till the fix by Mikrotik trickels down to the other versions.
The topic linked to is tackling a different problem of ROS not able return a icmp 3-4 to the correct client when using IKEv2.
"ordinary people" and IPsec do not fit together well regardless the router manufacturer. IPsec is very flexible in many aspects, and flexibility comes with complexity of setup.maybe it was better to buy a router for ordinary people
It depends on the CPU power of your router and the bandwidth of your uplink. Fasttracking is a way to simplify the processing of the packets in the firewall, to spend less CPU per an average packet. So if /tool profile shows more than, say, 20 % CPU usage while a normal traffic load is experienced, putting that rule back may help a lot. But due to the order of actions in the firewall, fasttracking also prevents IPsec from working properly in particular setups, as it bypasses also matching of the packets by the IPsec policies' traffic selectors. So to restrict fasttracking to non-IPsec traffic, you need the "action=accept ipsec-policy=in,ipsec" and "action=accept ipsec-policy=out,ipsec" rules before the action=fasttrack-connection connection-state=established,related one in chain=forward of /ip firewall filter. Without them, the non-IPsec traffic will be handled faster, but IPsec traffic will be handled much slower (because only one in many packets of the fasttracked connections is not fasttracked and thus can hit the policies' traffic selectors and be delivered via the IPsec tunnel).I accidentally deleted the fasttracking function from the IP Firewall settings, is it something you need or can I do less?
The only information is here, but it's not really useful. So if the tunnel does work otherwise, these errors may be caused e.g. by slow establishment of the tunnel.I wanted to ask what these errors are: out-state-mode-errors: 692
6.48beta40 works for me (eliminates ~5 second drop of surfshark peer connection)Any feedback with the latest beta version? The issue should be resolved there.
# oct/11/2020 23:25:24 by RouterOS 6.48beta40
# software id = HGAG-UTY7
#
# model = RB750Gr3
/ip ipsec mode-config
add name=SSVPN responder=no src-address-list=local
/ip ipsec policy group
add name=SSVPN
/ip ipsec profile
add name=SSVPN
/ip ipsec peer
add address=us-ltm.prod.surfshark.com exchange-mode=ike2 name=SSVPN profile=\
SSVPN
/ip ipsec proposal
add name=SSVPN pfs-group=none
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp disabled=no interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=\
192.168.88.0
/ip dhcp-client
add comment=defconf disabled=no interface=ether1
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf dns-server=\
162.252.172.57,149.154.159.92 gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip firewall address-list
add address=192.168.88.0/24 list=local
/ip firewall filter
add action=accept chain=input 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=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related disabled=yes
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
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
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
/ip ipsec identity
add auth-method=eap certificate=surfshark_ikev2.crt_0 disabled=yes \
eap-methods=eap-mschapv2 generate-policy=port-strict mode-config=SSVPN \
peer=SSVPN policy-template-group=SSVPN username=[my_username]
/ip ipsec policy
add dst-address=0.0.0.0/0 group=SSVPN proposal=SSVPN src-address=0.0.0.0/0 \
template=yes
/system package update
set channel=testing
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN