/testing/guestbin/swan-prep
[root@west ikev2-delete-01]# # confirm that the network is alive
[root@west ikev2-delete-01]# ping -n -c 2 -I 192.0.1.254 192.0.2.254
PING 192.0.2.254 (192.0.2.254) from 192.0.1.254 : 56(84) bytes of data.
64 bytes from 192.0.2.254: icmp_req=1 ttl=64 time=0.535 ms
64 bytes from 192.0.2.254: icmp_req=2 ttl=64 time=0.263 ms

--- 192.0.2.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.263/0.399/0.535/0.136 ms
[root@west ikev2-delete-01]# # make sure that clear text does not get through
[root@west ikev2-delete-01]# iptables -A INPUT -i eth1 -s 192.0.2.0/24 -j DROP
[root@west ikev2-delete-01]# # confirm with a ping to east-in
[root@west ikev2-delete-01]# ping -n -c 1 -I 192.0.1.254 192.0.2.254
PING 192.0.2.254 (192.0.2.254) from 192.0.1.254 : 56(84) bytes of data.

--- 192.0.2.254 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

[root@west ikev2-delete-01]# ipsec setup stop
Redirecting to: systemctl stop ipsec.service
[root@west ikev2-delete-01]# /usr/local/libexec/ipsec/_stackmanager stop
[root@west ikev2-delete-01]# /usr/local/libexec/ipsec/_stackmanager start
[   72.145051] AVX instructions are not detected.
[   72.185851] AVX instructions are not detected.
[   72.236606] AVX instructions are not detected.
[   72.249604] AVX instructions are not detected.
[   72.278636] AVX or AES-NI instructions are not detected.
[   72.392697] klips_info:ipsec_init: KLIPS startup, Libreswan KLIPS IPsec stack version: v3.3-8-g9ce7454-dirty-master
[   72.402359] NET: Registered protocol family 15
[   72.407325] registered KLIPS /proc/sys/net
[   72.408388] klips_info:ipsec_alg_init: KLIPS alg v=0.8.1-0 (EALG_MAX=255, AALG_MAX=255)
[   72.410488] klips_info:ipsec_alg_init: calling ipsec_alg_static_init()
[   72.414047] ipsec_aes_init(alg_type=15 alg_id=12 name=aes): ret=0
[   72.418034] ipsec_aes_init(alg_type=14 alg_id=9 name=aes_mac): ret=0
[   72.421036] ipsec_3des_init(alg_type=15 alg_id=3 name=3des): ret=0
[   72.453329] KLIPS cryptoapi interface: alg_type=15 alg_id=12 name=cbc(aes) keyminbits=128 keymaxbits=256, found(0)
[   72.474298] KLIPS cryptoapi interface: alg_type=15 alg_id=253 name=cbc(twofish) keyminbits=128 keymaxbits=256, found(0)
[   72.529063] KLIPS cryptoapi interface: alg_type=15 alg_id=252 name=cbc(serpent) keyminbits=128 keymaxbits=256, found(0)
[   72.561098] KLIPS cryptoapi interface: alg_type=15 alg_id=6 name=cbc(cast5) keyminbits=128 keymaxbits=128, found(0)
[   72.564225] KLIPS cryptoapi interface: alg_type=15 alg_id=7 name=cbc(blowfish) keyminbits=96 keymaxbits=448, found(0)
[   72.597047] KLIPS cryptoapi interface: alg_type=15 alg_id=3 name=cbc(des3_ede) keyminbits=192 keymaxbits=192, found(0)
[   72.668845] 
[root@west ikev2-delete-01]# /usr/local/libexec/ipsec/pluto --config /etc/ipsec.conf
[root@west ikev2-delete-01]# /testing/pluto/bin/wait-until-pluto-started
[root@west ikev2-delete-01]# ipsec whack --whackrecord /var/tmp/ikev2.record
[root@west ikev2-delete-01]# ipsec auto --add west-east-delete1
[root@west ikev2-delete-01]# ipsec auto --status
000 using kernel interface: klips
000 interface ipsec0/eth1 2001:db8:1:2::45
000 interface ipsec0/eth1 192.1.2.45
000 interface ipsec0/eth1 192.1.2.45
000 %myid = (none)
000 debug raw+crypt+parsing+emitting+control+lifecycle+klips+dns+oppo+controlmore+pfkey+nattraversal+x509+dpd+oppoinfo
000  
000 virtual_private (%priv):
000 - allowed 3 subnets: 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12
000 - disallowed 2 subnets: 192.0.2.0/24, 2001:db8:0:2::/64
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=7, name=ESP_BLOWFISH, ivlen=64, keysizemin=96, keysizemax=448
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 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=9, name=AUTH_ALGORITHM_AES_CBC, keysizemin=128, keysizemax=128
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 hash: id=4, name=OAKLEY_SHA2_256, hashsize=32
000 algorithm IKE hash: id=5, name=OAKLEY_SHA2_384, hashsize=48
000 algorithm IKE hash: id=6, name=OAKLEY_SHA2_512, hashsize=64
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 "west-east-delete1": 192.0.1.0/24===192.1.2.45<192.1.2.45>[@west]...192.1.2.23<192.1.2.23>[@east]===192.0.2.0/24; unrouted; eroute owner: #0
000 "west-east-delete1":     oriented; my_ip=unset; their_ip=unset;
000 "west-east-delete1":   xauth info: us:none, them:none,  my_xauthuser=[any]; their_xauthuser=[any]; ;
000 "west-east-delete1":   modecfg info: us:none, them:none, modecfg policy:push, dns1:unset, dns2:unset;
000 "west-east-delete1":   ike_life: 3600s; ipsec_life: 28800s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0; sha2_truncbug:no; initial_contact:no;
000 "west-east-delete1":   policy: PSK+ENCRYPT+TUNNEL+PFS+!IKEv1+IKEv2ALLOW+IKEv2Init+SAREFTRACK+IKE_FRAG; 
000 "west-east-delete1":   prio: 24,24; interface: eth1; metric: 0, mtu: unset;
000 "west-east-delete1":   dpd: action:clear; delay:0; timeout:0; nat-t: force_encaps:no; nat_keepalive:yes;
000 "west-east-delete1":   newest ISAKMP SA: #0; newest IPsec SA: #0; 
000  
000 Total IPsec connections: loaded 1, active 0
000  
000  
[root@west ikev2-delete-01]# ipsec whack --debug-control --debug-controlmore --debug-parsing --debug-crypt
[root@west ikev2-delete-01]# echo "initdone"
initdone
[root@west ikev2-delete-01]# ipsec auto --up west-east-delete1
133 "west-east-delete1" #1: STATE_PARENT_I1: initiate
133 "west-east-delete1" #1: STATE_PARENT_I1: sent v2I1, expected v2R1
134 "west-east-delete1" #2: STATE_PARENT_I2: sent v2I2, expected v2R2 {auth=IKEv2 cipher=aes_128 integ=sha1_96 prf=oakley_sha group=modp2048}
004 "west-east-delete1" #2: STATE_PARENT_I3: PARENT SA established tunnel mode {ESP=>0xcfae0a07 <0xdf27372d xfrm=AES_128-HMAC_SHA1 NATOA=none NATD=none DPD=none}
[root@west ikev2-delete-01]# ping -n -c 2 -I 192.0.1.254 192.0.2.254
PING 192.0.2.254 (192.0.2.254) from 192.0.1.254 : 56(84) bytes of data.
64 bytes from 192.0.2.254: icmp_req=1 ttl=64 time=0.910 ms
64 bytes from 192.0.2.254: icmp_req=2 ttl=64 time=0.315 ms

