../../guestbin/prep.sh
set #
 # force the kernel to use fixed IDs
set #
 sysctl -w net.ipsecif.use_fixed_reqid=1
net.ipsecif.use_fixed_reqid: 1 -> 1
set #
 unit=1
set #
 reqid_ipv4=$(($(sysctl -n net.ipsecif.reqid_base) + 2 * unit))
set #
 reqid_ipv6=$(($(sysctl -n net.ipsecif.reqid_base) + 2 * unit + 1))
set #
 ifconfig ipsec${unit} create
set #
 ifconfig ipsec${unit} -link2
set #
 ifconfig ipsec${unit} inet tunnel 198.18.1.15 198.18.1.12
set #
 ifconfig ipsec${unit} inet 198.18.15.15/24 198.18.12.12
set #
 ifconfig ipsec${unit}
ipsec1: flags=0x8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1280
	tunnel inet 198.18.1.15 --> 198.18.1.12
	status: active
	inet6 fe80::ccae:eeba:9b4a:4c5e%ipsec1/64 ->  flags 0 scopeid 0x5
	inet 198.18.15.15/24 -> 198.18.12.12 flags 0
set #
 ../../guestbin/ipsec-kernel-policy.sh
198.18.1.12[any] 198.18.1.15[any] 4(ipv4)
	in ipsec
	esp/transport//unique:8194
	spid=1 seq=3 pid=PID
	refcnt=0
198.18.1.12[any] 198.18.1.15[any] 41(ipv6)
	in discard
	spid=3 seq=2 pid=PID
	refcnt=0
198.18.1.15[any] 198.18.1.12[any] 4(ipv4)
	out ipsec
	esp/transport//unique:8194
	spid=2 seq=1 pid=PID
	refcnt=0
198.18.1.15[any] 198.18.1.12[any] 41(ipv6)
	out discard
	spid=4 seq=0 pid=PID
	refcnt=0
set #
 echo 'add 198.18.1.12 198.18.1.15 esp 4523 -m transport -u '${reqid_ipv4}'  -E rijndael-cbc "45-----Key----23" -A hmac-sha1 "45------Hash------23" ;' | setkey -c
set #
 echo 'add 198.18.1.15 198.18.1.12 esp 2345 -m transport -u '${reqid_ipv4}' -E rijndael-cbc "23-----Key----45" -A hmac-sha1 "23------Hash------45" ;' | setkey -c
set #
 ../../guestbin/ipsec-kernel-state.sh
198.18.1.12 198.18.1.15 
	esp mode=transport spi=SPISPI(0xSPISPI) reqid=8194(0x00002002)
	E: aes-cbc  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
	A: hmac-sha1  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
	seq=0x00000000 replay=0 flags=0x00000040 state=mature 
	created: TIMESTAMP	current: TIMESTAMP
	diff: N(s)	hard: 0(s)	soft: 0(s)
	last: TIMESTAMP	hard: 0(s)	soft: 0(s)
	current: 0(bytes)	hard: 0(bytes)	soft: 0(bytes)
	allocated: 0	hard: 0	soft: 0
	sadb_seq=1 pid=PID refcnt=0
198.18.1.15 198.18.1.12 
	esp mode=transport spi=SPISPI(0xSPISPI) reqid=8194(0x00002002)
	E: aes-cbc  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
	A: hmac-sha1  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
	seq=0x00000000 replay=0 flags=0x00000040 state=mature 
	created: TIMESTAMP	current: TIMESTAMP
	diff: N(s)	hard: 0(s)	soft: 0(s)
	last: TIMESTAMP	hard: 0(s)	soft: 0(s)
	current: 0(bytes)	hard: 0(bytes)	soft: 0(bytes)
	allocated: 0	hard: 0	soft: 0
	sadb_seq=0 pid=PID refcnt=0
set #
 ../../guestbin/ping-once.sh --up -I 198.18.15.15 198.18.12.12
up
set #
 ../../guestbin/ipsec-kernel-state.sh
198.18.1.12 198.18.1.15 
	esp mode=transport spi=SPISPI(0xSPISPI) reqid=8194(0x00002002)
	E: aes-cbc  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
	A: hmac-sha1  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
	seq=0x00000001 replay=0 flags=0x00000040 state=mature 
	created: TIMESTAMP	current: TIMESTAMP
	diff: N(s)	hard: 0(s)	soft: 0(s)
	last: TIMESTAMP	hard: 0(s)	soft: 0(s)
	current: 104(bytes)	hard: 0(bytes)	soft: 0(bytes)
	allocated: 1	hard: 0	soft: 0
	sadb_seq=1 pid=PID refcnt=0
198.18.1.15 198.18.1.12 
	esp mode=transport spi=SPISPI(0xSPISPI) reqid=8194(0x00002002)
	E: aes-cbc  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
	A: hmac-sha1  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
	seq=0x00000001 replay=0 flags=0x00000040 state=mature 
	created: TIMESTAMP	current: TIMESTAMP
	diff: N(s)	hard: 0(s)	soft: 0(s)
	last: TIMESTAMP	hard: 0(s)	soft: 0(s)
	current: 152(bytes)	hard: 0(bytes)	soft: 0(bytes)
	allocated: 1	hard: 0	soft: 0
	sadb_seq=0 pid=PID refcnt=0
set #
 ../../guestbin/ipsec-kernel-policy.sh
198.18.1.12[any] 198.18.1.15[any] 4(ipv4)
	in ipsec
	esp/transport//unique:8194
	spid=1 seq=3 pid=PID
	refcnt=0
198.18.1.12[any] 198.18.1.15[any] 41(ipv6)
	in discard
	spid=3 seq=2 pid=PID
	refcnt=0
198.18.1.15[any] 198.18.1.12[any] 4(ipv4)
	out ipsec
	esp/transport//unique:8194
	spid=2 seq=1 pid=PID
	refcnt=0
198.18.1.15[any] 198.18.1.12[any] 41(ipv6)
	out discard
	spid=4 seq=0 pid=PID
	refcnt=0
set #
 setkey -F
set #
 ifconfig ipsec1 destroy
set #
 
