f-stack/dpdk/examples/ipsec-secgw/test/trs_aesctr_sha1_defs.sh

70 lines
2.2 KiB
Bash
Raw Normal View History

2020-06-18 16:55:50 +00:00
#! /bin/bash
# SPDX-License-Identifier: BSD-3-Clause
. ${DIR}/trs_aesctr_sha1_common_defs.sh
2021-02-05 08:48:47 +00:00
SGW_CMD_XPRM="${DPDK_VARS} ${DPDK_MODE} ${SGW_CMD_XPRM}"
2020-06-18 16:55:50 +00:00
2021-02-05 08:48:47 +00:00
config_remote_xfrm_44()
2020-06-18 16:55:50 +00:00
{
ssh ${REMOTE_HOST} ip xfrm policy flush
ssh ${REMOTE_HOST} ip xfrm state flush
ssh ${REMOTE_HOST} ip xfrm policy add \
src ${REMOTE_IPV4} dst ${LOCAL_IPV4} \
dir out ptype main action allow \
tmpl proto esp mode transport reqid 1
ssh ${REMOTE_HOST} ip xfrm policy add \
src ${LOCAL_IPV4} dst ${REMOTE_IPV4} \
dir in ptype main action allow \
tmpl proto esp mode transport reqid 2
ssh ${REMOTE_HOST} ip xfrm state add \
src ${REMOTE_IPV4} dst ${LOCAL_IPV4} \
2021-02-05 08:48:47 +00:00
proto esp spi 7 reqid 1 mode transport replay-window 64 ${XFRM_ESN} \
2020-06-18 16:55:50 +00:00
auth sha1 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef \
enc "rfc3686\(ctr\(aes\)\)" 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
ssh ${REMOTE_HOST} ip xfrm state add \
src ${LOCAL_IPV4} dst ${REMOTE_IPV4} \
2021-02-05 08:48:47 +00:00
proto esp spi 7 reqid 2 mode transport replay-window 64 ${XFRM_ESN} \
2020-06-18 16:55:50 +00:00
auth sha1 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef \
enc "rfc3686\(ctr\(aes\)\)" 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
ssh ${REMOTE_HOST} ip xfrm policy list
ssh ${REMOTE_HOST} ip xfrm state list
}
2021-02-05 08:48:47 +00:00
config_remote_xfrm_66()
2020-06-18 16:55:50 +00:00
{
2021-02-05 08:48:47 +00:00
ssh ${REMOTE_HOST} ip xfrm policy flush
ssh ${REMOTE_HOST} ip xfrm state flush
2020-06-18 16:55:50 +00:00
ssh ${REMOTE_HOST} ip xfrm policy add \
src ${REMOTE_IPV6} dst ${LOCAL_IPV6} \
dir out ptype main action allow \
tmpl proto esp mode transport reqid 3
ssh ${REMOTE_HOST} ip xfrm policy add \
src ${LOCAL_IPV6} dst ${REMOTE_IPV6} \
dir in ptype main action allow \
tmpl proto esp mode transport reqid 4
ssh ${REMOTE_HOST} ip xfrm state add \
src ${REMOTE_IPV6} dst ${LOCAL_IPV6} \
2021-02-05 08:48:47 +00:00
proto esp spi 9 reqid 3 mode transport replay-window 64 ${XFRM_ESN} \
2020-06-18 16:55:50 +00:00
auth sha1 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef \
enc "rfc3686\(ctr\(aes\)\)" 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
ssh ${REMOTE_HOST} ip xfrm state add \
src ${LOCAL_IPV6} dst ${REMOTE_IPV6} \
2021-02-05 08:48:47 +00:00
proto esp spi 9 reqid 4 mode transport replay-window 64 ${XFRM_ESN} \
2020-06-18 16:55:50 +00:00
auth sha1 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef \
enc "rfc3686\(ctr\(aes\)\)" 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
ssh ${REMOTE_HOST} ip xfrm policy list
ssh ${REMOTE_HOST} ip xfrm state list
}