Hi!
Sorry for my poor English. I have problem
R1 and R2 connect each other with IPsec and IPIP tunnel. On R1 created rule NAT masquerade to get internet from R3 to PC1 and this is problem, i need that SRV1 see real IP of PC1 (192.168.6.20) and R3 see PC1 (192.168.6.20) as R1 (192.168.0.25) What rule on R1 I need to do?
Make your masquerade rule more specific so it does not translate what you don’t want it to translate.
This can be done using Src.address and Dst.address fields, the output interface, and also you can add
a second rule with the conditions you do NOT want to translate and do action “accept” in that rule.
Another way would be to make your srcnat rule only reference the WAN interface at each site.
Since you’re using IPIP tunnels, site-to-site traffic technically doesn’t go through the WAN interface, but the IPIP interface.
e.g.
/ip firewall nat
add chain=srcnat out-interface=ether1-gateway action=masquerade
This is the cleanest method in my opinion because it describes the policy: “Use my public IP as the source when going on the Internet,” but it doesn’t get bogged down with specific IP addresses. If you add more sites, then no changes are needed. If you decided to start using other internal IP ranges, no changes are needed. It also has the added bonus of adaptability because R2 can have the primary default GW be through the IPIP tunnel to R1, but have a backup default GW directly to the Internet, so if R1 goes down or loses its Internet connection, PC1 can still use the local Internet.
I agree with that. I think it is also the default configuration.
Unfortunately it does not work with “IPsec tunnels” because there is no separate virtual interface for the tunnel.
But indeed with IPIP tunnels it works OK. In fact, it is often better to use IPIP over IPsec transport than to use
IPsec tunnel mode, because of the issues there are in the Linux/RouterOS implementation. Of course, the other
side has to agree with that.
Not to mention the fact that you can run routing protocols on the tunnel interface and have arbitrary dynamic topology on the other side without having to maintain a list of selectors. I really really really dislike raw IPSec.
Unfortunately there are no multipoint tunnel protocols in RouterOS (IPIP mesh, multipoint GRE, NHRP etc) so it does
not scale well and is hard to make a roadwarrior VPN.