IPSec VPN is established, but traffic isn't sent through it
Posted: Sat Feb 03, 2018 7:27 pm
I'm working on a setup that will eventually turn into a site-to-site VPN via the internet. For now it's a collection of "test lab" hardware all on one desk for easy testing. The topology is as shown in the attached image: one laptop connected to router A using the 10.0.84.0/24 network, one laptop connected to router B using the 10.0.85.0/24 network, the two routers linked together via a smart switch and using the 10.0.80.0/24 network. The smart switch and the laptop attached to it represent the internet; I've configured port mirror on the switch so that the attached T530 laptop can capture traffic between the two routers.
Next step: encrypt the A-B link with IPsec. I remove those two static routes and set up IPsec peers, proposals, and policies.
/export from router A:
/export from router B:
As you see they're very basic. No firewall, no NAT, no extra stuff connected, all static IP, no default routes, etc. Both routers have been reset without default config.
The IPsec seems to be connected fine: /ip ipsec remote-peers print shows established on both routers; /ip ipsec installed-sa print shows an SA for each direction.
The trouble is, every how-to I've read gets to this point and says "That's it! Traffic should pass through the link now." But when I try to ping from T420 or from router A to either 10.0.85.1 or 10.0.85.2 I'm told there's no route to host. Sure enough, there's nothing in the routing table for that. If I put my static routes back the pings go through but they're not encrypted; they go along side the VPN tunnel rather than through it.
What am I missing?
If I add the appropriate static routes (on A a route to 10.0.85.0/24 via gateway 10.0.80.1; on B a route to 10.0.84.0/24 via gateway 10.0.80.2) then all 4 devices (T420, Dell, router A, router B) can ping to every other device. When I run wireshark on the T530 it can see the unencrypted traffic between routers A and B.Next step: encrypt the A-B link with IPsec. I remove those two static routes and set up IPsec peers, proposals, and policies.
/export from router A:
Code: Select all
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip ipsec proposal
add auth-algorithms=sha256 enc-algorithms=aes-256-cbc name=testlab
/ip neighbor discovery-settings
set discover-interface-list=!dynamic
/ip address
add address=10.0.84.1/24 interface=ether4 network=10.0.84.0
add address=10.0.80.2/24 interface=ether1 network=10.0.80.0
/ip ipsec peer
add address=10.0.80.1/32 dh-group=modp1024 enc-algorithm=aes-256 \
hash-algorithm=sha256 local-address=10.0.80.2 nat-traversal=no secret=\
bananapeels
/ip ipsec policy
add dst-address=10.0.85.0/24 level=unique proposal=testlab sa-dst-address=\
10.0.80.1 sa-src-address=10.0.80.2 src-address=10.0.83.0/24 tunnel=yes
/system routerboard mode-button
set enabled=no on-event=""
Code: Select all
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip ipsec proposal
add auth-algorithms=sha256 enc-algorithms=aes-256-cbc name=testlab
/ip neighbor discovery-settings
set discover-interface-list=!dynamic
/ip address
add address=10.0.80.1/24 interface=ether2 network=10.0.80.0
add address=10.0.85.1/24 interface=ether5 network=10.0.85.0
/ip ipsec peer
add address=10.0.80.2/32 dh-group=modp1024 enc-algorithm=aes-256 \
hash-algorithm=sha256 local-address=10.0.80.1 nat-traversal=no secret=\
bananapeels send-initial-contact=no
/ip ipsec policy
add dst-address=10.0.83.0/24 level=unique proposal=testlab sa-dst-address=\
10.0.80.2 sa-src-address=10.0.80.1 src-address=10.0.85.0/24 tunnel=yes
/system routerboard mode-button
set enabled=no on-event=""
The IPsec seems to be connected fine: /ip ipsec remote-peers print shows established on both routers; /ip ipsec installed-sa print shows an SA for each direction.
The trouble is, every how-to I've read gets to this point and says "That's it! Traffic should pass through the link now." But when I try to ping from T420 or from router A to either 10.0.85.1 or 10.0.85.2 I'm told there's no route to host. Sure enough, there's nothing in the routing table for that. If I put my static routes back the pings go through but they're not encrypted; they go along side the VPN tunnel rather than through it.
What am I missing?