TCPDUMP moon# tcpdump -i eth0 not port ssh and not port domain and not arp > /tmp/tcpdump.log 2>&1 & PRE-TEST moon# /etc/init.d/iptables start 2> /dev/null * Caching service dependencies ... [ ok ] * Starting firewall ... [ ok ] carol# /etc/init.d/iptables start 2> /dev/null * Caching service dependencies ... [ ok ] * Starting firewall ... [ ok ] carol# rm /etc/ipsec.d/private/* carol# rm /etc/ipsec.d/certs/* carol# cat /etc/scepclient.conf --debug-control --out pkcs1 --out pkcs10 carol# ipsec scepclient --dn "C=CH, O=Linux strongSwan, CN=carol@strongswan.org" --optionsfrom /etc/scepclient.conf | generating 2048 bit RSA key: | getting 128 bytes from /dev/urandom... | getting 128 bytes from /dev/urandom... | RSA key *AwEAAcq8c generated with 2048 bits | dn: 'C=CH, O=Linux strongSwan, CN=carol@strongswan.org' | building pkcs10 object: | signing hash with RSA Key *AwEAAcq8c fingerprint: f04e53ad951650218351f591ffe00a46 written pkcs10 file '/etc/ipsec.d/reqs/myReq.der' (654 bytes) | building pkcs1 object: written pkcs1 file '/etc/ipsec.d/private/myKey.der' (1191 bytes) winnetou# scp carol:/etc/ipsec.d/reqs/myReq.der /etc/openssl/carolReq.der winnetou# openssl req -inform der -in /etc/openssl/carolReq.der -out /etc/openssl/carolReq.pem winnetou# cd /etc/openssl; COMMON_NAME=carol@strongswan.org openssl ca -in carolReq.pem -out carolCert.pem -notext -config openssl.cnf -extensions user_ext < yy.txt Using configuration from openssl.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows countryName :PRINTABLE:'CH' organizationName :PRINTABLE:'Linux strongSwan' commonName :T61STRING:'carol@strongswan.org' Certificate is to be certified until Jul 19 13:16:24 2014 GMT (1825 days) Sign the certificate? [y/n]: 1 out of 1 certificate requests certified, commit? [y/n]Write out database with 1 new entries Data Base Updated winnetou# scp /etc/openssl/carolCert.pem carol:/etc/ipsec.d/certs/myCert.pem moon# rm /etc/ipsec.d/private/* moon# rm /etc/ipsec.d/certs/* moon# cat /etc/scepclient.conf --debug-control --keylength 2064 --out pkcs1=moonKey.der --out pkcs10=moonReq.der moon# ipsec scepclient --dn "C=CH, O=Linux strongSwan, SN=01, CN=moon.strongswan.org" --optionsfrom /etc/scepclient.conf | generating 2064 bit RSA key: | getting 129 bytes from /dev/urandom... | getting 129 bytes from /dev/urandom... | RSA key *AwEAAbhK9 generated with 2064 bits | dn: 'C=CH, O=Linux strongSwan, SN=01, CN=moon.strongswan.org' | building pkcs10 object: | signing hash with RSA Key *AwEAAbhK9 fingerprint: f819d0e5141f1fc1730b298934888c1d written pkcs10 file '/etc/ipsec.d/reqs/moonReq.der' (670 bytes) | building pkcs1 object: written pkcs1 file '/etc/ipsec.d/private/moonKey.der' (1200 bytes) winnetou# scp moon:/etc/ipsec.d/reqs/moonReq.der /etc/openssl/ winnetou# openssl req -inform der -in /etc/openssl/moonReq.der -out /etc/openssl/moonReq.pem winnetou# cd /etc/openssl; COMMON_NAME=moon.strongswan.org openssl ca -in moonReq.pem -out moonCert.pem -notext -config openssl.cnf -extensions host_ext < yy.txt Using configuration from openssl.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows countryName :PRINTABLE:'CH' organizationName :PRINTABLE:'Linux strongSwan' serialNumber :PRINTABLE:'01' commonName :PRINTABLE:'moon.strongswan.org' Certificate is to be certified until Jul 19 13:16:27 2014 GMT (1825 days) Sign the certificate? [y/n]: 1 out of 1 certificate requests certified, commit? [y/n]Write out database with 1 new entries Data Base Updated winnetou# scp /etc/openssl/moonCert.pem moon:/etc/ipsec.d/certs/ carol# sleep 2 carol# ipsec start Starting strongSwan 4.2.17 IPsec [starter]... moon# ipsec start Starting strongSwan 4.2.17 IPsec [starter]... carol# sleep 2 carol# ipsec up home 002 "home" #1: initiating Main Mode 104 "home" #1: STATE_MAIN_I1: initiate 003 "home" #1: ignoring Vendor ID payload [strongSwan 4.2.17] 003 "home" #1: received Vendor ID payload [XAUTH] 003 "home" #1: received Vendor ID payload [Dead Peer Detection] 106 "home" #1: STATE_MAIN_I2: sent MI2, expecting MR2 002 "home" #1: we have a cert and are sending it upon request 108 "home" #1: STATE_MAIN_I3: sent MI3, expecting MR3 002 "home" #1: Peer ID is ID_FQDN: '@moon.strongswan.org' 002 "home" #1: crl not found 002 "home" #1: certificate status unknown 002 "home" #1: ISAKMP SA established 004 "home" #1: STATE_MAIN_I4: ISAKMP SA established 002 "home" #2: initiating Quick Mode RSASIG+ENCRYPT+TUNNEL+PFS+UP {using isakmp#1} 112 "home" #2: STATE_QUICK_I1: initiate 002 "home" #2: sent QI2, IPsec SA established {ESP=>0x6b9bd56d <0xfed09c51} 004 "home" #2: STATE_QUICK_I2: sent QI2, IPsec SA established {ESP=>0x6b9bd56d <0xfed09c51} TEST carol# ipsec status | grep 'home.*STATE_QUICK_I2.*IPsec SA established' [YES] 000 #2: "home" STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 975s; newest IPSEC; eroute owner moon# ipsec status | grep 'rw.*STATE_QUICK_R2.*IPsec SA established' [YES] 000 #2: "rw"[2] 192.168.0.100 STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 1110s; newest IPSEC; eroute owner carol# ping -c 1 10.1.0.10 | grep '64 bytes from 10.1.0.10: icmp_seq=1' [YES] 64 bytes from 10.1.0.10: icmp_seq=1 ttl=63 time=0.870 ms moon# killall tcpdump moon# cat /tmp/tcpdump.log | grep 'IP carol.strongswan.org > moon.strongswan.org: ESP' [YES] 15:16:38.628580 IP carol.strongswan.org > moon.strongswan.org: ESP(spi=0x6b9bd56d,seq=0x1), length 132 moon# cat /tmp/tcpdump.log | grep 'IP moon.strongswan.org > carol.strongswan.org: ESP' [YES] 15:16:38.629051 IP moon.strongswan.org > carol.strongswan.org: ESP(spi=0xfed09c51,seq=0x1), length 132 POST-TEST moon# ipsec stop Stopping strongSwan IPsec... carol# ipsec stop Stopping strongSwan IPsec... moon# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ] carol# /etc/init.d/iptables stop 2> /dev/null * Stopping firewall ... [ ok ] carol# rm /etc/ipsec.d/private/* carol# rm /etc/ipsec.d/certs/* carol# rm /etc/ipsec.d/reqs/* moon# rm /etc/ipsec.d/private/* moon# rm /etc/ipsec.d/reqs/* winnetou# rm /etc/openssl/carol* winnetou# rm /etc/openssl/moon*