Lines Matching +full:addr +full:- +full:mode
2 # SPDX-License-Identifier: GPL-2.0
42 if [ ${rc} -eq ${expected} ]; then
43 printf "TEST: %-60s [ OK ]\n" "${msg}"
48 printf "TEST: %-60s [FAIL]\n" "${msg}"
71 if [ -n "$out" ]; then
90 if [ -n "${ns}" ]; then
91 ns="-netns ${ns}"
97 ip ${ns} -6 route add vrf ${vrf} unreachable default metric 8192
99 ip ${ns} addr add 127.0.0.1/8 dev ${vrf}
100 ip ${ns} -6 addr add ::1 dev ${vrf} nodad
104 ip ${ns} -6 ru del pref 0
105 ip ${ns} -6 ru add pref 32765 from all lookup local
111 local addr=$2
114 [ -z "${addr}" ] && addr="-"
115 [ -z "${addr6}" ] && addr6="-"
117 if [ "${addr}" != "-" ]; then
118 ip -netns ${ns} addr add dev lo ${addr}
120 if [ "${addr6}" != "-" ]; then
121 ip -netns ${ns} -6 addr add dev lo ${addr6}
124 ip -netns ${ns} ro add unreachable default metric 8192
125 ip -netns ${ns} -6 ro add unreachable default metric 8192
127 ip netns exec ${ns} sysctl -qw net.ipv4.ip_forward=1
128 ip netns exec ${ns} sysctl -qw net.ipv6.conf.all.keep_addr_on_down=1
129 ip netns exec ${ns} sysctl -qw net.ipv6.conf.all.forwarding=1
130 ip netns exec ${ns} sysctl -qw net.ipv6.conf.default.forwarding=1
131 ip netns exec ${ns} sysctl -qw net.ipv6.conf.default.accept_dad=0
148 if [ -n "${ns1}" ]; then
149 ns1arg="-netns ${ns1}"
151 if [ -n "${ns2}" ]; then
152 ns2arg="-netns ${ns2}"
160 if [ "${ns1_addr}" != "-" ]; then
161 ip ${ns1arg} addr add dev ${ns1_dev} ${ns1_addr}
162 ip ${ns2arg} addr add dev ${ns2_dev} ${ns2_addr}
165 if [ "${ns1_addr6}" != "-" ]; then
166 ip ${ns1arg} addr add dev ${ns1_dev} ${ns1_addr6} nodad
167 ip ${ns2arg} addr add dev ${ns2_dev} ${ns2_addr6} nodad
188 ip -netns $host1 link set dev eth0 master ${VRF}
197 ip -netns ${ns} xfrm ${x} flush
198 ip -6 -netns ${ns} xfrm ${x} flush
215 # host1 - IPv4 out
216 ip -netns $host1 xfrm policy add \
218 tmpl src ${HOST1_4} dst ${HOST2_4} proto esp mode tunnel
220 # host2 - IPv4 in
221 ip -netns $host2 xfrm policy add \
223 tmpl src ${HOST1_4} dst ${HOST2_4} proto esp mode tunnel
225 # host1 - IPv4 in
226 ip -netns $host1 xfrm policy add \
228 tmpl src ${HOST2_4} dst ${HOST1_4} proto esp mode tunnel
230 # host2 - IPv4 out
231 ip -netns $host2 xfrm policy add \
233 tmpl src ${HOST2_4} dst ${HOST1_4} proto esp mode tunnel
236 # host1 - IPv6 out
237 ip -6 -netns $host1 xfrm policy add \
239 tmpl src ${HOST1_6} dst ${HOST2_6} proto esp mode tunnel
241 # host2 - IPv6 in
242 ip -6 -netns $host2 xfrm policy add \
244 tmpl src ${HOST1_6} dst ${HOST2_6} proto esp mode tunnel
246 # host1 - IPv6 in
247 ip -6 -netns $host1 xfrm policy add \
249 tmpl src ${HOST2_6} dst ${HOST1_6} proto esp mode tunnel
251 # host2 - IPv6 out
252 ip -6 -netns $host2 xfrm policy add \
254 tmpl src ${HOST2_6} dst ${HOST1_6} proto esp mode tunnel
259 ip -netns $host1 xfrm state add src ${HOST1_4} dst ${HOST2_4} \
260 proto esp spi ${SPI_1} reqid 0 mode tunnel \
261 replay-window 4 replay-oseq 0x4 \
262 auth-trunc 'hmac(sha1)' ${AUTH_1} 96 \
266 ip -netns $host2 xfrm state add src ${HOST1_4} dst ${HOST2_4} \
267 proto esp spi ${SPI_1} reqid 0 mode tunnel \
268 replay-window 4 replay-oseq 0x4 \
269 auth-trunc 'hmac(sha1)' ${AUTH_1} 96 \
274 ip -netns $host1 xfrm state add src ${HOST2_4} dst ${HOST1_4} \
275 proto esp spi ${SPI_2} reqid 0 mode tunnel \
276 replay-window 4 replay-oseq 0x4 \
277 auth-trunc 'hmac(sha1)' ${AUTH_2} 96 \
281 ip -netns $host2 xfrm state add src ${HOST2_4} dst ${HOST1_4} \
282 proto esp spi ${SPI_2} reqid 0 mode tunnel \
283 replay-window 4 replay-oseq 0x4 \
284 auth-trunc 'hmac(sha1)' ${AUTH_2} 96 \
289 ip -6 -netns $host1 xfrm state add src ${HOST1_6} dst ${HOST2_6} \
290 proto esp spi ${SPI_1} reqid 0 mode tunnel \
291 replay-window 4 replay-oseq 0x4 \
292 auth-trunc 'hmac(sha1)' ${AUTH_1} 96 \
296 ip -6 -netns $host2 xfrm state add src ${HOST1_6} dst ${HOST2_6} \
297 proto esp spi ${SPI_1} reqid 0 mode tunnel \
298 replay-window 4 replay-oseq 0x4 \
299 auth-trunc 'hmac(sha1)' ${AUTH_1} 96 \
304 ip -6 -netns $host1 xfrm state add src ${HOST2_6} dst ${HOST1_6} \
305 proto esp spi ${SPI_2} reqid 0 mode tunnel \
306 replay-window 4 replay-oseq 0x4 \
307 auth-trunc 'hmac(sha1)' ${AUTH_2} 96 \
311 ip -6 -netns $host2 xfrm state add src ${HOST2_6} dst ${HOST1_6} \
312 proto esp spi ${SPI_2} reqid 0 mode tunnel \
313 replay-window 4 replay-oseq 0x4 \
314 auth-trunc 'hmac(sha1)' ${AUTH_2} 96 \
321 ip -netns $host1 li del xfrm0
322 ip -netns $host2 addr del ${XFRM2_4}/24 dev eth0
323 ip -netns $host2 addr del ${XFRM2_6}/64 dev eth0
330 ip -netns $host1 li add type xfrm dev eth0 if_id ${IF_ID}
331 ip -netns $host1 li set xfrm0 ${vrfarg} up
332 ip -netns $host1 addr add ${XFRM1_4}/24 dev xfrm0
333 ip -netns $host1 addr add ${XFRM1_6}/64 dev xfrm0
335 ip -netns $host2 addr add ${XFRM2_4}/24 dev eth0
336 ip -netns $host2 addr add ${XFRM2_6}/64 dev eth0
346 run_cmd_host1 ip vrf exec ${VRF} ping -c1 -w1 ${HOST2_4}
348 run_cmd_host1 ip vrf exec ${VRF} ${ping6} -c1 -w1 ${HOST2_6}
353 run_cmd_host1 ip vrf exec ${VRF} ping -c1 -w1 ${HOST2_4}
355 run_cmd_host1 ip vrf exec ${VRF} ${ping6} -c1 -w1 ${HOST2_6}
363 # run_cmd_host1 ip vrf exec ${VRF} ping -c1 -w1 ${HOST2_4}
365 run_cmd_host1 ip vrf exec ${VRF} ${ping6} -c1 -w1 ${HOST2_6}
373 # run_cmd_host1 ip vrf exec ${VRF} ping -c1 -w1 ${HOST2_4}
375 # run_cmd_host1 ip vrf exec ${VRF} ${ping6} -c1 -w1 ${HOST2_6}
381 run_cmd_host1 ip vrf exec ${VRF} ping -c1 -w1 ${XFRM2_4}
383 run_cmd_host1 ip vrf exec ${VRF} ${ping6} -c1 -w1 ${XFRM2_6}
396 -p Pause on fail
397 -v verbose mode (show commands and output)