Files
strongswan-ext/testing/tests/route-based/net2net-xfrmi-netns/hosts/sun/etc/updown
T
Tobias Brunner 760d7c9b4f testing: Add scenarios that use XFRM interfaces
The network namespace scenario requires a kernel patch in 4.19 and 4.20
kernels (the fix is included in 5.0 kernels).
2019-04-04 09:31:38 +02:00

19 lines
552 B
Bash
Executable File

#!/bin/bash
IF_NAME="xfrmi-${PLUTO_IF_ID_IN}"
case "${PLUTO_VERB}" in
up-client)
/usr/local/libexec/ipsec/xfrmi -n "${IF_NAME}" -i "${PLUTO_IF_ID_IN}" -d eth0
ip link set "${IF_NAME}" up
ip route add 10.1.0.0/16 dev "${IF_NAME}"
iptables -A FORWARD -i "${IF_NAME}" -j ACCEPT
iptables -A FORWARD -o "${IF_NAME}" -j ACCEPT
;;
down-client)
iptables -D FORWARD -i "${IF_NAME}" -j ACCEPT
iptables -D FORWARD -o "${IF_NAME}" -j ACCEPT
ip link del "${IF_NAME}"
;;
esac