I managed to have traceroute and tracepath going between 2 different RFC1918 subnets in a site2site ipsec vpn behind public IPs. That without using the fancy solution of creating GRE protected interfaces (the poor man Routeros equivalent of the Virtual Tunnel Interface that you have on Cisco or Juniper):
(192.168.1.0/24)--Routeros on PublicIP1------INTERNET-------Routeros on PublicIP2---(192.168.2.0/24)
It's a tipical Site2Site VPN:
SITE1:
/ip ipsec peer
add address=198.51.100.1/32 auth-method=rsa-key key=online_site1-key profile=profile_site1-site2 \
remote-key=online_site2-key
/ip ipsec policy
add dst-address=192.168.2.0/24 proposal=myproposal sa-dst-address=\
198.51.100.1 sa-src-address=203.0.113.1 src-address=192.168.1.0/24 tunnel=yes
SITE2:
/ip ipsec peer
add address=203.0.113.1/32 auth-method=rsa-key key=online_site2-key profile=profile_site2-site1 \
remote-key=online_site1-key
/ip ipsec policy
add dst-address=192.168.1.0/24 proposal=myproposal sa-dst-address=\
203.0.113.1 sa-src-address=198.51.100.1 src-address=192.168.2.0/24 tunnel=yes
Doing tracepath and/or traceroute from 2 linux machine on either lan gives an icmp out on the WAN interface that obviously is dropped from the upstream internet gateway.
traceroute to 192.168.2.13 (192.168.2.13), 30 hops max, 38 byte packets
1 192.168.1.1 (192.168.1.1) 0.436 ms 0.362 ms 0.294 ms
2 * * *
3 192.168.2.13 (192.168.2.13) 24.262 ms 21.836 ms 22.374 ms
My solution was (as already suggested here) creating a new ipsec policy for the public IP that correctly gives out
traceroute to 192.168.2.13 (192.168.2.13), 30 hops max, 38 byte packets
1 192.168.1.1 (192.168.1.1) 0.436 ms 0.362 ms 0.294 ms
2 198.51.100.1 (198.51.100.1) 20.222 ms 11.836 ms 12.391 ms
3 192.168.2.13 (192.168.2.13) 24.262 ms 21.836 ms 22.374 ms
Anyway, putting on the following rules on the two sites I could remove the ipsec policy for the public ip addresses and have the tracepath/traceroute going well:
SITE1:
/ip route
add dst-address=192.168.2.0/24 gateway=ether1 pref-src=\
192.168.1.1
SITE2:
/ip route
add distance=1 dst-address=192.168.1.0/24 gateway=ether1 pref-src=192.168.2.1
the gateway=ether1 is something put here but not really needed. Its not the public interface (that really is a PPoE thing). The policy rule takes the traffic before the route rule, that is needed only to correctly "source" tha ICMP response packet originated from the router.
The final output is like this:
traceroute to 192.168.2.13 (192.168.2.13), 30 hops max, 38 byte packets
1 192.168.1.1 (192.168.1.1) 0.673 ms 0.696 ms 0.632 ms
2 192.168.2.1 (192.168.2.1) 22.670 ms 22.174 ms 22.386 ms
3 192.168.2.13 (192.168.2.13) 22.440 ms 23.426 ms 22.452 ms
So, the ipsec-encapsulating-decapsulating routers correctly respond to the ICMP packets, from the right (and tunneled) IP, without involving the public IP, and this way there is no need for a new IPsec policy.