Hi,
I’ve configured IPSec between two mikrotiks. One is a RB1200. The other is a RB493G.
Current setup is.
Local=10.1.202.1----Public=192.168.90.1 —Internet— Public=192.168.80.1—Local=10.1.101.1
I can not get a tunnel to establish with IPsec. When I ping the private network (10.1.101.1) which is on the remote router it fails every time. I can successful ping the wan ip address (192.168.80.1) on the remote router no problem.
HOST SIZE TTL TIME STATUS
10.1.101.1 timeout
10.1.101.1 timeout
192.168.90.254 84 64 994ms host unreachable
HOST SIZE TTL TIME STATUS
192.168.80.1 56 63 5ms
192.168.80.1 56 63 0ms
192.168.80.1 56 63 0ms
My ip ipsec statistics are:
[admin@MikroTik] >> ip ipsec statistics print
in-errors: 0
in-buffer-errors: 0
in-header-errors: 0
in-no-states: 0
in-state-protocol-errors: 0
in-state-mode-errors: 0
in-state-sequence-errors: 0
in-state-expired: 0
in-state-mismatches: 0
in-state-invalid: 0
in-template-mismatches: 0
in-no-policies: 0
in-policy-blocked: 0
in-policy-errors: 0
out-errors: 0
out-bundle-errors: 0
out-bundle-check-errors: 0
out-no-states: 0
out-state-protocol-errors: 0
out-state-mode-errors: 0
out-state-sequence-errors: 0
out-state-expired: 0
out-policy-blocked: 0
My Install SAs are blank on both routes. When I use packet sniffer, I do not see any IPsec protocols being used.
My logs say this:
aug/16/2013 15:40:39 system,info router rebooted
aug/16/2013 15:40:39 ipsec,debug @(#)This product linked OpenSSL 1.0.0e 6 Sep 2011
(http://www.openssl.org/)
aug/16/2013 15:40:39 ipsec,debug call pfkey_send_register for AH
aug/16/2013 15:40:39 ipsec,debug call pfkey_send_register for ESP
aug/16/2013 15:40:39 ipsec,debug call pfkey_send_register for IPCOMP
aug/16/2013 15:40:39 ipsec,debug initializing scheduler…
aug/16/2013 15:40:39 ipsec,debug initializing policies…
aug/16/2013 15:40:39 ipsec,debug initializing cfg…
aug/16/2013 15:40:39 ipsec,debug,packet installing phase2 config: id=0
aug/16/2013 15:40:39 ipsec,debug AddressHandler init
aug/16/2013 15:40:39 ipsec,debug 192.168.90.1[500] used as isakmp port (fd=14)
aug/16/2013 15:40:39 ipsec,debug 192.168.90.1[4500] used as isakmp port with NAT-T
(fd=15)
aug/16/2013 15:40:39 ipsec,debug 10.1.202.1[500] used as isakmp port (fd=16)
aug/16/2013 15:40:39 ipsec,debug 10.1.202.1[4500] used as isakmp port with NAT-T (
fd=17)
aug/16/2013 15:40:39 ipsec,debug starting looper…
aug/16/2013 15:40:39 interface,info ether1 link up (speed 1000M, full duplex)
aug/16/2013 15:40:39 interface,info ether2 link up (speed 100M, full duplex)
aug/16/2013 15:40:39 system,info,account user admin logged in via winbox
aug/16/2013 15:40:39 system,info,account user admin logged in via local
aug/16/2013 15:40:39 ipsec,debug,packet installing phase2 config: id=0
aug/16/2013 15:40:39 ipsec,debug AddressHandler init
aug/16/2013 15:40:39 ipsec,debug 192.168.90.1[500] used as isakmp port (fd=14)
aug/16/2013 15:40:39 ipsec,debug 192.168.90.1[4500] used as isakmp port with NAT-T
(fd=15)
aug/16/2013 15:40:39 ipsec,debug 10.1.202.1[500] used as isakmp port (fd=16)
aug/16/2013 15:40:39 ipsec,debug 10.1.202.1[4500] used as isakmp port with NAT-T (
fd=17)
aug/16/2013 15:40:39 ipsec,debug starting looper…
aug/16/2013 15:40:39 interface,info ether1 link up (speed 1000M, full duplex)
aug/16/2013 15:40:39 interface,info ether2 link up (speed 100M, full duplex)
aug/16/2013 15:40:39 system,info,account user admin logged in via winbox
aug/16/2013 15:40:39 system,info,account user admin logged in via local
My firewall connections say this:
[admin@MikroTik] > /ip firewall connection print
Flags: S - seen reply, A - assured
PROTOCOL SRC-ADDRESS DST-ADDRESS TCP-STATE TIMEOUT
0 icmp 192.168.90.1 10.1.101.1 9s
1 udp 10.1.202.1:5678 255.255.255.255:5678 9s
2 udp 192.168.90.1:5678 255.255.255.255:5678 9s
3 udp 169.254.204.98:55871 255.255.255.255:20561 9s
Router 1 is setup like below:
[admin@MikroTik] > /export compact
aug/16/2013 15:50:59 by RouterOS 5.25
software id = BY1X-VYZY
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m
/system logging action
add name=ipsec target=memory
/ip address
add address=192.168.90.1/24 interface=ether1
add address=10.1.202.1/24 interface=ether2
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 name=router
/ip firewall filter
add chain=input protocol=ipsec-esp
add chain=input dst-port=1723 protocol=tcp
add chain=input dst-port=500 protocol=udp
add chain=input dst-port=4500 protocol=udp
add chain=input protocol=ipsec-ah
add chain=input protocol=gre
/ip firewall nat
add chain=srcnat dst-address=10.1.101.0/24 src-address=10.1.202.0/24
add action=masquerade chain=srcnat out-interface=ether1
/ip ipsec peer
add address=192.168.80.1/32 generate-policy=yes nat-traversal=yes secret=test
/ip ipsec policy
add dst-address=10.1.101.0/24 sa-dst-address=192.168.80.1 sa-src-address=192.168.90.1 src-address=10.1.202.0/24 tunnel=yes
/ip route
add distance=1 gateway=192.168.90.254
/system logging
add topics=ipsec
[admin@MikroTik] >
Router 2 is setup like below:
aug/16/2013 15:54:43 by RouterOS 5.25
software id = PKZ1-PH3Y
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m
/system logging action
add name=ipsec target=memory
add name=firewall target=memory
/ip address
add address=192.168.80.1/24 interface=ether2
add address=10.1.101.1/24 interface=ether3
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 name=router
/ip firewall filter
add chain=input protocol=gre
add chain=input dst-port=1723 protocol=tcp
add chain=input dst-port=500 protocol=udp
add chain=input dst-port=4500 protocol=udp
add chain=input protocol=ipsec-esp
add chain=input protocol=ipsec-ah
/ip firewall nat
add chain=srcnat dst-address=10.1.202.0/24 src-address=10.1.101.0/24
add action=masquerade chain=srcnat out-interface=ether2
/ip ipsec peer
add address=192.168.90.1/32 generate-policy=yes nat-traversal=yes secret=test
/ip ipsec policy
add dst-address=10.1.202.0/24 sa-dst-address=192.168.90.1 sa-src-address=192.168.80.1 src-address=10.1.101.0/24 tunnel=yes
/ip route
add distance=1 gateway=192.168.80.254
/system logging
add topics=ipsec
add topics=firewall
Can someone please tell me what I am doing wrong?