1f08c3bdfSopenharmony_ci#!/bin/sh 2f08c3bdfSopenharmony_ci# SPDX-License-Identifier: GPL-2.0-or-later 3f08c3bdfSopenharmony_ci# Copyright (c) 2018-2022 Petr Vorel <pvorel@suse.cz> 4f08c3bdfSopenharmony_ci# Copyright (c) 2016 Red Hat Inc., All Rights Reserved. 5f08c3bdfSopenharmony_ci# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved. 6f08c3bdfSopenharmony_ci# Author: Hangbin Liu <haliu@redhat.com> 7f08c3bdfSopenharmony_ci 8f08c3bdfSopenharmony_ci# Authenticated encryption with associated data 9f08c3bdfSopenharmony_ciAEALGO="rfc4106_128" 10f08c3bdfSopenharmony_ci# Encryption algorithm 11f08c3bdfSopenharmony_ciEALGO="des3_ede" 12f08c3bdfSopenharmony_ci# Authentication algorithm 13f08c3bdfSopenharmony_ciAALGO="sha1" 14f08c3bdfSopenharmony_ci# Compression algorithm 15f08c3bdfSopenharmony_ciCALGO="deflate" 16f08c3bdfSopenharmony_ci 17f08c3bdfSopenharmony_ciIPSEC_REQUESTS="500" 18f08c3bdfSopenharmony_ci 19f08c3bdfSopenharmony_ciTST_OPTS="l:m:p:s:S:k:A:e:a:c:r:" 20f08c3bdfSopenharmony_ciTST_PARSE_ARGS=ipsec_lib_parse_args 21f08c3bdfSopenharmony_ciTST_SETUP=${TST_SETUP:-ipsec_lib_setup} 22f08c3bdfSopenharmony_ciTST_USAGE=ipsec_lib_usage 23f08c3bdfSopenharmony_ci 24f08c3bdfSopenharmony_ciipsec_lib_usage() 25f08c3bdfSopenharmony_ci{ 26f08c3bdfSopenharmony_ci echo "l n n is the number of test link when tests run" 27f08c3bdfSopenharmony_ci echo "m x x is ipsec mode, could be transport / tunnel" 28f08c3bdfSopenharmony_ci echo "p x x is ipsec protocol, could be ah / esp / comp" 29f08c3bdfSopenharmony_ci echo "s x x is icmp message size array" 30f08c3bdfSopenharmony_ci echo "S n n is IPsec SPI value" 31f08c3bdfSopenharmony_ci echo "k x key for vti interface" 32f08c3bdfSopenharmony_ci echo "A x Authenticated encryption with associated data algorithm" 33f08c3bdfSopenharmony_ci echo "e x Encryption algorithm" 34f08c3bdfSopenharmony_ci echo "a x Authentication algorithm" 35f08c3bdfSopenharmony_ci echo "c x Compression algorithm" 36f08c3bdfSopenharmony_ci echo "r x Num of requests, PING_MAX or netstress' '-r' opt" 37f08c3bdfSopenharmony_ci} 38f08c3bdfSopenharmony_ci 39f08c3bdfSopenharmony_ciipsec_lib_parse_args() 40f08c3bdfSopenharmony_ci{ 41f08c3bdfSopenharmony_ci case "$1" in 42f08c3bdfSopenharmony_ci l) LINK_NUM=$2;; 43f08c3bdfSopenharmony_ci m) IPSEC_MODE=$2;; 44f08c3bdfSopenharmony_ci p) IPSEC_PROTO=$2;; 45f08c3bdfSopenharmony_ci s) TST_TEST_DATA="$2"; TST_TEST_DATA_IFS=":";; 46f08c3bdfSopenharmony_ci S) SPI=$2;; 47f08c3bdfSopenharmony_ci k) VTI_KEY=$2;; 48f08c3bdfSopenharmony_ci A) AEALGO=$2;; 49f08c3bdfSopenharmony_ci e) EALGO=$2;; 50f08c3bdfSopenharmony_ci a) AALGO=$2;; 51f08c3bdfSopenharmony_ci c) CALGO=$2;; 52f08c3bdfSopenharmony_ci r) IPSEC_REQUESTS="$2";; 53f08c3bdfSopenharmony_ci esac 54f08c3bdfSopenharmony_ci} 55f08c3bdfSopenharmony_ci 56f08c3bdfSopenharmony_ciipsec_lib_setup() 57f08c3bdfSopenharmony_ci{ 58f08c3bdfSopenharmony_ci case $AEALGO in 59f08c3bdfSopenharmony_ci rfc4106_128|rfc4543_128) AEALGO_KEY=$(get_key 160);; 60f08c3bdfSopenharmony_ci rfc4106_192|rfc4543_192) AEALGO_KEY=$(get_key 224);; 61f08c3bdfSopenharmony_ci rfc4106_256|rfc4543_256) AEALGO_KEY=$(get_key 288);; 62f08c3bdfSopenharmony_ci rfc4309_128) AEALGO_KEY=$(get_key 152);; 63f08c3bdfSopenharmony_ci rfc4309_192) AEALGO_KEY=$(get_key 216);; 64f08c3bdfSopenharmony_ci rfc4309_256) AEALGO_KEY=$(get_key 280);; 65f08c3bdfSopenharmony_ci esac 66f08c3bdfSopenharmony_ci 67f08c3bdfSopenharmony_ci case $EALGO in 68f08c3bdfSopenharmony_ci des) EALGO_KEY=$(get_key 64);; 69f08c3bdfSopenharmony_ci des3_ede) EALGO_KEY=$(get_key 192);; 70f08c3bdfSopenharmony_ci cast5) EALGO_KEY=$(get_key 128);; 71f08c3bdfSopenharmony_ci blowfish) EALGO_KEY=$(get_key 448);; 72f08c3bdfSopenharmony_ci aes|twofish|camellia|serpent) EALGO_KEY=$(get_key 256);; 73f08c3bdfSopenharmony_ci *) tst_brk TBROK "unknown enc alg: $EALGO";; 74f08c3bdfSopenharmony_ci esac 75f08c3bdfSopenharmony_ci 76f08c3bdfSopenharmony_ci case $AALGO in 77f08c3bdfSopenharmony_ci sha1|rmd160) AALGO_KEY=$(get_key 160);; 78f08c3bdfSopenharmony_ci sha256) AALGO_KEY=$(get_key 256);; 79f08c3bdfSopenharmony_ci sha384) AALGO_KEY=$(get_key 384);; 80f08c3bdfSopenharmony_ci sha512) AALGO_KEY=$(get_key 512);; 81f08c3bdfSopenharmony_ci *) tst_brk TBROK "unknown auth alg: $AALGO";; 82f08c3bdfSopenharmony_ci esac 83f08c3bdfSopenharmony_ci 84f08c3bdfSopenharmony_ci SPI=${SPI:-1000} 85f08c3bdfSopenharmony_ci VTI_KEY=${VTI_KEY:-10} 86f08c3bdfSopenharmony_ci cleanup_vti= 87f08c3bdfSopenharmony_ci ALG= 88f08c3bdfSopenharmony_ci ALGR= 89f08c3bdfSopenharmony_ci 90f08c3bdfSopenharmony_ci if [ -n "$IPSEC_MODE" ]; then 91f08c3bdfSopenharmony_ci tst_net_run -q "tst_check_drivers xfrm_user" || \ 92f08c3bdfSopenharmony_ci tst_brk TCONF "xfrm_user driver not available on lhost or rhost" 93f08c3bdfSopenharmony_ci cleanup_xfrm=1 94f08c3bdfSopenharmony_ci fi 95f08c3bdfSopenharmony_ci} 96f08c3bdfSopenharmony_ci 97f08c3bdfSopenharmony_ciget_key() 98f08c3bdfSopenharmony_ci{ 99f08c3bdfSopenharmony_ci local bits=$1 100f08c3bdfSopenharmony_ci local bytes=$(( $bits / 8)) 101f08c3bdfSopenharmony_ci echo "0x$(hexdump -vn $bytes -e '1/1 "%02x"' /dev/urandom)" 102f08c3bdfSopenharmony_ci} 103f08c3bdfSopenharmony_ci 104f08c3bdfSopenharmony_citst_ipsec_setup() 105f08c3bdfSopenharmony_ci{ 106f08c3bdfSopenharmony_ci ipsec_lib_setup 107f08c3bdfSopenharmony_ci # Configure SAD/SPD 108f08c3bdfSopenharmony_ci if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then 109f08c3bdfSopenharmony_ci tst_res TINFO "IPsec[$IPSEC_PROTO/$IPSEC_MODE]" 110f08c3bdfSopenharmony_ci tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost) 111f08c3bdfSopenharmony_ci tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr) 112f08c3bdfSopenharmony_ci fi 113f08c3bdfSopenharmony_ci} 114f08c3bdfSopenharmony_ci 115f08c3bdfSopenharmony_ci# tst_ipsec_cleanup: flush ipsec state and policy rules 116f08c3bdfSopenharmony_citst_ipsec_cleanup() 117f08c3bdfSopenharmony_ci{ 118f08c3bdfSopenharmony_ci [ -z "$cleanup_xfrm" ] && return 119f08c3bdfSopenharmony_ci 120f08c3bdfSopenharmony_ci ip xfrm state flush 121f08c3bdfSopenharmony_ci ip xfrm policy flush 122f08c3bdfSopenharmony_ci tst_rhost_run -c "ip xfrm state flush && ip xfrm policy flush" 123f08c3bdfSopenharmony_ci 124f08c3bdfSopenharmony_ci if [ -n "$cleanup_vti" ]; then 125f08c3bdfSopenharmony_ci ip link del $cleanup_vti 2>/dev/null 126f08c3bdfSopenharmony_ci tst_rhost_run -c "ip link del $cleanup_vti 2>/dev/null" 127f08c3bdfSopenharmony_ci fi 128f08c3bdfSopenharmony_ci} 129f08c3bdfSopenharmony_ci 130f08c3bdfSopenharmony_ciipsec_set_algoline() 131f08c3bdfSopenharmony_ci{ 132f08c3bdfSopenharmony_ci case $IPSEC_PROTO in 133f08c3bdfSopenharmony_ci ah) 134f08c3bdfSopenharmony_ci ALG='auth hmac('$AALGO') '$AALGO_KEY 135f08c3bdfSopenharmony_ci ALGR='auth hmac\('$AALGO'\) '$AALGO_KEY 136f08c3bdfSopenharmony_ci ;; 137f08c3bdfSopenharmony_ci esp) 138f08c3bdfSopenharmony_ci ALG="enc $EALGO $EALGO_KEY auth "'hmac('$AALGO') '$AALGO_KEY 139f08c3bdfSopenharmony_ci ALGR="enc $EALGO $EALGO_KEY auth "'hmac\('$AALGO'\) '$AALGO_KEY 140f08c3bdfSopenharmony_ci ;; 141f08c3bdfSopenharmony_ci esp_aead) 142f08c3bdfSopenharmony_ci case $AEALGO in 143f08c3bdfSopenharmony_ci rfc4106_128|rfc4106_192|rfc4106_256) 144f08c3bdfSopenharmony_ci ALG="aead "'rfc4106(gcm(aes))'" $AEALGO_KEY 128" 145f08c3bdfSopenharmony_ci ALGR="aead "'rfc4106\(gcm\(aes\)\)'" $AEALGO_KEY 128" 146f08c3bdfSopenharmony_ci ;; 147f08c3bdfSopenharmony_ci rfc4309_128|rfc4309_192|rfc4309_256) 148f08c3bdfSopenharmony_ci ALG="aead "'rfc4309(ccm(aes))'" $AEALGO_KEY 128" 149f08c3bdfSopenharmony_ci ALGR="aead "'rfc4309\(ccm\(aes\)\)'" $AEALGO_KEY 128" 150f08c3bdfSopenharmony_ci ;; 151f08c3bdfSopenharmony_ci rfc4543_128|rfc4543_192|rfc4543_256) 152f08c3bdfSopenharmony_ci ALG="aead "'rfc4543(gcm(aes))'" $AEALGO_KEY 128" 153f08c3bdfSopenharmony_ci ALGR="aead "'rfc4543\(gcm\(aes\)\)'" $AEALGO_KEY 128" 154f08c3bdfSopenharmony_ci ;; 155f08c3bdfSopenharmony_ci esac 156f08c3bdfSopenharmony_ci ;; 157f08c3bdfSopenharmony_ci comp) 158f08c3bdfSopenharmony_ci ALG="comp $CALGO" 159f08c3bdfSopenharmony_ci ALGR=$ALG 160f08c3bdfSopenharmony_ci ;; 161f08c3bdfSopenharmony_ci *) 162f08c3bdfSopenharmony_ci tst_brk TCONF "tst_ipsec protocol mismatch" 163f08c3bdfSopenharmony_ci ;; 164f08c3bdfSopenharmony_ci esac 165f08c3bdfSopenharmony_ci} 166f08c3bdfSopenharmony_ci 167f08c3bdfSopenharmony_ci# tst_ipsec target src_addr dst_addr: config ipsec 168f08c3bdfSopenharmony_ci# 169f08c3bdfSopenharmony_ci# target: target of the configuration host ( lhost / rhost ) 170f08c3bdfSopenharmony_ci# src_addr: source IP address 171f08c3bdfSopenharmony_ci# dst_addr: destination IP address 172f08c3bdfSopenharmony_citst_ipsec() 173f08c3bdfSopenharmony_ci{ 174f08c3bdfSopenharmony_ci if [ $# -ne 3 ]; then 175f08c3bdfSopenharmony_ci tst_brk TCONF "tst_ipsec parameter mismatch" 176f08c3bdfSopenharmony_ci fi 177f08c3bdfSopenharmony_ci 178f08c3bdfSopenharmony_ci local target=$1 179f08c3bdfSopenharmony_ci local src=$2 180f08c3bdfSopenharmony_ci local dst=$3 181f08c3bdfSopenharmony_ci local mode=$IPSEC_MODE 182f08c3bdfSopenharmony_ci local p="proto $IPSEC_PROTO" 183f08c3bdfSopenharmony_ci [ "$IPSEC_PROTO" = "esp_aead" ] && p="proto esp" 184f08c3bdfSopenharmony_ci 185f08c3bdfSopenharmony_ci ipsec_set_algoline 186f08c3bdfSopenharmony_ci 187f08c3bdfSopenharmony_ci if [ $target = lhost ]; then 188f08c3bdfSopenharmony_ci local spi_1="0x$SPI" 189f08c3bdfSopenharmony_ci local spi_2="0x$(( $SPI + 1 ))" 190f08c3bdfSopenharmony_ci TST_RTNL_CHK ip xfrm state add src $src dst $dst spi $spi_1 \ 191f08c3bdfSopenharmony_ci $p $ALG mode $mode sel src $src dst $dst 192f08c3bdfSopenharmony_ci ROD ip xfrm state add src $dst dst $src spi $spi_2 \ 193f08c3bdfSopenharmony_ci $p $ALG mode $mode sel src $dst dst $src 194f08c3bdfSopenharmony_ci 195f08c3bdfSopenharmony_ci ROD ip xfrm policy add src $src dst $dst dir out tmpl src $src \ 196f08c3bdfSopenharmony_ci dst $dst $p mode $mode 197f08c3bdfSopenharmony_ci ROD ip xfrm policy add src $dst dst $src dir in tmpl src $dst \ 198f08c3bdfSopenharmony_ci dst $src $p mode $mode level use 199f08c3bdfSopenharmony_ci elif [ $target = rhost ]; then 200f08c3bdfSopenharmony_ci local spi_1="0x$(( $SPI + 1 ))" 201f08c3bdfSopenharmony_ci local spi_2="0x$SPI" 202f08c3bdfSopenharmony_ci tst_rhost_run -s -c "ip xfrm state add src $src dst $dst \ 203f08c3bdfSopenharmony_ci spi $spi_1 $p $ALGR mode $mode sel src $src dst $dst" 204f08c3bdfSopenharmony_ci tst_rhost_run -s -c "ip xfrm state add src $dst dst $src \ 205f08c3bdfSopenharmony_ci spi $spi_2 $p $ALGR mode $mode sel src $dst dst $src" 206f08c3bdfSopenharmony_ci 207f08c3bdfSopenharmony_ci tst_rhost_run -s -c "ip xfrm policy add src $src dst $dst \ 208f08c3bdfSopenharmony_ci dir out tmpl src $src dst $dst $p mode $mode" 209f08c3bdfSopenharmony_ci tst_rhost_run -s -c "ip xfrm policy add src $dst dst $src dir \ 210f08c3bdfSopenharmony_ci in tmpl src $dst dst $src $p mode $mode level use" 211f08c3bdfSopenharmony_ci fi 212f08c3bdfSopenharmony_ci} 213f08c3bdfSopenharmony_ci 214f08c3bdfSopenharmony_ci# tst_ipsec_vti target src_addr dst_addr vti_name 215f08c3bdfSopenharmony_ci# 216f08c3bdfSopenharmony_ci# target: target of the configuration host ( lhost / rhost ) 217f08c3bdfSopenharmony_ci# src_addr: source IP address 218f08c3bdfSopenharmony_ci# dst_addr: destination IP address 219f08c3bdfSopenharmony_ci# vti_name: name of vti interface 220f08c3bdfSopenharmony_citst_ipsec_vti() 221f08c3bdfSopenharmony_ci{ 222f08c3bdfSopenharmony_ci if [ $# -ne 4 ]; then 223f08c3bdfSopenharmony_ci tst_brk TCONF "tst_ipsec_vti parameter mismatch" 224f08c3bdfSopenharmony_ci fi 225f08c3bdfSopenharmony_ci 226f08c3bdfSopenharmony_ci local target=$1 227f08c3bdfSopenharmony_ci local src=$2 228f08c3bdfSopenharmony_ci local dst=$3 229f08c3bdfSopenharmony_ci local vti=$4 230f08c3bdfSopenharmony_ci local m="mode $IPSEC_MODE" 231f08c3bdfSopenharmony_ci local p="proto $IPSEC_PROTO" 232f08c3bdfSopenharmony_ci [ "$IPSEC_PROTO" = "esp_aead" ] && p="proto esp" 233f08c3bdfSopenharmony_ci 234f08c3bdfSopenharmony_ci local key="key $VTI_KEY" 235f08c3bdfSopenharmony_ci local mrk="mark $VTI_KEY" 236f08c3bdfSopenharmony_ci local type="type vti$TST_IPV6" 237f08c3bdfSopenharmony_ci local d="dev $(tst_iface)" 238f08c3bdfSopenharmony_ci local rd="dev $(tst_iface rhost)" 239f08c3bdfSopenharmony_ci 240f08c3bdfSopenharmony_ci ip link add type vti help 2>&1 | grep -q vti || \ 241f08c3bdfSopenharmony_ci tst_brk TCONF "iproute doesn't support 'vti'" 242f08c3bdfSopenharmony_ci 243f08c3bdfSopenharmony_ci ipsec_set_algoline 244f08c3bdfSopenharmony_ci 245f08c3bdfSopenharmony_ci local o_dir="src $src dst $dst" 246f08c3bdfSopenharmony_ci local i_dir="src $dst dst $src" 247f08c3bdfSopenharmony_ci local ipx="ip -$TST_IPVER xf" 248f08c3bdfSopenharmony_ci 249f08c3bdfSopenharmony_ci cleanup_vti=$vti 250f08c3bdfSopenharmony_ci 251f08c3bdfSopenharmony_ci if [ $target = lhost ]; then 252f08c3bdfSopenharmony_ci TST_RTNL_CHK ip link add $vti $type local $src remote $dst $key $d 253f08c3bdfSopenharmony_ci ROD ip link set $vti up 254f08c3bdfSopenharmony_ci 255f08c3bdfSopenharmony_ci local spi_1="spi 0x$SPI" 256f08c3bdfSopenharmony_ci local spi_2="spi 0x$(( $SPI + 1 ))" 257f08c3bdfSopenharmony_ci TST_RTNL_CHK $ipx st add $o_dir $p $spi_1 $ALG $m 258f08c3bdfSopenharmony_ci ROD $ipx st add $i_dir $p $spi_2 $ALG $m 259f08c3bdfSopenharmony_ci ROD $ipx po add dir out tmpl $o_dir $p $m $mrk 260f08c3bdfSopenharmony_ci ROD $ipx po add dir in tmpl $i_dir $p $m $mrk 261f08c3bdfSopenharmony_ci elif [ $target = rhost ]; then 262f08c3bdfSopenharmony_ci tst_rhost_run -s -c \ 263f08c3bdfSopenharmony_ci "ip link add $vti $type local $src remote $dst $key $rd" 264f08c3bdfSopenharmony_ci tst_rhost_run -s -c "ip link set $vti up" 265f08c3bdfSopenharmony_ci 266f08c3bdfSopenharmony_ci local spi_1="spi 0x$(( $SPI + 1 ))" 267f08c3bdfSopenharmony_ci local spi_2="spi 0x$SPI" 268f08c3bdfSopenharmony_ci tst_rhost_run -s -c "$ipx st add $o_dir $p $spi_1 $ALGR $m" 269f08c3bdfSopenharmony_ci tst_rhost_run -s -c "$ipx st add $i_dir $p $spi_2 $ALGR $m" 270f08c3bdfSopenharmony_ci tst_rhost_run -s -c "$ipx po add dir out tmpl $o_dir $p $m $mrk" 271f08c3bdfSopenharmony_ci tst_rhost_run -s -c "$ipx po add dir in tmpl $i_dir $p $m $mrk" 272f08c3bdfSopenharmony_ci fi 273f08c3bdfSopenharmony_ci} 274f08c3bdfSopenharmony_ci 275f08c3bdfSopenharmony_ci# Setup vti/vti6 interface for IPsec tunneling 276f08c3bdfSopenharmony_ci# The function sets variables: 277f08c3bdfSopenharmony_ci# * tst_vti - vti interface name, 278f08c3bdfSopenharmony_ci# * ip_loc_tun - local IP address on vti interface 279f08c3bdfSopenharmony_ci# * ip_rmt_tun - remote IP address 280f08c3bdfSopenharmony_citst_ipsec_setup_vti() 281f08c3bdfSopenharmony_ci{ 282f08c3bdfSopenharmony_ci ipsec_lib_setup 283f08c3bdfSopenharmony_ci 284f08c3bdfSopenharmony_ci if_loc=$(tst_iface) 285f08c3bdfSopenharmony_ci if_rmt=$(tst_iface rhost) 286f08c3bdfSopenharmony_ci 287f08c3bdfSopenharmony_ci ip_loc=$(tst_ipaddr) 288f08c3bdfSopenharmony_ci ip_rmt=$(tst_ipaddr rhost) 289f08c3bdfSopenharmony_ci 290f08c3bdfSopenharmony_ci tst_vti="ltp_vti0" 291f08c3bdfSopenharmony_ci 292f08c3bdfSopenharmony_ci tst_res TINFO "Test vti$TST_IPV6 + IPsec[$IPSEC_PROTO/$IPSEC_MODE]" 293f08c3bdfSopenharmony_ci 294f08c3bdfSopenharmony_ci tst_net_run -q "tst_check_drivers ip${TST_IPV6}_vti" || \ 295f08c3bdfSopenharmony_ci tst_brk TCONF "ip${TST_IPV6}_vti driver not available on lhost or rhost" 296f08c3bdfSopenharmony_ci 297f08c3bdfSopenharmony_ci tst_ipsec_vti lhost $ip_loc $ip_rmt $tst_vti 298f08c3bdfSopenharmony_ci tst_ipsec_vti rhost $ip_rmt $ip_loc $tst_vti 299f08c3bdfSopenharmony_ci 300f08c3bdfSopenharmony_ci local mask address_opt 301f08c3bdfSopenharmony_ci if [ "$TST_IPV6" ]; then 302f08c3bdfSopenharmony_ci ip_loc_tun="${IPV6_NET32_UNUSED}::1"; 303f08c3bdfSopenharmony_ci ip_rmt_tun="${IPV6_NET32_UNUSED}::2"; 304f08c3bdfSopenharmony_ci mask=64 305f08c3bdfSopenharmony_ci address_opt=nodad 306f08c3bdfSopenharmony_ci ROD ip -6 route add ${IPV6_NET32_UNUSED}::/$mask dev $tst_vti 307f08c3bdfSopenharmony_ci else 308f08c3bdfSopenharmony_ci ip_loc_tun="${IPV4_NET16_UNUSED}.1.1"; 309f08c3bdfSopenharmony_ci ip_rmt_tun="${IPV4_NET16_UNUSED}.1.2"; 310f08c3bdfSopenharmony_ci mask=30 311f08c3bdfSopenharmony_ci ROD ip route add ${IPV4_NET16_UNUSED}.1.0/$mask dev $tst_vti 312f08c3bdfSopenharmony_ci fi 313f08c3bdfSopenharmony_ci 314f08c3bdfSopenharmony_ci tst_res TINFO "Add IPs to vti tunnel, " \ 315f08c3bdfSopenharmony_ci "loc: $ip_loc_tun/$mask, rmt: $ip_rmt_tun/$mask" 316f08c3bdfSopenharmony_ci 317f08c3bdfSopenharmony_ci ROD ip addr add $ip_loc_tun/$mask dev $tst_vti $address_opt 318f08c3bdfSopenharmony_ci tst_rhost_run -s -c "ip addr add $ip_rmt_tun/$mask dev $tst_vti" 319f08c3bdfSopenharmony_ci} 320f08c3bdfSopenharmony_ci 321f08c3bdfSopenharmony_ci. tst_net.sh 322