/testing/guestbin/swan-prep --x509
Preparing X.509 files
west #
 echo "192.9.4.245 nic.testing.libreswan.org" >> /etc/hosts
west #
 certutil -D -n east -d /etc/ipsec.d
west #
 #cp /testing/x509/crls/cacrlvalid.pem /etc/ipsec.d/crls
west #
 # confirm that the network is alive
west #
 ping -n -c 4 192.0.2.254
PING 192.0.2.254 (192.0.2.254) 56(84) bytes of data.
64 bytes from 192.0.2.254: icmp_seq=1 ttl=64 time=0.XXX ms
64 bytes from 192.0.2.254: icmp_seq=2 ttl=64 time=0.XXX ms
64 bytes from 192.0.2.254: icmp_seq=3 ttl=64 time=0.XXX ms
64 bytes from 192.0.2.254: icmp_seq=4 ttl=64 time=0.XXX ms
--- 192.0.2.254 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time XXXX
rtt min/avg/max/mdev = 0.XXX/0.XXX/0.XXX/0.XXX ms
west #
 # make sure that clear text does not get through
west #
 iptables -A INPUT -i eth1 -s 192.0.2.0/24 -j DROP
west #
 # confirm with a ping
west #
 ping -n -c 4 192.0.2.254
PING 192.0.2.254 (192.0.2.254) 56(84) bytes of data.
--- 192.0.2.254 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time XXXX
west #
 ipsec setup start
[ 00.00] registered KLIPS /proc/sys/net
[ 00.00] ipsec_3des_init(alg_type=15 alg_id=3 name=3des): ret=0
[ 00.00] KLIPS cryptoapi interface: alg_type=15 alg_id=12 name=cbc(aes) keyminbits=128 keymaxbits=256, found(0)
[ 00.00] KLIPS cryptoapi interface: alg_type=15 alg_id=253 name=cbc(twofish) keyminbits=128 keymaxbits=256, found(0)
[ 00.00] KLIPS cryptoapi interface: alg_type=15 alg_id=252 name=cbc(serpent) keyminbits=128 keymaxbits=256, found(0)
[ 00.00] KLIPS cryptoapi interface: alg_type=15 alg_id=6 name=cbc(cast5) keyminbits=128 keymaxbits=128, found(0)
[ 00.00] KLIPS cryptoapi interface: alg_type=15 alg_id=3 name=cbc(des3_ede) keyminbits=192 keymaxbits=192, found(0)
[ 00.00] KLIPS: lookup for ciphername=cipher_null: not found
[ 00.00] 
Redirecting to: systemctl start ipsec.service
[ 00.00] 
west #
 /testing/pluto/bin/wait-until-pluto-started
west #
 ipsec auto --add westnet-eastnet-x509-cr
002 added connection description "westnet-eastnet-x509-cr"
west #
 echo done
done
west #
 ipsec auto --up  westnet-eastnet-x509-cr
002 "westnet-eastnet-x509-cr" #1: initiating Main Mode
104 "westnet-eastnet-x509-cr" #1: STATE_MAIN_I1: initiate
003 "westnet-eastnet-x509-cr" #1: received Vendor ID payload [Dead Peer Detection]
003 "westnet-eastnet-x509-cr" #1: received Vendor ID payload [FRAGMENTATION]
003 "westnet-eastnet-x509-cr" #1: received Vendor ID payload [RFC 3947]
002 "westnet-eastnet-x509-cr" #1: enabling possible NAT-traversal with method RFC 3947 (NAT-Traversal)
106 "westnet-eastnet-x509-cr" #1: STATE_MAIN_I2: sent MI2, expecting MR2
003 "westnet-eastnet-x509-cr" #1: NAT-Traversal: Result using RFC 3947 (NAT-Traversal) sender port 500: no NAT detected
002 "westnet-eastnet-x509-cr" #1: I am sending my cert
002 "westnet-eastnet-x509-cr" #1: I am sending a certificate request
108 "westnet-eastnet-x509-cr" #1: STATE_MAIN_I3: sent MI3, expecting MR3
003 "westnet-eastnet-x509-cr" #1: received Vendor ID payload [CAN-IKEv2]
002 "westnet-eastnet-x509-cr" #1: Main mode peer ID is ID_DER_ASN1_DN: 'C=ca, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=testing@libreswan.org'
002 "westnet-eastnet-x509-cr" #1: no crl from issuer "C=ca, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=Libreswan test CA for mainca, E=testing@libreswan.org" found (strict=yes)
002 "westnet-eastnet-x509-cr" #1: X.509 certificate rejected
003 "westnet-eastnet-x509-cr" #1: no RSA public key known for 'C=ca, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=testing@libreswan.org'
217 "westnet-eastnet-x509-cr" #1: STATE_MAIN_I3: INVALID_KEY_INFORMATION
002 "westnet-eastnet-x509-cr" #1: sending encrypted notification INVALID_KEY_INFORMATION to 192.1.2.23:500
#\[root@west ]#  timedout send line: ipsec auto --up westnet-eastnet-x509-cr
ipsec auto --replace westnet-eastnet-x509-cr
west #
 ipsec auto --up westnet-eastnet-x509-cr
 ping -n -c 4 192.0.2.254
