/testing/guestbin/swan-prep --x509
Preparing X.509 files
road #
 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] 
road #
 /testing/pluto/bin/wait-until-pluto-started
road #
 ipsec auto --add road-east-x509-ipv4
002 added connection description "road-east-x509-ipv4"
road #
 echo "initdone"
initdone
road #
 #!/bin/sh
road #
 ipsec auto --up road-east-x509-ipv4
002 "road-east-x509-ipv4"[1] 192.1.2.23 #1: initiating v2 parent SA
133 "road-east-x509-ipv4"[1] 192.1.2.23 #1: STATE_PARENT_I1: initiate
133 "road-east-x509-ipv4"[1] 192.1.2.23 #1: STATE_PARENT_I1: sent v2I1, expected v2R1
134 "road-east-x509-ipv4"[1] 192.1.2.23 #2: STATE_PARENT_I2: sent v2I2, expected v2R2 {auth=IKEv2 cipher=aes_gcm_16_256 integ=n/a prf=sha group=MODP2048}
002 "road-east-x509-ipv4"[1] 192.1.2.23 #2: 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=no)
002 "road-east-x509-ipv4"[1] 192.1.2.23 #2: IKEv2 mode peer ID is ID_DER_ASN1_DN: 'C=ca, ST=Ontario, O=Libreswan, OU=Test Department, CN=east.testing.libreswan.org, E=testing@libreswan.org'
002 "road-east-x509-ipv4"[1] 192.1.2.23 #2: received INTERNAL_IP4_ADDRESS 192.0.2.100
002 "road-east-x509-ipv4"[1] 192.1.2.23 #2: negotiated tunnel [192.0.2.100,192.0.2.100:0-65535 0] -> [0.0.0.0,255.255.255.255:0-65535 0]
004 "road-east-x509-ipv4"[1] 192.1.2.23 #2: STATE_PARENT_I3: PARENT SA established tunnel mode {ESP=>0xESPESP<0xESPESP xfrm=AES_128-HMAC_SHA1 NATOA=none NATD=none DPD=active}
road #
 ping -n -c4 -I 192.0.2.100 192.1.2.23
PING 192.1.2.23 (192.1.2.23) from 192.0.2.100 : 56(84) bytes of data.
64 bytes from 192.1.2.23: icmp_seq=1 ttl=64 time=0.XXX ms
64 bytes from 192.1.2.23: icmp_seq=2 ttl=64 time=0.XXX ms
64 bytes from 192.1.2.23: icmp_seq=3 ttl=64 time=0.XXX ms
64 bytes from 192.1.2.23: icmp_seq=4 ttl=64 time=0.XXX ms
--- 192.1.2.23 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
road #
 # show the tunnel!
road #
 echo "Tunnel should be up"
Tunnel should be up
road #
 ipsec eroute
4          192.0.2.100/32     -> 0.0.0.0/0          => tun0x1000@192.1.2.23
road #
 # Let R_U_THERE packets flow
road #
 echo "Waiting 15 seconds..."
Waiting 15 seconds...
road #
 sleep 15
road #
 echo "Setting up block via iptables"
Setting up block via iptables
road #
 iptables -I INPUT -s 192.1.2.23/32 -d 0/0 -j DROP
road #
 iptables -I OUTPUT -d 192.1.2.23/32 -s 0/0 -j DROP
road #
 sleep 10
road #
 sleep 10
road #
 sleep 10
road #
 # DPD should have triggered now
road #
 echo "Tunnel should be down (%trap/%hold)"
Tunnel should be down (%trap/%hold)
road #
 ipsec eroute
road #
 iptables -D INPUT -s 192.1.2.23/32 -d 0/0 -j DROP
road #
 iptables -D OUTPUT -d 192.1.2.23/32 -s 0/0 -j DROP
road #
 # as long as retransmits might take 20,40,40 seconds
road #
 sleep 60
road #
 # Tunnel should be back up now even without triggering traffic
road #
 echo "Tunnel should be up even without trigger traffic"
Tunnel should be up even without trigger traffic
road #
 ipsec eroute
0          192.0.2.100/32     -> 0.0.0.0/0          => tun0x1002@192.1.2.23
road #
 ping -q -n -c 4 -I 192.0.2.100 192.1.2.23
PING 192.1.2.23 (192.1.2.23) from 192.0.2.100 : 56(84) bytes of data.
--- 192.1.2.23 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
road #
 echo done
done
road #
 ipsec look
road NOW
192.0.2.100/32     -> 0.0.0.0/0          => tun0xIPIP@192.1.2.23 esp0xESPSPI@192.1.2.23
ipsec0->eth0 mtu=16260(9999)->1500
tun0xTUN#@192.1.2.23 IPIP: dir=out src=192.1.3.209 jiffies=0123456789  natencap=none natsport=0 natdport=0   refhim=0
esp0xSPISPI@192.1.2.23 ESP_AES_HMAC_SHA1: dir=out src=192.1.3.209 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.3.209 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=5
tun0xTUN#@192.1.3.209 IPIP: dir=in  src=192.1.2.23 policy=0.0.0.0/0->192.0.2.100/32 flags=0x8<> jiffies=0123456789  natencap=none natsport=0 natdport=0   refhim=5
ROUTING TABLES
0.0.0.0/1 dev ipsec0  scope link  src 192.0.2.100 
default via 192.1.3.254 dev eth0 
128.0.0.0/1 dev ipsec0  scope link  src 192.0.2.100 
192.1.3.0/24 dev eth0  proto kernel  scope link  src 192.1.3.209 
NSS_CERTIFICATES
Certificate Nickname                                         Trust Attributes
                                                             SSL,S/MIME,JAR/XPI
east                                                         P,,  
east-ec                                                      P,,  
hashsha2                                                     P,,  
mainca                                                       ,,   
north                                                        P,,  
road                                                         u,u,u
west                                                         P,,  
west-ec                                                      P,,  
road #
road #
 if [ -n "`ls /tmp/core* 2>/dev/null`" ]; then echo CORE FOUND; core=`ls /tmp/core* 2>/dev/null`; gdb --batch PATH/libexec/ipsec/pluto $core; mv /tmp/core* OUTPUT/; fi
road #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi

