/testing/guestbin/swan-prep
west #
 # confirm that the network is alive
west #
 ../../guestbin/wait-until-alive -I 192.0.1.254 192.0.2.254
destination -I 192.0.1.254 192.0.2.254 is alive
west #
 # ensure that clear text does not get through
west #
 iptables -A INPUT -i eth1 -s 192.0.2.0/24 -j DROP
west #
 iptables -I INPUT -m policy --dir in --pol ipsec -j ACCEPT
west #
 # confirm clear text does not get through
west #
 ../../guestbin/ping-once.sh --down -I 192.0.1.254 192.0.2.254
down
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec auto --add tfc
002 "tfc": added IKEv2 connection
west #
 ipsec auto --status | grep tfc
000 "tfc": 192.0.1.0/24===192.1.2.45[@west]...192.1.2.23[@east]===192.0.2.0/24; unrouted; eroute owner: #0
000 "tfc":     oriented; my_ip=unset; their_ip=unset; my_updown=ipsec _updown;
000 "tfc":   xauth us:none, xauth them:none,  my_username=[any]; their_username=[any]
000 "tfc":   our auth:rsasig, their auth:rsasig, our autheap:none, their autheap:none;
000 "tfc":   modecfg info: us:none, them:none, modecfg policy:push, dns:unset, domains:unset, cat:unset;
000 "tfc":   sec_label:unset;
000 "tfc":   ike_life: 28800s; ipsec_life: 28800s; replay_window: 128; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0;
000 "tfc":   retransmit-interval: 9999ms; retransmit-timeout: 99s; iketcp:no; iketcp-port:4500;
000 "tfc":   initial-contact:no; cisco-unity:no; fake-strongswan:no; send-vendorid:no; send-no-esp-tfc:yes;
000 "tfc":   policy: IKEv2+RSASIG+ECDSA+ENCRYPT+TUNNEL+PFS+IKE_FRAG_ALLOW+ESN_NO+ESN_YES+RSASIG_v1_5;
000 "tfc":   v2-auth-hash-policy: SHA2_256+SHA2_384+SHA2_512;
000 "tfc":   conn_prio: 24,24; interface: eth1; metric: 0; mtu: unset; sa_prio:auto; sa_tfc:none;
000 "tfc":   nflog-group: unset; mark: unset; vti-iface:unset; vti-routing:no; vti-shared:no; nic-offload:auto;
000 "tfc":   our idtype: ID_FQDN; our id=@west; their idtype: ID_FQDN; their id=@east
000 "tfc":   dpd: action:hold; delay:0; timeout:0; nat-t: encaps:auto; nat_keepalive:yes; ikev1_natt:both
000 "tfc":   newest ISAKMP SA: #0; newest IPsec SA: #0; conn serial: $1;
west #
 ipsec whack --impair suppress-retransmits
west #
 echo "initdone"
initdone
west #
 ipsec auto --up tfc
1v2 "tfc" #1: initiating IKEv2 connection
1v2 "tfc" #1: sent IKE_SA_INIT request
1v2 "tfc" #1: sent IKE_AUTH request {cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=MODP2048}
003 "tfc" #1: established IKE SA; authenticated using RSA with SHA2_512 and preloaded certificate '@east'
004 "tfc" #2: established Child SA using #1; IPsec tunnel [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
west #
 ../../guestbin/ping-once.sh --up -I 192.0.1.254 192.0.2.254
up
west #
 # byte counters appear for unencrypted size, not encrypted/padded size
west #
 ipsec whack --trafficstatus
006 #2: "tfc", type=ESP, add_time=1234567890, inBytes=84, outBytes=84, id='@east'
west #
 echo done
done
west #
 ipsec whack --trafficstatus
006 #2: "tfc", type=ESP, add_time=1234567890, inBytes=84, outBytes=84, id='@east'
west #
 # ESP should not show TFC
west #
 grep "^[^|].*: established Child SA" /tmp/pluto.log
"tfc" #2: established Child SA using #1; IPsec tunnel [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
west #
 
