Hi guys.
At one of my clients I have to change Cisco router with Mikrotik. In ipsec they have nat translation - that means that LAN subnet is 192.168.1.0/24, but through ipsec tunnel this subnet is ‘‘advertised’’ as a subnet 10.99.62.0/24.
Can that be done with:
ip firewall nat add src-address=192.168.1.0/24 dst-address=10.3.248.82 action=src-nat to-addresses=10.99.62.0/24
Will every ip from 192.168… subnet be src-nated from 10.99.62.0/24 pool, or I have to make dummy bridge and put on all 254 ip addresses from 10.99.. subnet and than make 254 rules in nat…?
Bellow is copy/paste from cisco…
zzzz#show crypto ipsec sa
interface: FastEthernet0/0
Crypto map tag: CM-VPN, local addr x.x.x.x
Yes, this will work, though I would use action=netmap instead of action=src-nat in this case. Also do not forget to specify chain. And you will have to specify the 10.99.62.0/24 network as a source in the IPsec policy.
Thanks…
I’ll try with netmap. Although I must admit I don’t fully understand what the difference between action=src-nat and netmap…
I’ll report on final setup in about a week…
I would like to ask for a little more help. I don’t fully understand cisco sintaks. Please check if I understand configuration correctly. Bellow is sample from cisco and corespond example of command in RouterOS… I know how to setup parameters in Mikrotik, I would like to only check if I’ve understand Cisco configuration…
RouterOS:
ip ipsec peer add hash-algorithm=sha1 enc-algorithm=3des dh-group=modp1536 …
netmap maps IP addresses 1:1 and never changes port numbers, whereas src-nat may change source port as well.
I don’t really have time right now to review you configuration, but here’s a couple of tips. The “crypto ikev1 policy” (or “crypto isakmp policy”) configuration blocks refer to phase1 (peer configuration in Mikrotik). All the defined policies are common to all peers (but only one is negotiated and used). The “crypto map” configuration blocks refer to phase2 (IPsec proposals in Mikrotik). Access list that “crypto map” block refers to is your IPsec policies. The rest should be easy to guess.
Also please specify what Cisco are you migrating from, running ios or ASA.
Thanks… I was thinking the same, but I couldn’t find nice article about which phase is configured where in cisco.. In mikrotik is pretty obvious and easy to understand (for me) which phase is configured in which module…
One more question…
All the defined policies are common to all peers (but only one is negotiated and used).
How are the negotiated? Are they ‘‘tried’’ in order - like firewall rules and first which applies, is negotiated, or is it some other logic…?
No. First, please note that what Cisco calls “iskmp policy” is, in fact, a phase1 proposal. Initiator sends a list of proposals it is willing to support, and responder just accepts one from the list (or responds with NO_PROPOSAL_CHOSEN error in case no supported proposal is offered). This is how IPsec works irrespective of the vendor. And also this algorithm is common for both phase1 and phase2, just the list of proposals may be different for each.