002 "westnet-eastnet-x509-cr": deleting connection
002 "westnet-eastnet-x509-cr" #1: deleting state #1 (STATE_MAIN_I3)
002 added connection description "westnet-eastnet-x509-cr"
west #
 002 "westnet-eastnet-x509-cr" #2: initiating Main Mode
104 "westnet-eastnet-x509-cr" #2: STATE_MAIN_I1: initiate
003 "westnet-eastnet-x509-cr" #2: received Vendor ID payload [Dead Peer Detection]
003 "westnet-eastnet-x509-cr" #2: received Vendor ID payload [FRAGMENTATION]
003 "westnet-eastnet-x509-cr" #2: received Vendor ID payload [RFC 3947]
002 "westnet-eastnet-x509-cr" #2: enabling possible NAT-traversal with method RFC 3947 (NAT-Traversal)
106 "westnet-eastnet-x509-cr" #2: STATE_MAIN_I2: sent MI2, expecting MR2
003 "westnet-eastnet-x509-cr" #2: NAT-Traversal: Result using RFC 3947 (NAT-Traversal) sender port 500: no NAT detected
002 "westnet-eastnet-x509-cr" #2: I am sending my cert
002 "westnet-eastnet-x509-cr" #2: I am sending a certificate request
108 "westnet-eastnet-x509-cr" #2: STATE_MAIN_I3: sent MI3, expecting MR3
003 "westnet-eastnet-x509-cr" #2: received Vendor ID payload [CAN-IKEv2]
002 "westnet-eastnet-x509-cr" #2: Main mode peer ID is ID_DER_ASN1_DN: 'C=ca, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=testing@libreswan.org'
004 "westnet-eastnet-x509-cr" #2: STATE_MAIN_I4: ISAKMP SA established {auth=RSA_SIG cipher=aes_256 integ=sha group=MODP2048}
002 "westnet-eastnet-x509-cr" #3: initiating Quick Mode RSASIG+ENCRYPT+TUNNEL+PFS+UP+IKEV1_ALLOW+IKEV2_ALLOW+SAREF_TRACK+IKE_FRAG_ALLOW
117 "westnet-eastnet-x509-cr" #3: STATE_QUICK_I1: initiate
004 "westnet-eastnet-x509-cr" #3: STATE_QUICK_I2: sent QI2, IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_128-HMAC_SHA1 NATOA=none NATD=none DPD=passive}
west #
 ipsec look
PING 192.0.2.254 (192.0.2.254) 56(84) bytes of data.
64 bytes from 192.0.2.254: icmp_seq=2 ttl=64 time=0.XXX ms
64 bytes from 192.0.2.254: icmp_seq=3 ttl=64 time=0.XXX ms
64 bytes from 192.0.2.254: icmp_seq=4 ttl=64 time=0.XXX ms
--- 192.0.2.254 ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time XXXX
rtt min/avg/max/mdev = 0.XXX/0.XXX/0.XXX/0.XXX ms
west #
 ipsec look
