Hello,
Apologies if this is a stupid question. I am new to both Cisco and Mikrotik.
I am trying to set up a series of remote office VPNs using Mikroik 951G-2HnDs (running 5.24) to a central Cisco 1941w. The remote sites are on Dynamic IPs and the central Cisco is on a fixed range of IPs behind a NATless set of bonded ADSL lines (1.1.1.128/25 in this case… obfuscated for obvious reasons).
I’ve managed to get a tunnel working using the guides here http://www.mikrotik.com/testdocs/ros/3.0/vpn/ipsec.php and here http://wiki.mikrotik.com/wiki/MikroTik_router_to_CISCO_PIX_Firewall_IPSEC and have read several other quick config guides but I cannot manage to access resources on the other side of the tunnel. So far, this is what I have done:
- Added peer (with phase1 configuration parameters), 3DES and SHA1 will be used to protect IKE traffic
Mikrotik:
[admin@MikroTik] /ip ipsec peer> print
Flags: X - disabled
0 address=1.1.1.129/32 port=500 auth-method=pre-shared-key secret="test"
generate-policy=no exchange-mode=main send-initial-contact=yes
nat-traversal=no my-id-user-fqdn="" proposal-check=obey
hash-algorithm=md5 enc-algorithm=3des dh-group=modp1024 lifetime=1d
lifebytes=0 dpd-interval=2m dpd-maximum-failures=5
Cisco:
crypto isakmp policy 1
encr 3des
hash md5
authentication pre-share
group 2
!
crypto isakmp key test address 0.0.0.0 0.0.0.0
!
- Set encryption proposal (phase2 proposal - settings that will be used to encrypt actual data) to use 3DES to encrypt data
Mikrotik:
[admin@MikroTik] /ip ipsec proposal> print
Flags: X - disabled, * - default
0 * name="default" auth-algorithms=md5 enc-algorithms=3des lifetime=30m
pfs-group=modp1024
Cisco:
crypto ipsec transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac
! se mode to tunnel… which seems to be default
mode tunnel
!
- Add policy rule that matches traffic between subnets and requires encryption with ESP in tunnel mode
Mikrotik:
[admin@MikroTik] /ip ipsec policy> print
Flags: X - disabled, D - dynamic, I - inactive
0 src-address=192.168.5.0/24 src-port=any dst-address=1.1.1.128/25
dst-port=any protocol=all action=encrypt level=require
ipsec-protocols=esp tunnel=yes sa-src-address=0.0.0.0
sa-dst-address=1.1.1.129 proposal=default priority=0
Cisco:
crypto dynamic-map SDM_DYNMAP_1 1
set transform-set ESP-3DES-MD5
match address 100
!
access-list 100 remark CCP_ACL Category=4
access-list 100 remark IPSec Rule
access-list 100 permit ip 1.1.1.128 0.0.0.127 192.168.5.0 0.0.0.255
!
interface GigabitEthernet0/0
crypto map SDM_CMAP_1
!
- Set NAT on the Mikrotik (to make sure that packets are going through the tunnel):
[admin@MikroTik] /ip firewall nat> print
Flags: X - disabled, I - invalid, D - dynamic
0 chain=srcnat action=accept src-address=192.168.5.0/24
dst-address=1.1.1.128/25
1 ;;; default configuration
chain=srcnat action=masquerade to-addresses=0.0.0.0
out-interface=ether1-gateway
I have also created a firewall rule to allow VPN traffic through from the outside to 1.1.1.129, which the behind the set of bonded ADSL lines. After establishing the tunnel it seems to be up:
Mikrotik:
[admin@MikroTik] /ip ipsec installed-sa> print
Flags: A - AH, E - ESP, P - pfs
0 E spi=0xAE90866 src-address=1.1.1.129 dst-address=[THE.REMOTE.DYNAMIC.IP]
auth-algorithm=md5 enc-algorithm=3des replay=4 state=mature
auth-key="3f3a0e6d04d5c6652cf4b846099ace9e"
enc-key="6b5c571d524685b7f21b4d20bad69b230e5066ee4ae6c0d6"
add-lifetime=24m/30m
1 E spi=0x413352F9 src-address=[THE.REMOTE.DYNAMIC.IP] dst-address=1.1.1.129
auth-algorithm=md5 enc-algorithm=3des replay=4 state=mature
auth-key="8509280cf5a6e8bf9d8857fe53ab97c2"
enc-key="8d9b29268fd25c1bd06c12a8454e0f22fa49ee3ef42ca963"
addtime=mar/05/2013 17:57:36 expires-in=12m2s add-lifetime=24m/30m
current-bytes=5760
Cisco:
firewall#show crypto ipsec sa
interface: GigabitEthernet0/0
Crypto map tag: SDM_CMAP_1, local addr 1.1.1.129
protected vrf: (none)
local ident (addr/mask/prot/port): (1.1.1.128/255.255.255.128/0/0)
remote ident (addr/mask/prot/port): (192.168.5.0/255.255.255.0/0/0)
current_peer [THE.REMOTE.DYNAMIC.IP] port 500
PERMIT, flags={}
#pkts encaps: 0, #pkts encrypt: 0, #pkts digest: 0
#pkts decaps: 231, #pkts decrypt: 231, #pkts verify: 231
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 0, #recv errors 0
local crypto endpt.: 1.1.1.129, remote crypto endpt.: [THE.REMOTE.DYNAMIC.IP]
path mtu 1500, ip mtu 1500, ip mtu idb GigabitEthernet0/0
current outbound spi: 0x8226DC8(136474056)
PFS (Y/N): Y, DH group: group2
inbound esp sas:
spi: 0xBE4A2A77(3192531575)
transform: esp-3des esp-md5-hmac ,
in use settings ={Tunnel, }
conn id: 2113, flow_id: Onboard VPN:113, sibling_flags 80000046, crypto map: SDM_CMAP_1
sa timing: remaining key lifetime (k/sec): (4585250/1001)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE
inbound ah sas:
inbound pcp sas:
outbound esp sas:
spi: 0x8226DC8(136474056)
transform: esp-3des esp-md5-hmac ,
in use settings ={Tunnel, }
conn id: 2114, flow_id: Onboard VPN:114, sibling_flags 80000046, crypto map: SDM_CMAP_1
sa timing: remaining key lifetime (k/sec): (4585250/1001)
IV size: 8 bytes
replay detection support: Y
Status: ACTIVE
outbound ah sas:
outbound pcp sas:
So… the tunnel seems to be up but I just can’t seem to access resources on one side from the other.
I’ve run a tunnel test using CCP and It reports that the tunnel is fine. I’ve tried packet tracing on the Mikrotik gateway interface and encrypted packets seem to be exiting but I do not seem to be able to verify that the packets are entering on the other side or if they are being routed once there.
This guide talks about Dynamic Routing: http://wiki.mikrotik.com/wiki/IPSec_VPN_with_Dynamic_Routing_/_Mikrotik_and_Cisco but seems to require an IPIP connection. In my case I do not believe that it will work with dynamic IPs.
My gut feel is that the packets are not be routed properly on the Cisco but I can not figure out why nor can I determine how to prove this. Packet tracing seems difficult on the Cisco.
Is there anyone here who might be able to help point me in the right direction?
Thanks & Regards
Chris
