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 3des-cbc \
32 de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
34 auth_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
35 mode ipv4-tunnel src ${REMOTE_IPV4} dst ${LOCAL_IPV4}
37 sa in 9 cipher_algo 3des-cbc \
39 de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
41 auth_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
42 mode ipv6-tunnel src ${REMOTE_IPV6} dst ${LOCAL_IPV6}
45 sa out 7 cipher_algo 3des-cbc \
47 de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
49 auth_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
50 mode ipv4-tunnel src ${LOCAL_IPV4} dst ${REMOTE_IPV4}
52 sa out 9 cipher_algo 3des-cbc \
54 de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
56 auth_key de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef:de:ad:be:ef \
57 mode ipv6-tunnel src ${LOCAL_IPV6} dst ${REMOTE_IPV6}
60 rt ipv4 dst ${REMOTE_IPV4}/32 port 0
61 rt ipv4 dst ${LOCAL_IPV4}/32 port 1
63 rt ipv6 dst ${REMOTE_IPV6}/128 port 0
64 rt ipv6 dst ${LOCAL_IPV6}/128 port 1
67 neigh port 0 ${REMOTE_MAC}
68 neigh port 1 ${LOCAL_MAC}