west NOW
192.0.1.0/24       -> 192.0.2.0/24       => tun0xIPIP@192.1.2.23 esp0xESPSPI@192.1.2.23
ipsec0->eth1 mtu=16260(9999)->1500
tun0xTUN#@192.1.2.23 IPIP: dir=out src=192.1.2.45 jiffies=0123456789 natencap=none natsport=0 natdport=0   refhim=0
esp0xSPISPI@192.1.2.23 ESP_AES_HMAC_SHA1: dir=out src=192.1.2.45 iv_bits=128bits iv=0xIVISFORRANDOM000IVISFORRANDOM000 ooowin=64 alen=160 aklen=160 eklen=128 jiffies=0123456789 natencap=none natsport=0 natdport=0   refhim=0
esp0xSPISPI@192.1.2.45 ESP_AES_HMAC_SHA1: dir=in  src=192.1.2.23 iv_bits=128bits iv=0xIVISFORRANDOM000IVISFORRANDOM000 ooowin=64 alen=160 aklen=160 eklen=128 jiffies=0123456789 natencap=none natsport=0 natdport=0   refhim=1
tun0xTUN#@192.1.2.45 IPIP: dir=in  src=192.1.2.23 policy=192.0.2.0/24->192.0.1.0/24 flags=0x8<> jiffies=0123456789 natencap=none natsport=0 natdport=0   refhim=1
ROUTING TABLES
default via 192.1.2.254 dev eth1 
169.254.0.0/16 dev eth0  scope link  metric 1002 
169.254.0.0/16 dev eth1  scope link  metric 1003 
169.254.0.0/16 dev eth2  scope link  metric 1004 
192.0.1.0/24 dev eth0  proto kernel  scope link  src 192.0.1.254 
192.0.2.0/24 dev ipsec0  scope link  src 192.0.1.254 
192.1.2.0/24 dev eth1  proto kernel  scope link  src 192.1.2.45 
192.9.4.0/24 dev eth2  proto kernel  scope link  src 192.9.4.45 
NSS_CERTIFICATES
Certificate Nickname                                         Trust Attributes
                                                             SSL,S/MIME,JAR/XPI
