Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ASG Site 2 Site to OpenSwan

Hi there,

I try this for at least three months now and can't get this to work. I have absolutely no idea why the site-to-site VPN won't establish. On one site I have the Astaro which is configured like this:

Connection


Remote Gateway


Policy



The ipsec.conf on the OpenSwan Server:
#   NODES S2S VPN Config
#--------------------------
# Last changed: 20.08.2011

version 2.0

#Grundkonfiguration
config setup
forwardcontrol=yes
interfaces="ipsec0=eth0"
nat_traversal=yes
uniqueids=no
  klipsdebug=all
plutodebug=all
nhelpers=0
# protostack=netkey

#Default Parameter
conn %default
      disablearrivalcheck=no
      
#Site 2 Site VPN NODES.net Hainburg
conn CORE-S2S-HIB
type=tunnel
authby=secret
pfs=no
compress=no
keyexchange=ike
auth=esp
ike=aes256-md5-modp2048
ikelifetime=7800s
esp=3des-sha1
keylife=3600s
left=212.72.184.221
leftsubnet=172.21.0.0/16
leftsourceip=172.21.0.1
leftnexthop=212.72.184.1
right=nodes.webhop.net
rightsubnet=192.168.210.0/24
rightsourceip=192.168.210.1
rightnexthop=212.72.184.1
auto=add

The status of ipsec auto --status looks like this:
000 interface lo/lo ::1
000 interface lo/lo 127.0.0.1
000 interface lo/lo 127.0.0.1
000 interface eth0/eth0 212.72.184.221
000 interface eth0/eth0 212.72.184.221
000 interface eth0/eth0 172.21.0.1
000 interface eth0/eth0 172.21.0.1
000 %myid = (none)
000 debug raw+crypt+parsing+emitting+control+lifecycle+klips+dns+oppo+controlmore+pfkey+nattraversal+x509
000
000 algorithm ESP encrypt: id=2, name=ESP_DES, ivlen=8, keysizemin=64, keysizemax=64
000 algorithm ESP encrypt: id=3, name=ESP_3DES, ivlen=8, keysizemin=192, keysizemax=192
000 algorithm ESP encrypt: id=7, name=ESP_BLOWFISH, ivlen=8, keysizemin=40, keysizemax=448
000 algorithm ESP encrypt: id=11, name=ESP_NULL, ivlen=0, keysizemin=0, keysizemax=0
000 algorithm ESP encrypt: id=12, name=ESP_AES, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=13, name=(null), ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=22, name=(null), ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=252, name=ESP_SERPENT, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=253, name=ESP_TWOFISH, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP auth attr: id=1, name=AUTH_ALGORITHM_HMAC_MD5, keysizemin=128, keysizemax=128
000 algorithm ESP auth attr: id=2, name=AUTH_ALGORITHM_HMAC_SHA1, keysizemin=160, keysizemax=160
000 algorithm ESP auth attr: id=5, name=AUTH_ALGORITHM_HMAC_SHA2_256, keysizemin=256, keysizemax=256
000 algorithm ESP auth attr: id=9, name=AUTH_ALGORITHM_AES_CBC, keysizemin=128, keysizemax=128
000 algorithm ESP auth attr: id=251, name=(null), keysizemin=0, keysizemax=0
000
000 algorithm IKE encrypt: id=5, name=OAKLEY_3DES_CBC, blocksize=8, keydeflen=192
000 algorithm IKE encrypt: id=7, name=OAKLEY_AES_CBC, blocksize=16, keydeflen=128
000 algorithm IKE hash: id=1, name=OAKLEY_MD5, hashsize=16
000 algorithm IKE hash: id=2, name=OAKLEY_SHA1, hashsize=20
000 algorithm IKE dh group: id=2, name=OAKLEY_GROUP_MODP1024, bits=1024
000 algorithm IKE dh group: id=5, name=OAKLEY_GROUP_MODP1536, bits=1536
000 algorithm IKE dh group: id=14, name=OAKLEY_GROUP_MODP2048, bits=2048
000 algorithm IKE dh group: id=15, name=OAKLEY_GROUP_MODP3072, bits=3072
000 algorithm IKE dh group: id=16, name=OAKLEY_GROUP_MODP4096, bits=4096
000 algorithm IKE dh group: id=17, name=OAKLEY_GROUP_MODP6144, bits=6144
000 algorithm IKE dh group: id=18, name=OAKLEY_GROUP_MODP8192, bits=8192
000
000 stats db_ops.c: {curr_cnt, total_cnt, maxsz} :context={0,4,36} trans={0,4,540} attrs={0,4,360}
000
000 "CORE-S2S-HIB": 172.21.0.0/16===212.72.184.221---212.72.184.1...212.72.184.1---84.165.201.247===192.168.210.0/24; unrouted; eroute owner: #0
000 "CORE-S2S-HIB":     srcip=172.21.0.1; dstip=192.168.210.1; srcup=ipsec _updown; dstup=ipsec _updown;
000 "CORE-S2S-HIB":   ike_life: 7800s; ipsec_life: 3600s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0
000 "CORE-S2S-HIB":   policy: PSK+ENCRYPT+TUNNEL+UP; prio: 16,24; interface: eth0; encap: esp;
000 "CORE-S2S-HIB":   newest ISAKMP SA: #1; newest IPsec SA: #0;
000 "CORE-S2S-HIB":   IKE algorithms wanted: AES_CBC(7)_256-MD5(1)-MODP2048(14); flags=strict
000 "CORE-S2S-HIB":   IKE algorithms found: AES_CBC(7)_256-MD5(1)_128-MODP2048(14)
000 "CORE-S2S-HIB":   IKE algorithm newest: AES_CBC_256-MD5-MODP2048
000 "CORE-S2S-HIB":   ESP algorithms wanted: 3DES(3)_000-SHA1(2); flags=strict
000 "CORE-S2S-HIB":   ESP algorithms loaded: 3DES(3)_000-SHA1(2); flags=strict
000
000 #1: "CORE-S2S-HIB":500 STATE_MAIN_I4 (ISAKMP SA established); EVENT_SA_REPLACE in 6178s; newest ISAKMP; lastdpd=-1s(seq in:0 out:0)
000

