2 # SPDX-License-Identifier: BSD-3-Clause
4 . ${DIR}/tun_aesgcm_common_defs.sh
6 SGW_CMD_XPRM="${DPDK_VARS} ${DPDK_MODE} ${SGW_CMD_XPRM}"
8 config_remote_xfrm_44()
10 ssh ${REMOTE_HOST} ip xfrm policy flush
11 ssh ${REMOTE_HOST} ip xfrm state flush
13 ssh ${REMOTE_HOST} ip xfrm policy add \
14 src ${REMOTE_IPV4} dst ${LOCAL_IPV4} \
15 dir out ptype main action allow \
16 tmpl src ${REMOTE_IPV4} dst ${LOCAL_IPV4} \
17 proto esp mode tunnel reqid 1
19 ssh ${REMOTE_HOST} ip xfrm policy add \
20 src ${LOCAL_IPV4} dst ${REMOTE_IPV4} \
21 dir in ptype main action allow \
22 tmpl src ${LOCAL_IPV4} dst ${REMOTE_IPV4} \
23 proto esp mode tunnel reqid 2
25 ssh ${REMOTE_HOST} ip xfrm state add \
26 src ${REMOTE_IPV4} dst ${LOCAL_IPV4} \
27 proto esp spi 7 reqid 1 mode tunnel replay-window 64 ${XFRM_ESN} \
28 aead "rfc4106\(gcm\(aes\)\)" \
29 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef 128
31 ssh ${REMOTE_HOST} ip xfrm state add \
32 src ${LOCAL_IPV4} dst ${REMOTE_IPV4} \
33 proto esp spi 7 reqid 2 mode tunnel replay-window 64 ${XFRM_ESN} \
34 aead "rfc4106\(gcm\(aes\)\)" \
35 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef 128
37 ssh ${REMOTE_HOST} ip xfrm policy list
38 ssh ${REMOTE_HOST} ip xfrm state list
41 config_remote_xfrm_46()
43 ssh ${REMOTE_HOST} ip xfrm policy flush
44 ssh ${REMOTE_HOST} ip xfrm state flush
46 ssh ${REMOTE_HOST} ip xfrm policy add \
47 src ${REMOTE_IPV4} dst ${LOCAL_IPV4} \
48 dir out ptype main action allow \
49 tmpl src ${REMOTE_IPV6} dst ${LOCAL_IPV6} \
50 proto esp mode tunnel reqid 1
52 ssh ${REMOTE_HOST} ip xfrm policy add \
53 src ${LOCAL_IPV4} dst ${REMOTE_IPV4} \
54 dir in ptype main action allow \
55 tmpl src ${LOCAL_IPV6} dst ${REMOTE_IPV6} \
56 proto esp mode tunnel reqid 2
58 ssh ${REMOTE_HOST} ip xfrm state add \
59 src ${REMOTE_IPV6} dst ${LOCAL_IPV6} \
60 proto esp spi 6 reqid 1 mode tunnel replay-window 64 ${XFRM_ESN} \
61 aead "rfc4106\(gcm\(aes\)\)" \
62 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef 128 \
63 sel src ${REMOTE_IPV4} dst ${LOCAL_IPV4}
65 ssh ${REMOTE_HOST} ip xfrm state add \
66 src ${LOCAL_IPV6} dst ${REMOTE_IPV6} \
67 proto esp spi 6 reqid 2 mode tunnel replay-window 64 ${XFRM_ESN} \
68 aead "rfc4106\(gcm\(aes\)\)" \
69 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef 128 \
70 sel src ${LOCAL_IPV4} dst ${REMOTE_IPV4}
72 ssh ${REMOTE_HOST} ip xfrm policy list
73 ssh ${REMOTE_HOST} ip xfrm state list
76 config_remote_xfrm_64()
78 ssh ${REMOTE_HOST} ip xfrm policy flush
79 ssh ${REMOTE_HOST} ip xfrm state flush
81 ssh ${REMOTE_HOST} ip xfrm policy add \
82 src ${REMOTE_IPV6} dst ${LOCAL_IPV6} \
83 dir out ptype main action allow \
84 tmpl src ${REMOTE_IPV4} dst ${LOCAL_IPV4} \
85 proto esp mode tunnel reqid 1
87 ssh ${REMOTE_HOST} ip xfrm policy add \
88 src ${LOCAL_IPV6} dst ${REMOTE_IPV6} \
89 dir in ptype main action allow \
90 tmpl src ${LOCAL_IPV4} dst ${REMOTE_IPV4} \
91 proto esp mode tunnel reqid 2
93 ssh ${REMOTE_HOST} ip xfrm state add \
94 src ${REMOTE_IPV4} dst ${LOCAL_IPV4} \
95 proto esp spi 8 reqid 1 mode tunnel replay-window 64 ${XFRM_ESN} \
96 aead "rfc4106\(gcm\(aes\)\)" \
97 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef 128 \
98 sel src ${REMOTE_IPV6} dst ${LOCAL_IPV6}
100 ssh ${REMOTE_HOST} ip xfrm state add \
101 src ${LOCAL_IPV4} dst ${REMOTE_IPV4} \
102 proto esp spi 8 reqid 2 mode tunnel replay-window 64 ${XFRM_ESN} \
103 aead "rfc4106\(gcm\(aes\)\)" \
104 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef 128 \
105 sel src ${LOCAL_IPV6} dst ${REMOTE_IPV6}
107 ssh ${REMOTE_HOST} ip xfrm policy list
108 ssh ${REMOTE_HOST} ip xfrm state list
111 config_remote_xfrm_66()
113 ssh ${REMOTE_HOST} ip xfrm policy flush
114 ssh ${REMOTE_HOST} ip xfrm state flush
116 ssh ${REMOTE_HOST} ip xfrm policy add \
117 src ${REMOTE_IPV6} dst ${LOCAL_IPV6} \
118 dir out ptype main action allow \
119 tmpl src ${REMOTE_IPV6} dst ${LOCAL_IPV6} \
120 proto esp mode tunnel reqid 3
122 ssh ${REMOTE_HOST} ip xfrm policy add \
123 src ${LOCAL_IPV6} dst ${REMOTE_IPV6} \
124 dir in ptype main action allow \
125 tmpl src ${LOCAL_IPV6} dst ${REMOTE_IPV6} \
126 proto esp mode tunnel reqid 4
128 ssh ${REMOTE_HOST} ip xfrm state add \
129 src ${REMOTE_IPV6} dst ${LOCAL_IPV6} \
130 proto esp spi 9 reqid 3 mode tunnel replay-window 64 ${XFRM_ESN} \
131 aead "rfc4106\(gcm\(aes\)\)" \
132 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef 128
134 ssh ${REMOTE_HOST} ip xfrm state add \
135 src ${LOCAL_IPV6} dst ${REMOTE_IPV6} \
136 proto esp spi 9 reqid 4 mode tunnel replay-window 64 ${XFRM_ESN} \
137 aead "rfc4106\(gcm\(aes\)\)" \
138 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef 128
140 ssh ${REMOTE_HOST} ip xfrm policy list
141 ssh ${REMOTE_HOST} ip xfrm state list