Hello everyone, I need help with Gre over IPSec.
I apologize for my English - I use Google Translate.
There is a CHR in the cloud, which has a white IP address and domain name. There are remote offices in which Mikrotik routers are installed. To connect remote offices, I use Gre tunnels that fall under IPSec policies. Gre tunnels are directed to the CHR, which is responsible for routing (I use OSPF). That is, the CHR is the central router that connects all clients. Certificates are used for authentication.
Of the features - I configure two Gre tunnels on each client. The interfaces of these two tunnels are in different VRFs. In this way, I route and isolate two conditional networks: MGMT (for network devices) and WORK (for client devices in the office).
The problem is that sometimes one of the two tunnels does not work. Although before that it worked fine. I suspect that the problems start after the router in the remote office is switched to a "backup" provider.
Here is a typical remote office config (current version RouterOS 7.20.4):
/ip ipsec mode-config add name=ike2_conf responder=no
/ip ipsec policy group add name=ike2_policies
/ip ipsec profile add dh-group=modp2048 enc-algorithm=aes-128 hash-algorithm=sha256 name=ike_sa
/ip ipsec peer add address=ipsec.blabla.com exchange-mode=ike2 name=ike2_peer_core profile=ike_sa
/ip ipsec proposal add auth-algorithms=sha256 enc-algorithms=aes-256-cbc name=ike_auth pfs-group=none
/ip ipsec identity add auth-method=digital-signature certificate=ipsec.client.blabla.com_ec.crt_0 generate-policy=port-strict mode-config=ike2_conf peer=ike2_peer_core policy-template-group=ike2_policies
/ip ipsec policy add group=ike2_policies proposal=ike_auth template=yes
/interface gre add allow-fast-path=no local-address=192.168.70.1 mtu=1420 name=gre_core_mgmt remote-address=192.168.70.254
/interface gre add allow-fast-path=no local-address=192.168.70.1 mtu=1420 name=gre_core_work remote-address=192.168.70.253
/ip firewall address-list add address=192.168.7.1 list=hosts_ipsec_local
/ip firewall address-list add address=192.168.7.254 list=hosts_ipsec_remote
/ip firewall address-list add address=192.168.7.253 list=hosts_ipsec_remote
/ip firewall raw add action=notrack chain=prerouting dst-address-list=hosts_ipsec_local in-interface-list=WANs ipsec-policy=in,ipsec protocol=gre src-address-list=hosts_ipsec_remote
/ip firewall raw add action=accept chain=prerouting dst-address-list=hosts_ipsec_local in-interface-list=WANs ipsec-policy=in,ipsec protocol=gre src-address-list=hosts_ipsec_remote
/ip firewall filter add action=accept chain=output ipsec-policy=out,ipsec out-interface-list=WANs protocol=gre
/ip firewall filter add action=drop chain=output out-interface-list=WANs protocol=gre
Here is a config of the central CHR (current version RouterOS 7.20.5):
/interface bridge add fast-forward=no name=lo_ipsec_main port-cost-mode=short protocol-mode=none
/interface bridge add fast-forward=no name=lo_ipsec_work port-cost-mode=short protocol-mode=none
/ip address add address=192.168.70.254 interface=lo_ipsec_main network=192.168.70.254
/ip address add address=192.168.70.253 interface=lo_ipsec_work network=192.168.70.253
/interface gre add allow-fast-path=no local-address=192.168.70.254 mtu=1420 name=gre_client1_mgmt remote-address=192.168.70.1
/interface gre add allow-fast-path=no local-address=192.168.70.253 mtu=1420 name=gre_client1_work remote-address=192.168.70.1
/ip ipsec mode-config add address=192.168.70.1 name=ike2_conf_client split-include=192.168.70.254/32,192.168.70.253/32 system-dns=no
/ip ipsec policy group add name=ike2_policies
/ip ipsec profile set [ find default=yes ] dpd-interval=2m dpd-maximum-failures=5
/ip ipsec profile add dh-group=modp2048 dpd-interval=2m dpd-maximum-failures=5 enc-algorithm=aes-128 hash-algorithm=sha256 name=ike_sa
/ip ipsec peer add exchange-mode=ike2 name=ike2_peer passive=yes profile=ike_sa
/ip ipsec proposal add auth-algorithms=sha256 enc-algorithms=aes-256-cbc name=ike_auth pfs-group=none
/ip ipsec identity add auth-method=digital-signature certificate=ipsec.blabla.com_ec.crt_0 generate-policy=port-strict match-by=certificate mode-config=ike2_conf_client peer=ike2_peer policy-template-group=ike2_policies remote-certificate=ipsec.client.blabla.com_ec.crt_0
/ip ipsec policy add dst-address=192.168.70.0/24 group=ike2_policies proposal=ike_auth src-address=192.168.70.254/32 template=yes
/ip ipsec policy add dst-address=192.168.70.0/24 group=ike2_policies proposal=ike_auth src-address=192.168.70.253/32 template=yes
/ip firewall address-list add address=192.168.70.254 list=hosts_ipsec_local
/ip firewall address-list add address=192.168.70.253 list=hosts_ipsec_local
/ip firewall address-list add address=192.168.70.0/24 list=hosts_ipsec_remote
/ip firewall raw add action=notrack chain=prerouting dst-address-list=hosts_ipsec_local in-interface-list=WANs ipsec-policy=in,ipsec protocol=gre src-address-list=hosts_ipsec_remote
/ip firewall raw add action=accept chain=prerouting dst-address-list=hosts_ipsec_local in-interface-list=WANs ipsec-policy=in,ipsec protocol=gre src-address-list=hosts_ipsec_remote
/ip firewall filter add action=accept chain=output ipsec-policy=out,ipsec out-interface-list=WANs protocol=gre
/ip firewall filter add action=drop chain=output out-interface-list=WANs protocol=gre
This is what it looks like from the central CHR side
I hope I have described the situation clearly.