Libreswan test CA for mainca - Libreswan                     ,,   
east-ec                                                      P,,  
hashsha2                                                     P,,  
north                                                        P,,  
west                                                         u,u,u
west #
000 using kernel interface: klips
000 interface ipsec0/eth1 192.1.2.45@4500
000 interface ipsec0/eth1 192.1.2.45@500
000  
000  
000 fips mode=disabled;
000 SElinux=XXXXX
000  
000 config setup options:
000  
000 configdir=/etc, configfile=/etc/ipsec.conf, secrets=/etc/ipsec.secrets, ipsecdir=/etc/ipsec.d, dumpdir=/var/tmp, statsbin=unset
000 sbindir=PATH/sbin, libexecdir=PATH/libexec/ipsec
000 nhelpers=-1, uniqueids=yes, force-busy=no
000 ikeport=500, strictcrlpolicy=yes, crlcheckinterval=5, listen=<any>
000 secctx-attr-value=XXXX
000 myid = (none)
000 debug raw+crypt+parsing+emitting+control+lifecycle+kernel+dns+oppo+controlmore+pfkey+nattraversal+x509+dpd+oppoinfo
000  
000 nat-traversal=yes, keep-alive=20, nat-ikeport=4500
000 virtual-private (%priv):
000  
000 ESP algorithms supported:
000  
000 algorithm ESP encrypt: id=3, name=ESP_3DES, ivlen=64, keysizemin=192, keysizemax=192
000 algorithm ESP encrypt: id=6, name=ESP_CAST, ivlen=64, keysizemin=128, keysizemax=128
000 algorithm ESP encrypt: id=12, name=ESP_AES, ivlen=128, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=252, name=ESP_SERPENT, ivlen=128, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=253, name=ESP_TWOFISH, ivlen=128, keysizemin=128, keysizemax=256
000 algorithm AH/ESP auth: id=1, name=AUTH_ALGORITHM_HMAC_MD5, keysizemin=128, keysizemax=128
000 algorithm AH/ESP auth: id=2, name=AUTH_ALGORITHM_HMAC_SHA1, keysizemin=160, keysizemax=160
000 algorithm AH/ESP auth: id=9, name=AUTH_ALGORITHM_AES_XCBC, keysizemin=128, keysizemax=128
000  
000 IKE algorithms supported:
000  
000 algorithm IKE encrypt: v1id=5, v1name=OAKLEY_3DES_CBC, v2id=3, v2name=3DES, blocksize=8, keydeflen=192
000 algorithm IKE encrypt: v1id=24, v1name=OAKLEY_CAMELLIA_CTR, v2id=24, v2name=CAMELLIA_CTR, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=8, v1name=OAKLEY_CAMELLIA_CBC, v2id=23, v2name=CAMELLIA_CBC, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=13, v1name=OAKLEY_AES_CTR, v2id=13, v2name=AES_CTR, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=7, v1name=OAKLEY_AES_CBC, v2id=12, v2name=AES_CBC, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=65004, v1name=OAKLEY_SERPENT_CBC, v2id=65004, v2name=SERPENT_CBC, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=65005, v1name=OAKLEY_TWOFISH_CBC, v2id=65005, v2name=TWOFISH_CBC, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=65289, v1name=OAKLEY_TWOFISH_CBC_SSH, v2id=65289, v2name=TWOFISH_CBC_SSH, blocksize=16, keydeflen=128
000 algorithm IKE hash: id=1, name=OAKLEY_MD5, hashlen=16
000 algorithm IKE hash: id=2, name=OAKLEY_SHA1, hashlen=20
000 algorithm IKE hash: id=4, name=OAKLEY_SHA2_256, hashlen=32
000 algorithm IKE hash: id=5, name=OAKLEY_SHA2_384, hashlen=48
000 algorithm IKE hash: id=6, name=OAKLEY_SHA2_512, hashlen=64
000 algorithm IKE hash: id=9, name=DISABLED-OAKLEY_AES_XCBC, hashlen=16
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 algorithm IKE dh group: id=22, name=OAKLEY_GROUP_DH22, bits=1024
000 algorithm IKE dh group: id=23, name=OAKLEY_GROUP_DH23, bits=2048
000 algorithm IKE dh group: id=24, name=OAKLEY_GROUP_DH24, bits=2048
000  
000 stats db_ops: {curr_cnt, total_cnt, maxsz} :context={0,0,0} trans={0,0,0} attrs={0,0,0} 
000  
000 Connection list:
000  
000 "westnet-eastnet-x509-cr": 192.0.1.0/24===192.1.2.45<192.1.2.45>[C=ca, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=west.testing.libreswan.org, E=testing@libreswan.org]...192.1.2.23<192.1.2.23>[C=ca, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=testing@libreswan.org]===192.0.2.0/24; erouted; eroute owner: #3
000 "westnet-eastnet-x509-cr":     oriented; my_ip=192.0.1.254; their_ip=192.0.2.254; mycert=west
000 "westnet-eastnet-x509-cr":   xauth info: us:none, them:none,  my_xauthuser=[any]; their_xauthuser=[any]
000 "westnet-eastnet-x509-cr":   modecfg info: us:none, them:none, modecfg policy:push, dns1:unset, dns2:unset, domain:unset, banner:unset;
000 "westnet-eastnet-x509-cr":   labeled_ipsec:no;
000 "westnet-eastnet-x509-cr":   policy_label:unset;
000 "westnet-eastnet-x509-cr":   CAs: 'C=ca, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=Libreswan test CA for mainca, E=testing@libreswan.org'...'C=ca, ST=Ontario, L=Toronto, O=Libreswan, OU=Test Department, CN=Libreswan test CA for mainca, E=testing@libreswan.org'
000 "westnet-eastnet-x509-cr":   ike_life: 3600s; ipsec_life: 28800s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0;
000 "westnet-eastnet-x509-cr":   sha2_truncbug:no; initial_contact:no; cisco_unity:no; send_vendorid:no;
000 "westnet-eastnet-x509-cr":   policy: RSASIG+ENCRYPT+TUNNEL+PFS+UP+IKEV1_ALLOW+IKEV2_ALLOW+SAREF_TRACK+IKE_FRAG_ALLOW;
000 "westnet-eastnet-x509-cr":   conn_prio: 24,24; interface: eth1; metric: 0; mtu: unset; sa_prio:auto; nflog-group: unset;
000 "westnet-eastnet-x509-cr":   dpd: action:hold; delay:0; timeout:0; nat-t: force_encaps:no; nat_keepalive:yes; ikev1_natt:both
000 "westnet-eastnet-x509-cr":   newest ISAKMP SA: #2; newest IPsec SA: #3;
000 "westnet-eastnet-x509-cr":   IKE algorithm newest: AES_CBC_256-SHA1-MODP2048
000 "westnet-eastnet-x509-cr":   ESP algorithm newest: AES_128-HMAC_SHA1; pfsgroup=<Phase1>
000  
000 Total IPsec connections: loaded 1, active 1
000  
000 State list:
000  
000 #3: "westnet-eastnet-x509-cr":500 STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in  00s; newest IPSEC; eroute owner; isakmp#2; idle; import:admin initiate
000 #3: "westnet-eastnet-x509-cr" esp.ESPSPIi@192.1.2.23 esp.ESPSPIi@192.1.2.45 tun.1000@192.1.2.23 tun.1001@192.1.2.45 ref=3 refhim=1 Traffic:! ESPmax=4194303B 
000 #2: "westnet-eastnet-x509-cr":500 STATE_MAIN_I4 (ISAKMP SA established); EVENT_SA_REPLACE in  00s; newest ISAKMP; lastdpd=-1s(seq in:0 out:0); idle; import:admin initiate
000  
000 Bare Shunt list:
000  
west #
 if [ -n "`ls /tmp/core* 2>/dev/null`" ]; then echo CORE FOUND; mv /tmp/core* OUTPUT/; fi
west #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi

