/testing/guestbin/swan-prep
west #
 # confirm that the network is alive
west #
 ping6 -n -c 4 -I 2001:db8:0:1::254 2001:db8:0:2::254
PING 2001:db8:0:2::254(2001:db8:0:2::254) from 2001:db8:0:1::254 : 56 data bytes
64 bytes from 2001:db8:0:2::254: icmp_seq=1 ttl=64 time=0.XXX ms
64 bytes from 2001:db8:0:2::254: icmp_seq=2 ttl=64 time=0.XXX ms
64 bytes from 2001:db8:0:2::254: icmp_seq=3 ttl=64 time=0.XXX ms
64 bytes from 2001:db8:0:2::254: icmp_seq=4 ttl=64 time=0.XXX ms
--- 2001:db8: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 #
 ip6tables -A INPUT -i eth1 -s 2001:db8:0:2::254 -j DROP
west #
 # confirm with a ping to east-in
west #
 ping6 -n -c 4 -I 2001:db8:0:1::254 2001:db8:0:2::254
PING 2001:db8:0:2::254(2001:db8:0:2::254) from 2001:db8:0:1::254 : 56 data bytes
--- 2001:db8:0:2::254 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time XXXX
west #
 ipsec _stackmanager start
[ 00.00] NET: Registered protocol family 15
[ 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=7 name=cbc(blowfish) keyminbits=96 keymaxbits=448, 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] 
west #
 /usr/local/libexec/ipsec/pluto --config /etc/ipsec.conf
west #
 /testing/pluto/bin/wait-until-pluto-started
west #
 ipsec auto --add westnet-eastnet-6in6
west #
 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 %myid = (none)
000 debug none
000  
000 virtual_private (%priv):
000 - allowed 0 subnets: 
000 - disallowed 0 subnets: 
000 WARNING: Either virtual_private= is not specified, or there is a syntax 
000          error in that line. 'left/rightsubnet=vhost:%priv' will not work!
000 WARNING: Disallowed subnets in virtual_private= is empty. If you have 
000          private address space in internal use, it should be excluded!
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 "westnet-eastnet-6in6": 2001:db8:0:1::/64===2001:db8:1:2::45<2001:db8:1:2::45>[@west]...2001:db8:1:2::23<2001:db8:1:2::23>[@east]===2001:db8:0:2::/64; unrouted; eroute owner: #0
000 "westnet-eastnet-6in6":     oriented; my_ip=unset; their_ip=unset;
000 "westnet-eastnet-6in6":   xauth info: us:none, them:none,  my_xauthuser=[any]; their_xauthuser=[any]; ;
000 "westnet-eastnet-6in6":   modecfg info: us:none, them:none, modecfg policy:push, dns1:unset, dns2:unset;
000 "westnet-eastnet-6in6":   ike_life: 3600s; ipsec_life: 28800s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0; sha2_truncbug:no; initial_contact:no;
000 "westnet-eastnet-6in6":   policy: RSASIG+ENCRYPT+TUNNEL+PFS+IKEv2ALLOW+SAREFTRACK+IKE_FRAG; 
000 "westnet-eastnet-6in6":   prio: 64,64; interface: eth1; metric: 0, mtu: unset;
000 "westnet-eastnet-6in6":   newest ISAKMP SA: #0; newest IPsec SA: #0; 
000  
000 Total IPsec connections: loaded 1, active 0
000  
000  
west #
 echo "initdone"
initdone
west #
 ipsec auto --up  westnet-eastnet-6in6
104 "westnet-eastnet-6in6" #1: STATE_MAIN_I1: initiate
003 "westnet-eastnet-6in6" #1: received Vendor ID payload [Libreswan 
003 "westnet-eastnet-6in6" #1: received Vendor ID payload [Dead Peer Detection]
003 "westnet-eastnet-6in6" #1: received Vendor ID payload [FRAGMENTATION]
106 "westnet-eastnet-6in6" #1: STATE_MAIN_I2: sent MI2, expecting MR2
108 "westnet-eastnet-6in6" #1: STATE_MAIN_I3: sent MI3, expecting MR3
003 "westnet-eastnet-6in6" #1: received Vendor ID payload [CAN-IKEv2]
004 "westnet-eastnet-6in6" #1: STATE_MAIN_I4: ISAKMP SA established {auth=OAKLEY_RSA_SIG cipher=aes_128 prf=oakley_sha group=modp2048}
117 "westnet-eastnet-6in6" #2: STATE_QUICK_I1: initiate
004 "westnet-eastnet-6in6" #2: STATE_QUICK_I2: sent QI2, IPsec SA established tunnel mode
west #
 ping6 -n -c 4 -I 2001:db8:0:1::254 2001:db8:0:2::254
PING 2001:db8:0:2::254(2001:db8:0:2::254) from 2001:db8:0:1::254 : 56 data bytes
64 bytes from 2001:db8:0:2::254: icmp_seq=1 ttl=64 time=0.XXX ms
64 bytes from 2001:db8:0:2::254: icmp_seq=2 ttl=64 time=0.XXX ms
64 bytes from 2001:db8:0:2::254: icmp_seq=3 ttl=64 time=0.XXX ms
64 bytes from 2001:db8:0:2::254: icmp_seq=4 ttl=64 time=0.XXX ms
--- 2001:db8: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 #
 ipsec look
west NOW
2001:db8:0:1::/64  -> 2001:db8:0:2::/64  => tun0x1001@2001:db8:1:2::23 esp0xf2818484@2001:db8:1:2::23  (4)  PAUL: sanitizer missed this line
ipsec0->eth1 mtu=16260(9999)->1500
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 via 192.1.2.23 dev eth1 
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 
unreachable ::/96 dev lo  metric 1024  error -101
unreachable ::ffff:0.0.0.0/96 dev lo  metric 1024  error -101
2001:db8:0:1::/64 dev eth0  proto kernel  metric 256 
2001:db8:0:2::254 via 2001:db8:0:2::254 dev ipsec0  metric 0 
    cache 
2001:db8:0:2::/64 dev ipsec0  metric 1024 
2001:db8::/48 via 2001:db8:1:2::23 dev eth1  metric 1024 
2001:db8:1:2::23 via 2001:db8:1:2::23 dev eth1  metric 0 
    cache 
2001:db8:1:2::45 dev ipsec0  proto kernel  metric 256 
2001:db8:1:2::/64 dev eth1  proto kernel  metric 256 
2001:db8:9:4::/64 dev eth2  proto kernel  metric 256 
unreachable 2002:a00::/24 dev lo  metric 1024  error -101
unreachable 2002:7f00::/24 dev lo  metric 1024  error -101
unreachable 2002:a9fe::/32 dev lo  metric 1024  error -101
unreachable 2002:ac10::/28 dev lo  metric 1024  error -101
unreachable 2002:c0a8::/32 dev lo  metric 1024  error -101
unreachable 2002:e000::/19 dev lo  metric 1024  error -101
unreachable 3ffe:ffff::/32 dev lo  metric 1024  error -101
fe80::1000:ff:fe64:6445 dev ipsec0  proto kernel  metric 256 
fe80::/64 dev eth0  proto kernel  metric 256 
fe80::/64 dev eth1  proto kernel  metric 256 
fe80::/64 dev eth2  proto kernel  metric 256 
fe80::/64 dev ipsec0  proto kernel  metric 256 
default via 2001:db8:1:2::254 dev eth1  metric 1 
default via 2001:db8:1:2::254 dev eth1  metric 1024 
NSS_CERTIFICATES
Certificate Nickname                                         Trust Attributes
                                                             SSL,S/MIME,JAR/XPI
west #
 echo done
done
west #
 ipsec look