--- 192.0.2.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.315/0.612/0.910/0.298 ms
[root@west ikev2-delete-01]# echo done
done
[root@west ikev2-delete-01]# ipsec auto --status
000 using kernel interface: klips
000 interface ipsec0/eth1 2001:db8:1:2::45
000 interface ipsec0/eth1 192.1.2.45
000 interface ipsec0/eth1 192.1.2.45
000 %myid = (none)
000 debug crypt+parsing+control+controlmore
000  
000 virtual_private (%priv):
000 - allowed 3 subnets: 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12
000 - disallowed 2 subnets: 192.0.2.0/24, 2001:db8:0:2::/64
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=7, name=ESP_BLOWFISH, ivlen=64, keysizemin=96, keysizemax=448
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 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=9, name=AUTH_ALGORITHM_AES_CBC, keysizemin=128, keysizemax=128
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 hash: id=4, name=OAKLEY_SHA2_256, hashsize=32
000 algorithm IKE hash: id=5, name=OAKLEY_SHA2_384, hashsize=48
000 algorithm IKE hash: id=6, name=OAKLEY_SHA2_512, hashsize=64
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 "west-east-delete1": 192.0.1.0/24===192.1.2.45<192.1.2.45>[@west]...192.1.2.23<192.1.2.23>[@east]===192.0.2.0/24; erouted; eroute owner: #2
000 "west-east-delete1":     oriented; my_ip=unset; their_ip=unset;
000 "west-east-delete1":   xauth info: us:none, them:none,  my_xauthuser=[any]; their_xauthuser=[any]; ;
000 "west-east-delete1":   modecfg info: us:none, them:none, modecfg policy:push, dns1:unset, dns2:unset;
000 "west-east-delete1":   ike_life: 3600s; ipsec_life: 28800s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0; sha2_truncbug:no; initial_contact:no;
000 "west-east-delete1":   policy: PSK+ENCRYPT+TUNNEL+PFS+UP+!IKEv1+IKEv2ALLOW+IKEv2Init+SAREFTRACK+IKE_FRAG; 
000 "west-east-delete1":   prio: 24,24; interface: eth1; metric: 0, mtu: unset;
000 "west-east-delete1":   newest ISAKMP SA: #1; newest IPsec SA: #2; 
000 "west-east-delete1":   IKE algorithm newest: _128-SHA1-MODP2048
000 "west-east-delete1":   ESP algorithm newest: AES_128-HMAC_SHA1; pfsgroup=<Phase1>
000  
000 Total IPsec connections: loaded 1, active 1
000  
000 #2: "west-east-delete1":500 STATE_PARENT_I3 (PARENT SA established); EVENT_SA_REPLACE in 27804s; newest IPSEC; eroute owner; nodpd; idle; import:admin initiate
000 #1: "west-east-delete1":500 STATE_PARENT_I3 (PARENT SA established); EVENT_SA_REPLACE in 3596s; newest ISAKMP; nodpd; idle; import:admin initiate
000  
[root@west ikev2-delete-01]# if [ -n "`ls /tmp/core* 2>/dev/null`" ]; then echo CORE FOUND; mv /tmp/core* ./; fi
[root@west ikev2-delete-01]# if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi
[root@west ikev2-delete-01]# : ==== end ====
[root@west ikev2-delete-01]# 