And the connection status on the ASG shows this:


What am I doing wrong? Please help me I'm almost out of hairs on my head ...


Kind regards,
Hyperlord


This thread was automatically locked due to age.
  • Please show the Astaro IPsec log for this connection attempt.

    Cheers - Bob
  • Hi Bob,

    thanks in advance! Here is the log, let me know, if you like to see more details or more debug levels.





    Live Log: IPSec VPN
     



    Filter:
     





    Autoscroll



    2011:08:21-19:12:48 NODES-FW1 pluto[29916]: | kernel_alg_esp_auth_keylen(auth=1, sadb_aalg=2): a_keylen=16
     
    2011:08:21-19:12:48 NODES-FW1 pluto[29916]: | kernel_alg_esp_auth_keylen(auth=1, sadb_aalg=2): a_keylen=16
     
    2011:08:21-19:12:48 NODES-FW1 pluto[29916]: | kernel_alg_esp_auth_keylen(auth=2, sadb_aalg=3): a_keylen=20
     
    2011:08:21-19:12:48 NODES-FW1 pluto[29916]: | next event EVENT_SHUNT_SCAN in 6 seconds
     
    2011:08:21-19:12:54 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:12:54 NODES-FW1 pluto[29916]: | *time to handle event 

    2011:08:21-19:12:54 NODES-FW1 pluto[29916]: | event after this is EVENT_REINIT_SECRET in 3234 seconds
     
    2011:08:21-19:12:54 NODES-FW1 pluto[29916]: | inserting event EVENT_SHUNT_SCAN, timeout in 120 seconds
     
    2011:08:21-19:12:54 NODES-FW1 pluto[29916]: | scanning for shunt eroutes 

    2011:08:21-19:12:54 NODES-FW1 pluto[29916]: | next event EVENT_SHUNT_SCAN in 120 seconds
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: | *received whack message 

    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: forgetting secrets 

    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: loading secrets from "/etc/ipsec.secrets"
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: loaded shared key for 0.0.0.0 84.165.195.80
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: loaded shared key for 0.0.0.0 192.168.1.1
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: loaded shared key for 212.72.184.221 84.165.195.80
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: loaded shared key for 0.0.0.0 84.165.195.80
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: loaded shared key for 0.0.0.0 84.165.195.80
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: Changing to directory '/etc/ipsec.d/cacerts'
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: loaded CA cert file 'VPN Signing CA.pem' (3095 bytes)
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: | authcert is already present and identical
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: loaded CA cert file 'VPN Signing CA (Wed Sep 15 21:29:12 2010).pem' (3053 bytes)
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: | authcert is already present and identical
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: Changing to directory '/etc/ipsec.d/aacerts'
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: Changing to directory '/etc/ipsec.d/ocspcerts'
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: Changing to directory '/etc/ipsec.d/crls'
     
    2011:08:21-19:13:07 NODES-FW1 pluto[29916]: | next event EVENT_SHUNT_SCAN in 107 seconds
     
    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | *received whack message 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | from whack: got --esp=3des-sha1 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | esp string values: 3_000-2, 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | from whack: got --ike=aes256-md5-modp2048
     
    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | ike string values: 7_256-1-14, 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: added connection description "S_CORE-S2S-HIB"
     
    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | 192.168.210.0/24===84.165.195.80...212.72.184.221===172.21.0.0/16
     
    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | ike_life: 7800s; ipsec_life: 3600s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0; policy: PSK+ENCRYPT+TUNNEL
     
    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | next event EVENT_SHUNT_SCAN in 106 seconds
     
    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | *received whack message 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | creating state object #41 at 0x8120188
     
    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | ICOOKIE: 56 cb 68 81 ef 50 38 49 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | RCOOKIE: 00 00 00 00 00 00 00 00 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | peer: d4 48 b8 dd 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | state hash entry 25 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | inserting event EVENT_SO_DISCARD, timeout in 0 seconds for #41
     
    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | Queuing pending Quick Mode with 212.72.184.221 "S_CORE-S2S-HIB"
     
    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: "S_CORE-S2S-HIB" #41: initiating Main Mode
     
    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | 7_256-1-14, 

    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | inserting event EVENT_RETRANSMIT, timeout in 10 seconds for #41
     
    2011:08:21-19:13:08 NODES-FW1 pluto[29916]: | next event EVENT_RETRANSMIT in 10 seconds for #41
     
    2011:08:21-19:13:18 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:13:18 NODES-FW1 pluto[29916]: | *time to handle event 

    2011:08:21-19:13:18 NODES-FW1 pluto[29916]: | event after this is EVENT_SHUNT_SCAN in 96 seconds
     
    2011:08:21-19:13:18 NODES-FW1 pluto[29916]: | handling event EVENT_RETRANSMIT for 212.72.184.221 "S_CORE-S2S-HIB" #41
     
    2011:08:21-19:13:18 NODES-FW1 pluto[29916]: | inserting event EVENT_RETRANSMIT, timeout in 20 seconds for #41
     
    2011:08:21-19:13:18 NODES-FW1 pluto[29916]: | next event EVENT_RETRANSMIT in 20 seconds for #41
     
    2011:08:21-19:13:38 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:13:38 NODES-FW1 pluto[29916]: | *time to handle event 

    2011:08:21-19:13:38 NODES-FW1 pluto[29916]: | event after this is EVENT_SHUNT_SCAN in 76 seconds
     
    2011:08:21-19:13:38 NODES-FW1 pluto[29916]: | handling event EVENT_RETRANSMIT for 212.72.184.221 "S_CORE-S2S-HIB" #41
     
    2011:08:21-19:13:38 NODES-FW1 pluto[29916]: | inserting event EVENT_RETRANSMIT, timeout in 40 seconds for #41
     
    2011:08:21-19:13:38 NODES-FW1 pluto[29916]: | next event EVENT_RETRANSMIT in 40 seconds for #41
     
    2011:08:21-19:14:18 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:14:18 NODES-FW1 pluto[29916]: | *time to handle event 

    2011:08:21-19:14:18 NODES-FW1 pluto[29916]: | event after this is EVENT_SHUNT_SCAN in 36 seconds
     
    2011:08:21-19:14:18 NODES-FW1 pluto[29916]: | handling event EVENT_RETRANSMIT for 212.72.184.221 "S_CORE-S2S-HIB" #41
     
    2011:08:21-19:14:18 NODES-FW1 pluto[29916]: | inserting event EVENT_RETRANSMIT, timeout in 40 seconds for #41
     
    2011:08:21-19:14:18 NODES-FW1 pluto[29916]: | next event EVENT_SHUNT_SCAN in 36 seconds
     
    2011:08:21-19:14:54 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:14:54 NODES-FW1 pluto[29916]: | *time to handle event 

    2011:08:21-19:14:54 NODES-FW1 pluto[29916]: | event after this is EVENT_RETRANSMIT in 4 seconds
     
    2011:08:21-19:14:54 NODES-FW1 pluto[29916]: | inserting event EVENT_SHUNT_SCAN, timeout in 120 seconds
     
    2011:08:21-19:14:54 NODES-FW1 pluto[29916]: | scanning for shunt eroutes 

    2011:08:21-19:14:54 NODES-FW1 pluto[29916]: | next event EVENT_RETRANSMIT in 4 seconds for #41
     
    2011:08:21-19:14:58 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:14:58 NODES-FW1 pluto[29916]: | *time to handle event 

    2011:08:21-19:14:58 NODES-FW1 pluto[29916]: | event after this is EVENT_SHUNT_SCAN in 116 seconds
     
    2011:08:21-19:14:58 NODES-FW1 pluto[29916]: | handling event EVENT_RETRANSMIT for 212.72.184.221 "S_CORE-S2S-HIB" #41
     
    2011:08:21-19:14:58 NODES-FW1 pluto[29916]: | inserting event EVENT_RETRANSMIT, timeout in 40 seconds for #41
     
    2011:08:21-19:14:58 NODES-FW1 pluto[29916]: | next event EVENT_RETRANSMIT in 40 seconds for #41
     
    2011:08:21-19:15:38 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:15:38 NODES-FW1 pluto[29916]: | *time to handle event 

    2011:08:21-19:15:38 NODES-FW1 pluto[29916]: | event after this is EVENT_SHUNT_SCAN in 76 seconds
     
    2011:08:21-19:15:38 NODES-FW1 pluto[29916]: | handling event EVENT_RETRANSMIT for 212.72.184.221 "S_CORE-S2S-HIB" #41
     
    2011:08:21-19:15:38 NODES-FW1 pluto[29916]: | inserting event EVENT_RETRANSMIT, timeout in 40 seconds for #41
     
    2011:08:21-19:15:38 NODES-FW1 pluto[29916]: | next event EVENT_RETRANSMIT in 40 seconds for #41
     
    2011:08:21-19:16:18 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:16:18 NODES-FW1 pluto[29916]: | *time to handle event 

    2011:08:21-19:16:18 NODES-FW1 pluto[29916]: | event after this is EVENT_SHUNT_SCAN in 36 seconds
     
    2011:08:21-19:16:18 NODES-FW1 pluto[29916]: | handling event EVENT_RETRANSMIT for 212.72.184.221 "S_CORE-S2S-HIB" #41
     
    2011:08:21-19:16:18 NODES-FW1 pluto[29916]: | inserting event EVENT_RETRANSMIT, timeout in 40 seconds for #41
     
    2011:08:21-19:16:18 NODES-FW1 pluto[29916]: | next event EVENT_SHUNT_SCAN in 36 seconds
     
    2011:08:21-19:16:47 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:16:47 NODES-FW1 pluto[29916]: | *time to check crls and the ocsp cache
     
    2011:08:21-19:16:47 NODES-FW1 pluto[29916]: | next regular crl check in 600 seconds
     
    2011:08:21-19:16:54 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:16:54 NODES-FW1 pluto[29916]: | *time to handle event 

    2011:08:21-19:16:54 NODES-FW1 pluto[29916]: | event after this is EVENT_RETRANSMIT in 4 seconds
     
    2011:08:21-19:16:54 NODES-FW1 pluto[29916]: | inserting event EVENT_SHUNT_SCAN, timeout in 120 seconds
     
    2011:08:21-19:16:54 NODES-FW1 pluto[29916]: | scanning for shunt eroutes 

    2011:08:21-19:16:54 NODES-FW1 pluto[29916]: | next event EVENT_RETRANSMIT in 4 seconds for #41
     
    2011:08:21-19:16:58 NODES-FW1 pluto[29916]: | 

    2011:08:21-19:16:58 NODES-FW1 pluto[29916]: | *time to handle event 

    2011:08:21-19:16:58 NODES-FW1 pluto[29916]: | event after this is EVENT_SHUNT_SCAN in 116 seconds
     
    2011:08:21-19:16:58 NODES-FW1 pluto[29916]: | handling event EVENT_RETRANSMIT for 212.72.184.221 "S_CORE-S2S-HIB" #41
     
    2011:08:21-19:16:58 NODES-FW1 pluto[29916]: | inserting event EVENT_RETRANSMIT, timeout in 40 seconds for #41
     
    2011:08:21-19:16:58 NODES-FW1 pluto[29916]: | next event EVENT_RETRANSMIT in 40 seconds for #41
  • Do you see anything relevant blocked in the Packet Filter log between 19:12 and 19:17?  What happens if you check both 'Auto packet filter' and 'Strict routing' in the 'IPsec connection'?

    Cheers - Bob
  • Hi Bob,

    no nothing relevant in the PF Log. I'll get back to you with Auo-PF and Strict Routing on ...

    kind regars
  • I checked both boxes and restarted the connection. Didn't help. The status on the OpenSwan Site is now like that:


    000
    000 #88: "CORE-S2S-HIB":500 STATE_MAIN_I1 (sent MI1, expecting MR1); EVENT_RETRANSMIT in 26s; nodpd
    000 #88: pending Phase 2 for "CORE-S2S-HIB" replacing #0


    I don't get this :-)
    You think there might be some Firewall involved?

    I asked the hoster if it's possible to do IPSec and whats 212.72.184.1 is doing to my packages - they said there's no NAT, no MTU issues, should work, they say most customers use OpenVPN (for SSL) BUT the ASG is not really handy in setting this up (import/export only with a Astaro-specific format). This really drives me crazy - I feel like a n00b already.

    Any ideas? Thanks for your help so far!

    Edit: Could it be that L2TP/IPSec Remote Access AND IPSec Site2Site isn't working at the same time? Just thinkig ... because on the ASG there's such Remote Access enabled and working very well. It stopped working after I changed the NAT-T Option under Site2Site IPSec so I think this might interference? 


    Kind regards,
    Sebastian
  • Sebastian, I know that Openswan is related to Strongswan (upon which Astaro's IPsec is based), but I'm not that knowledgable about the internals to give an exact analysis.  It looks to me like this dies when trying to initiate Main Mode.  There must be some mismatch in parameters...

    Try using one of the supplied Astaro policies and matching it in swan.  Check that your PSK matches.  What's the MTU on swan - it should be 1420 to match with Astaro.  Try setting PFS on for both sides. ???

    Cheers - Bob
  • Thank you Bob! I'll try all that and come back with results!

    Best regards,
    Sebastian
  • Haven't had time yet, I'll report back soon [;)]