3 CRYPTO_DEV=${CRYPTO_DEV:-'--vdev="crypto_aesni_mb0"'}
5 #generate cfg file for ipsec-secgw
8 cat <<EOF > ${SGW_CFG_FILE}
10 sp ipv4 in esp protect 7 pri 2 src ${REMOTE_IPV4}/32 dst ${LOCAL_IPV4}/32 \
11 sport 0:65535 dport 0:65535
12 sp ipv4 in esp bypass pri 1 sport 0:65535 dport 0:65535
15 sp ipv4 out esp protect 7 pri 2 src ${LOCAL_IPV4}/32 dst ${REMOTE_IPV4}/32 \
16 sport 0:65535 dport 0:65535
17 sp ipv4 out esp bypass pri 1 sport 0:65535 dport 0:65535
20 sp ipv6 in esp protect 9 pri 2 src ${REMOTE_IPV6}/128 dst ${LOCAL_IPV6}/128 \
21 sport 0:65535 dport 0:65535
22 sp ipv6 in esp bypass pri 1 sport 0:65535 dport 0:65535
25 sp ipv6 out esp protect 9 pri 2 src ${LOCAL_IPV6}/128 dst ${REMOTE_IPV6}/128 \
26 sport 0:65535 dport 0:65535
27 sp ipv6 out esp bypass pri 1 sport 0:65535 dport 0:65535
30 sa in 7 cipher_algo aes-128-cbc \
31 cipher_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
33 auth_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
34 mode ipv4-tunnel src ${REMOTE_IPV4} dst ${LOCAL_IPV4}
36 sa in 9 cipher_algo aes-128-cbc \
37 cipher_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
39 auth_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
40 mode ipv6-tunnel src ${REMOTE_IPV6} dst ${LOCAL_IPV6}
43 sa out 7 cipher_algo aes-128-cbc \
44 cipher_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
46 auth_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
47 mode ipv4-tunnel src ${LOCAL_IPV4} dst ${REMOTE_IPV4}
49 sa out 9 cipher_algo aes-128-cbc \
50 cipher_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
52 auth_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
53 mode ipv6-tunnel src ${LOCAL_IPV6} dst ${REMOTE_IPV6}
56 rt ipv4 dst ${REMOTE_IPV4}/32 port 0
57 rt ipv4 dst ${LOCAL_IPV4}/32 port 1
59 rt ipv6 dst ${REMOTE_IPV6}/128 port 0
60 rt ipv6 dst ${LOCAL_IPV6}/128 port 1
63 neigh port 0 ${REMOTE_MAC}
64 neigh port 1 ${LOCAL_MAC}