/ip ipsec policy group
add name=ike2
/ip ipsec profile
set [ find default=yes ] enc-algorithm=aes-256,aes-192,aes-128 \
hash-algorithm=sha256
add enc-algorithm=aes-256,aes-192,aes-128 hash-algorithm=sha256 name=ike2
/ip ipsec peer
add exchange-mode=ike2 name=kalpak passive=yes profile=ike2 \
send-initial-contact=no
/ip ipsec proposal
set [ find default=yes ] auth-algorithms=sha256,sha1 pfs-group=modp2048
add auth-algorithms=sha256,sha1 enc-algorithms="aes-256-cbc,aes-256-ctr,aes-25\
6-gcm,aes-192-cbc,aes-192-ctr,aes-192-gcm,aes-128-cbc,aes-128-ctr,aes-128-\
gcm" name=ike2 pfs-group=none
/ip ipsec mode-config
add address-pool=ipsec-roadwarrior address-prefix-length=32 name=ike2 \
split-include=0.0.0.0/0 static-dns=8.8.8.8 system-dns=no
/ppp profile
add change-tcp-mss=yes name=BSNL-PPPoE
add change-tcp-mss=yes name=ABSPL-PPPoE
set *FFFFFFFE dns-server=192.168.72.53
/ip firewall filter
add action=accept chain=forward ipsec-policy=in,ipsec
add action=accept chain=forward ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward connection-state=\
established,related disabled=yes hw-offload=yes
add action=accept chain=forward connection-state=established,related \
disabled=yes
add action=drop chain=input connection-state=invalid in-interface=BSNL-PPPoE
add action=accept chain=input comment="ICMP Allow" in-interface=BSNL-PPPoE \
protocol=icmp
add action=accept chain=input comment="IGMP Allow" in-interface=BSNL-PPPoE \
protocol=igmp
add action=accept chain=input comment="IGMP Allow" in-interface=BSNL-PPPoE \
protocol=ipsec-esp
add action=accept chain=input comment="GRE Allow" in-interface=BSNL-PPPoE \
protocol=gre
add action=accept chain=input comment="Allow UDP ports" dst-port=\
500,1701,2000,3389,4500,4789,5198,5199,5201,8472,9993,13231-13235 \
in-interface=BSNL-PPPoE protocol=udp
add action=accept chain=input comment="Allow TCP ports" dst-port=\
22,80,443,1723,2000,2200,3389,6969,8006,8080,8291,8888,9993,32700-39000 \
in-interface=BSNL-PPPoE protocol=tcp
add action=accept chain=input connection-state=established in-interface=\
BSNL-PPPoE
add action=accept chain=input connection-state=related in-interface=\
BSNL-PPPoE
add action=accept chain=input connection-state=untracked in-interface=\
BSNL-PPPoE
add action=drop chain=input in-interface=BSNL-PPPoE
/ip firewall mangle
add action=change-mss chain=forward comment="Fix MSS for VPN server" new-mss=\
1300 passthrough=yes protocol=tcp src-address=192.168.55.0/29 tcp-flags=\
syn tcp-mss=!0-1300
add action=change-mss chain=forward comment="Fix MSS for VPN server" \
dst-address=192.168.55.0/29 new-mss=1300 passthrough=yes protocol=tcp \
tcp-flags=syn tcp-mss=!0-1300
/ip firewall nat
add action=masquerade chain=srcnat out-interface=BSNL-PPPoE
/ip ipsec identity
add generate-policy=port-override mode-config=ike2 my-id=\
fqdn:ec190ff69b86.sn.mynetname.net peer=kalpak policy-template-group=ike2 \
remote-id=ignore
/ip ipsec policy
set 0 disabled=yes dst-address=0.0.0.0/0 group=ike2 proposal=ike2 \
src-address=0.0.0.0/0
add action=none dst-address=0.0.0.0/0 src-address=192.168.23.0/24
add action=none dst-address=0.0.0.0/0 src-address=192.168.24.0/24
add action=none dst-address=0.0.0.0/0 src-address=192.168.72.0/23
add dst-address=192.168.55.0/29 group=ike2 proposal=ike2 src-address=\
0.0.0.0/0 template=yes
No. The src-address and dst-address must refer to the same LAN subnet in these action=none policies, as their purpose is to prevent packets sent by the router itself to a host in its own LAN subnet from getting handled by the dst-address=0.0.0.0/0 src-address=lan.sub.net/mask action=encrypt policy.can i confirm with you:
does that mean:
dst-address=local-lan/mask src-address=remote-lan/mask
Sorry, I don't understand the description of this other issue. I can see no port forwarding rule in the export, and I would expect that seeing a server in the LAN is what you actually want if you have set a port forwarding rule. So please reword the description, state what is the expected behaviour and how the actual one differs from that.I am also facing another issue. Whenever I am trying to access an webserver on my lan via IP it shows the webserver that has port 80 forwareded to it. This is only for remote users using VPN.
Post the export (not screenshots) of your configuration. Something similar as described in post #2 must be happening, but in your case, it would be the remote server (web site) that doesn't receive the information that the usable MTU is lower on the path from your router to your phone. But the Path MTU Discovery (PMTUD) mechanism may be broken also for other reasons than missing or incorrect IPsec policies.what needs to be checked?
# mar/03/2024 16:06:57 by RouterOS 6.49.10
# software id = UH1D-IK15
#
# model = CCR1016-12G
# serial number = D6450EB884C9
/interface bridge
add arp=reply-only name=bridge1
/interface ethernet
set [ find default-name=ether1 ] name=ether1-WAN
set [ find default-name=ether2 ] disabled=yes
set [ find default-name=ether3 ] disabled=yes
set [ find default-name=ether4 ] disabled=yes
set [ find default-name=ether5 ] disabled=yes
set [ find default-name=ether6 ] disabled=yes
set [ find default-name=ether7 ] name=ether7
set [ find default-name=ether8 ] disabled=yes
set [ find default-name=ether9 ] disabled=yes
set [ find default-name=ether10 ] disabled=yes
set [ find default-name=ether11 ] disabled=yes
set [ find default-name=ether12 ] disabled=yes
/interface vlan
add interface=ether1-WAN name=vlan1 vlan-id=1
/interface list
add name=Lan
add name=WAN
add name=discover
/ip ipsec mode-config
add address=10.50.0.12 address-prefix-length=22 name=IKEv2-Server static-dns=\
172.16.0.1 system-dns=no
/ip ipsec policy group
add name=ipsec
add name=IKEv2-Server
/ip ipsec profile
add enc-algorithm=aes-256,aes-192,aes-128,3des name=ipsec-profile
add dh-group=modp2048,modp1536,modp1024 enc-algorithm=\
aes-256,aes-192,aes-128,3des hash-algorithm=sha256 name=IKEv2-Server
/ip ipsec peer
add exchange-mode=ike2 local-address=123.45.67.89 name=IKEv2-Server passive=\
yes profile=IKEv2-Server
/ip ipsec proposal
add enc-algorithms=aes-256-cbc,aes-192-cbc,aes-128-cbc,3des name=\
ipsec-proposal pfs-group=none
add auth-algorithms=sha512,sha256,sha1 enc-algorithms="aes-256-cbc,aes-256-ctr\
,aes-256-gcm,aes-192-ctr,aes-192-gcm,aes-128-cbc,aes-128-ctr,aes-128-gcm" \
lifetime=8h name=IKEv2-Server pfs-group=none
/ip pool
add name=pool4 ranges=172.16.4.1-172.16.4.254
add name=pool3 next-pool=pool4 ranges=172.16.3.1-172.16.3.254
add name=pool2 next-pool=pool3 ranges=172.16.2.1-172.16.2.254
add name=pool1 next-pool=pool2 ranges=172.16.1.1-172.16.1.254
/ppp profile
add change-tcp-mss=yes name=l2tp-remote-client-to-site only-one=no \
use-compression=yes use-encryption=yes
/snmp community
set [ find default=yes ] disabled=yes
add addresses=0.0.0.0/0 name=snmp_public
/system logging action
set 1 disk-file-count=10
set 3 bsd-syslog=yes remote=172.16.1.135 syslog-facility=syslog
add name=ipsec target=memory
add name=l2tp target=memory
/interface bridge port
add bridge=bridge1 hw=no interface=ether7
add bridge=bridge1 interface=vlan1
/ip neighbor discovery-settings
set discover-interface-list=none
/interface l2tp-server server
set authentication=mschap2 default-profile=l2tp-remote-client-to-site \
enabled=yes one-session-per-host=yes use-ipsec=required
/interface pptp-server server
set authentication=mschap2 default-profile=pptp
/ip address
add address=172.16.0.1/22 interface=bridge1 network=172.16.0.0
add address=123.45.67.89/29 interface=\
ether1-WAN network=123.45.67.89
/ip dhcp-server network
add address=172.16.0.0/22 dns-server=172.16.0.1 gateway=172.16.0.1 \
ntp-server=172.16.0.1
/ip dns
set allow-remote-requests=yes cache-max-ttl=1d cache-size=10240KiB servers=\
8.8.8.8,1.1.1.1
/ip firewall filter
add action=accept chain=forward
add action=accept chain=output
add action=accept chain=input
/ip firewall mangle
add action=change-mss chain=forward ipsec-policy=in,ipsec new-mss=1360 \
passthrough=yes protocol=tcp src-address=10.50.0.12 tcp-flags=syn \
tcp-mss=!0-1360
add action=change-mss chain=forward dst-address=10.50.0.12 ipsec-policy=\
out,ipsec new-mss=1360 passthrough=yes protocol=tcp tcp-flags=syn \
tcp-mss=!0-1360
/ip firewall nat
add action=masquerade chain=srcnat src-address=10.50.0.12
add action=masquerade chain=srcnat src-address=172.16.0.0/22 out-interface-list=WAN
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set irc disabled=yes
set h323 disabled=yes
set sip disabled=yes
set pptp disabled=yes
set udplite disabled=yes
set dccp disabled=yes
set sctp disabled=yes
/ip ipsec identity
add auth-method=digital-signature certificate=vpn.ike2 generate-policy=\
port-strict match-by=certificate mode-config=IKEv2-Server peer=\
IKEv2-Server policy-template-group=IKEv2-Server remote-certificate=\
ra@vpn.ike2 remote-id=user-fqdn:ra@vpn.ike2
/ip ipsec policy
add dst-address=0.0.0.0/0 group=ipsec proposal=ipsec-proposal src-address=\
0.0.0.0/0 template=yes
add dst-address=10.50.0.0/24 group=IKEv2-Server proposal=IKEv2-Server \
src-address=0.0.0.0/0 template=yes
/ip route
add check-gateway=ping distance=1 gateway=11.12.34.56
/ip route rule
add action=lookup-only-in-table src-address=123.45.67.89/32 table=WAN
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set ssh disabled=yes
set api disabled=yes
set winbox port=28291
set api-ssl disabled=yes
/snmp
set enabled=yes trap-community=snmp_public trap-interfaces=\
ether7 trap-version=2
/system clock
set time-zone-name=manual
/system clock manual
set dst-delta=+01:00 dst-end="oct/28/2019 00:00:00" dst-start=\
"mar/31/2019 00:00:00" time-zone=+02:00
/system identity
set name=mtk-ccr1016
/system leds
add leds=fault-led type=fan-fault
add leds=user-led type=flash-access
/system package update
set channel=long-term
/tool bandwidth-server
set authenticate=no enabled=no
/tool mac-server
set allowed-interface-list=none
/tool mac-server mac-winbox
set allowed-interface-list=Lan
/tool mac-server ping
set enabled=no
[mtk@mtk-ccr1016] > /ip ipsec
[mtk@mtk-ccr1016] /ip ipsec> export
# mar/04/2024 13:04:15 by RouterOS 6.49.10
# software id =
#
# model = CCR1016-12G
# serial number =
/ip ipsec mode-config
add address=10.50.0.12 address-prefix-length=22 name=IKEv2-Server static-dns=\
172.16.0.1 system-dns=no
/ip ipsec policy group
add name=ipsec
add name=IKEv2-Server
/ip ipsec profile
add enc-algorithm=aes-256,aes-192,aes-128,3des name=ipsec-profile
add dh-group=modp2048,modp1536,modp1024 enc-algorithm=\
aes-256,aes-192,aes-128,3des hash-algorithm=sha256 name=IKEv2-Server
add name=copy
/ip ipsec peer
add exchange-mode=ike2 local-address=ip wan name=IKEv2-Server passive=\
yes profile=IKEv2-Server
add disabled=yes exchange-mode=ike2 name=copy passive=yes profile=IKEv2-Server
/ip ipsec proposal
add enc-algorithms=aes-256-cbc,aes-192-cbc,aes-128-cbc,3des name=ipsec-proposal \
pfs-group=none
add auth-algorithms=sha512,sha256,sha1 enc-algorithms="aes-256-cbc,aes-256-ctr,a\
es-256-gcm,aes-192-ctr,aes-192-gcm,aes-128-cbc,aes-128-ctr,aes-128-gcm" \
lifetime=8h name=IKEv2-Server pfs-group=none
add name=copy
/ip ipsec identity
add auth-method=digital-signature certificate=vpn.ike2 generate-policy=\
port-strict match-by=certificate mode-config=IKEv2-Server peer=IKEv2-Server \
policy-template-group=IKEv2-Server remote-certificate=ra@vpn.ike2 \
remote-id=user-fqdn:ra@vpn.ike2
add auth-method=digital-signature certificate=name comment=copy \
disabled=yes generate-policy=port-strict match-by=certificate mode-config=\
IKEv2-Server peer=IKEv2-Server policy-template-group=IKEv2-Server \
remote-certificate=ra@name remote-id=user-fqdn:ra@name
add disabled=yes generate-policy=port-strict mode-config=IKEv2-Server peer=\
IKEv2-Server policy-template-group=IKEv2-Server secret=\
"vJ\$beWkTJ7q@9S~`>]q)YrLH"
/ip ipsec policy
add dst-address=0.0.0.0/0 group=ipsec proposal=ipsec-proposal src-address=\
0.0.0.0/0 template=yes
add dst-address=10.50.0.0/24 group=IKEv2-Server proposal=IKEv2-Server \
src-address=0.0.0.0/0 template=yes
add comment=copy disabled=yes dst-address=0.0.0.0/0 group=IKEv2-Server \
proposal=IKEv2-Server src-address=0.0.0.0/0 template=yes
[mtk@mtk-ccr1016] /ip ipsec>
https://ibb.co/WkL4RjBTo identify that, I would sniff the TCP SYN+ACK packets arriving via WAN and see what MSS they carry. If it is smaller than 1460, it suggests something between your WAN and the sender is tampering with it. But to be really sure, you need a device on a public address somewhere in the internet (like your friend's one on a public address provided by some other ISP than yours) and sniffing simultaneously on it and your WAN when trying to open its address for web or telnet (it doesn't matter whether the service is actually listening there, we are interested in just the SYN packet contents, it need not be responded).
As for "without changing the provider", I'm afraid you'd have to use a virtual machine somewhere in a data center and create a tunnel to it in order to bypass the mishandling of MSS by the ISP. But talking nicely to the ISP might be an easier way?
OkExport shows the configured items; the actual policies are generated dynamically from the templates. And your templates are quite wide. That's why I want the output of the print rather than the export for the policies.
sorryI have asked for /ip ipsec policy print detail. But what bothers me here is that the dynamically generated policy for the phone is marked as I (Invalid), which makes little sense to me given that there is only a single actual policy - the rest are templates.
But talking nicely to the ISP might be an easier way?
Here it’s not at all clear what needs to be done and why?You may also consider following this link.
No. Sniff into a file on the Mikrotik itself as you supposedly did before, connect to the unreachable site from a phone connected via IKEv2, then stop sniffing, download the file to a PC and open it using Wireshark.Wireshark I'm running it on a PC that connects to Mikrotik via IKEv2, right?
That's just an offer for a direct contact if you feel that a more interactive communication (in your native language) could help.Here it’s not at all clear what needs to be done and why?
when opening sites (that are not accessible)Then try opening that site and open the file in Wireshark
ok
That's just an offer for a direct contact if you feel that a more interactive communication (in your native language) could help.
To provide a conclusion to the story: the root cause of the issue was a dst-nat rule matching on in-interface-list=WANxy but not taking into account whether the packet coming in through WAN was indeed a "direct" one coming to the public IP address of the WAN or an IPsec payload one extracted from a transport packet (the latter inherits the in-interface attribute from the transport one). So connections to regular web sites (HTTPS over TCP port 443) that came in via an IPsec SA got redirected to an internal address, and the most likely reason why Google sites worked was that the browser uses QUIC (on UDP port 443) instead of TCP to connect to them so the rule didn't affect these connections.Apps work well, google yeilds search results yet 90% websites don't load.