west NOW
2001:db8:0:1::/64  -> 2001:db8:0:2::/64  => tun0x1001@2001:db8:1:2::23 esp0xf2818484@2001:db8:1:2::23  (4)  PAUL: sanitizer missed this line
ipsec0->eth1 mtu=16260(1500)->1500
esp0xafaae4b1@2001:db8:1:2::45 ESP_AES_HMAC_SHA1: dir=in  src=2001:db8:1:2::23 iv_bits=128bits iv=0x1483f5c8aaaed18e6a2cc546be56993a ooowin=64 seq=4 bit=0xf alen=160 aklen=160 eklen=128 life(c,s,h)=bytes(416,0,0) idle=1 natencap=none natsport=0 natdport=0 refcount=3 ref=4 refhim=1  PAUL: sanitizer missed this line
esp0xf2818484@2001:db8:1:2::23 ESP_AES_HMAC_SHA1: dir=out src=2001:db8:1:2::45 iv_bits=128bits iv=0x97575aec5a12c28975cb588e3c0684a3 ooowin=64 seq=4 alen=160 aklen=160 eklen=128 life(c,s,h)=bytes(752,0,0) idle=1 natencap=none natsport=0 natdport=0 refcount=3 ref=2 refhim=0  PAUL: sanitizer missed this line
tun0x1001@2001:db8:1:2::23 IPIP: dir=out src=2001:db8:1:2::45 life(c,s,h)=bytes(576,0,0) idle=1 natencap=none natsport=0 natdport=0 refcount=3 ref=1 refhim=0
tun0x1002@2001:db8:1:2::45 IPIP: dir=in  src=2001:db8:1:2::23 policy=2001:db8:0:2::/64->2001:db8:0:1::/64 flags=0x8<> life(c,s,h)=bytes(416,0,0) idle=1 natencap=none natsport=0 natdport=0 refcount=3 ref=3 refhim=1
IPSEC mangle TABLES
iptables: No chain/target/match by that name.
ip6tables: No chain/target/match by that name.
NEW_IPSEC_CONN mangle TABLES
iptables: No chain/target/match by that name.
ip6tables: No chain/target/match by that name.
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 via 192.1.2.23 dev eth1 
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 
unreachable ::/96 dev lo  metric 1024  error -101
unreachable ::ffff:0.0.0.0/96 dev lo  metric 1024  error -101
2001:db8:0:1::/64 dev eth0  proto kernel  metric 256 
2001:db8:0:2::254 via 2001:db8:0:2::254 dev ipsec0  metric 0 
    cache 
2001:db8:0:2::/64 dev ipsec0  metric 1024 
2001:db8::/48 via 2001:db8:1:2::23 dev eth1  metric 1024 
2001:db8:1:2::23 via 2001:db8:1:2::23 dev eth1  metric 0 
    cache 
2001:db8:1:2::45 dev ipsec0  proto kernel  metric 256 
2001:db8:1:2::/64 dev eth1  proto kernel  metric 256 
2001:db8:9:4::/64 dev eth2  proto kernel  metric 256 
unreachable 2002:a00::/24 dev lo  metric 1024  error -101
unreachable 2002:7f00::/24 dev lo  metric 1024  error -101
unreachable 2002:a9fe::/32 dev lo  metric 1024  error -101
unreachable 2002:ac10::/28 dev lo  metric 1024  error -101
unreachable 2002:c0a8::/32 dev lo  metric 1024  error -101
unreachable 2002:e000::/19 dev lo  metric 1024  error -101
unreachable 3ffe:ffff::/32 dev lo  metric 1024  error -101
fe80::1000:ff:fe64:6445 dev ipsec0  proto kernel  metric 256 
fe80::/64 dev eth0  proto kernel  metric 256 
fe80::/64 dev eth1  proto kernel  metric 256 
fe80::/64 dev eth2  proto kernel  metric 256 
fe80::/64 dev ipsec0  proto kernel  metric 256 
default via 2001:db8:1:2::254 dev eth1  metric 1 
default via 2001:db8:1:2::254 dev eth1  metric 1024 
NSS_CERTIFICATES
Certificate Nickname                                         Trust Attributes
                                                             SSL,S/MIME,JAR/XPI
west #
west #
 if [ -n "`ls /tmp/core* 2>/dev/null`" ]; then echo CORE FOUND; mv /tmp/core* ./; fi
west #
 if [ -f /sbin/ausearch ]; then ausearch -r -m avc -ts recent ; fi

