I upgraded my box to FreeBSD 9.1-RELEASE-p11 #2 sometime ago and very recently security/ipsec-tools and net/mpd5 to ipsec-tools-0.8.1_7 and mpd5-5.7_1after which VPN connection from my iPhone worked fine just once but failed subsequently until I restarted racoon daemon. Having restarted racoon, it worked again only once but again failed unless I restarted racoon (It worked if I reconnect immediately but if I wait for say 2 mins and try to connect from the same IP address, it failed).
FYI it was working flawlessly until those upgrades.
After days of troubleshooting and googling, it appears the culprit is a stale SA Database entry:
This SAD (racoon box <> iPhone pair) is always stuck there whereas the reverse pair (i.e. iPhone <> racoon box) got flushed no problem after my iPhone disconnect the VPN connection.
As I mentioned, restarting racoon or flushing the stale SAD entry with
Any pointer toward a solution is much appreciated.
FYI it was working flawlessly until those upgrades.
After days of troubleshooting and googling, it appears the culprit is a stale SA Database entry:
Code:
# setkey -Da
x.x.x.x[racoon box] y.y.y.y[iPhone]
esp mode=transport spi=160981142(0x09986096) reqid=16386(0x00004002)
E: rijndael-cbc 2b4aad27 6ff97ddc d1525a51 71628bc2 890044eb 6b26861c 0794b4f7 c24867bf
A: hmac-sha1 bde920e7 2dcdc954 1622f681 5e7b1e41 db3249de
seq=0x0000000f replay=4 flags=0x00000000 state=mature
created: Feb 3 21:36:32 2015 current: Feb 3 22:19:06 2015
diff: 2554(s) hard: 3600(s) soft: 2880(s)
last: Feb 3 21:37:38 2015 hard: 0(s) soft: 0(s)
current: 2120(bytes) hard: 0(bytes) soft: 0(bytes)
allocated: 15 hard: 0 soft: 0
sadb_seq=0 pid=2752 refcnt=2
As I mentioned, restarting racoon or flushing the stale SAD entry with
# setkey -DF allowed my iPhone to connect again but just once.Any pointer toward a solution is much appreciated.