/testing/guestbin/swan-prep
east #
 ipsec start
Redirecting to: [initsystem]
east #
 ../../guestbin/wait-until-pluto-started
east #
 ipsec whack --impair replay-forward
east #
 ipsec auto --add westnet-eastnet
002 "westnet-eastnet": added IKEv1 connection
east #
 echo "initdone"
initdone
east #
 ../../guestbin/wait-for.sh --match '^[^|].* #2: IPsec SA established' -- cat /tmp/pluto.log
"westnet-eastnet" #2: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_CBC_128-HMAC_SHA1_96 DPD=passive}
east #
 ../../guestbin/ipsec-look.sh
east NOW
XFRM state:
src 192.1.2.45 dst 192.1.2.23
	proto esp spi 0xSPISPI reqid REQID mode tunnel
	replay-window 0 flag af-unspec
	auth-trunc hmac(sha1) 0xHASHKEY 96
	enc cbc(aes) 0xENCKEY
	anti-replay esn context:
	 seq-hi 0x0, seq 0xXX, oseq-hi 0x0, oseq 0xXX
	 replay_window 128, bitmap-length 4
	 00000000 00000000 00000000 XXXXXXXX 
src 192.1.2.23 dst 192.1.2.45
	proto esp spi 0xSPISPI reqid REQID mode tunnel
	replay-window 0 flag af-unspec
	auth-trunc hmac(sha1) 0xHASHKEY 96
	enc cbc(aes) 0xENCKEY
	anti-replay esn context:
	 seq-hi 0x0, seq 0xXX, oseq-hi 0x0, oseq 0xXX
	 replay_window 128, bitmap-length 4
	 00000000 00000000 00000000 XXXXXXXX 
XFRM policy:
src 192.0.1.0/24 dst 192.0.2.0/24
	dir fwd priority PRIORITY ptype main
	tmpl src 192.1.2.45 dst 192.1.2.23
		proto esp reqid REQID mode tunnel
src 192.0.1.0/24 dst 192.0.2.0/24
	dir in priority PRIORITY ptype main
	tmpl src 192.1.2.45 dst 192.1.2.23
		proto esp reqid REQID mode tunnel
src 192.0.2.0/24 dst 192.0.1.0/24
	dir out priority PRIORITY ptype main
	tmpl src 192.1.2.23 dst 192.1.2.45
		proto esp reqid REQID mode tunnel
XFRM done
IPSEC mangle TABLES
iptables filter TABLE
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ROUTING TABLES
default via 192.1.2.254 dev eth1
192.0.1.0/24 via 192.1.2.45 dev eth1
192.0.2.0/24 dev eth0 proto kernel scope link src 192.0.2.254
192.1.2.0/24 dev eth1 proto kernel scope link src 192.1.2.23
NSS_CERTIFICATES
Certificate Nickname                                         Trust Attributes
                                                             SSL,S/MIME,JAR/XPI
east #
 sed -n -e '/IMPAIR: start processing replay forward/,/IMPAIR: stop processing replay forward/ { /^[^|]/ p }' /tmp/pluto.log
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 1 of 1 (792 bytes)
"westnet-eastnet" #1: responding to Main Mode
"westnet-eastnet" #1: sent Main Mode R1
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 1 of 1
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 1 of 2 (792 bytes)
"westnet-eastnet" #1: retransmitting in response to duplicate packet; already STATE_MAIN_R1
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 1 of 2
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 2 of 2 (396 bytes)
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 2 of 2
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 1 of 3 (792 bytes)
"westnet-eastnet" #1: discarding initial packet; already STATE_MAIN_R2
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 1 of 3
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 2 of 3 (396 bytes)
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 2 of 3
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 3 of 3 (332 bytes)
"westnet-eastnet" #1: Peer ID is ID_FQDN: '@west'
"westnet-eastnet" #1: authenticated peer '2nnn-bit RSA with SHA1' signature using preloaded certificate '@west'
"westnet-eastnet" #1: IKE SA established {auth=RSA_SIG cipher=AES_CBC_256 integ=HMAC_SHA2_256 group=MODP2048}
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 3 of 3
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 1 of 4 (792 bytes)
"westnet-eastnet" #1: discarding initial packet; already STATE_MAIN_R3
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 1 of 4
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 2 of 4 (396 bytes)
"westnet-eastnet" #1: packet rejected: should have been encrypted
"westnet-eastnet" #1: sending notification INVALID_FLAGS to 192.1.2.45:500
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 2 of 4
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 3 of 4 (332 bytes)
"westnet-eastnet" #1: retransmitting in response to duplicate packet; already STATE_MAIN_R3
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 3 of 4
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 4 of 4 (476 bytes)
"westnet-eastnet" #1: the peer proposed: 192.0.2.0/24 -<all>-> 192.0.1.0/24
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 4 of 4
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 1 of 5 (792 bytes)
"westnet-eastnet" #1: discarding initial packet; already STATE_MAIN_R3
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 1 of 5
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 2 of 5 (396 bytes)
"westnet-eastnet" #1: packet rejected: should have been encrypted
"westnet-eastnet" #1: sending notification INVALID_FLAGS to 192.1.2.45:500
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 2 of 5
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 3 of 5 (332 bytes)
"westnet-eastnet" #1: retransmitting in response to duplicate packet; already STATE_MAIN_R3
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 3 of 5
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 4 of 5 (476 bytes)
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 4 of 5
packet from 192.1.2.45:500: IMPAIR: start processing replay forward: packet 5 of 5 (76 bytes)
"westnet-eastnet" #2: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_CBC_128-HMAC_SHA1_96 DPD=passive}
packet from 192.1.2.45:500: IMPAIR: stop processing replay forward: packet 5 of 5
east #
 
