# This test is for checking the [no]localbypass VXLAN device option. The test # configures two VXLAN devices in the same network namespace and a tc filter on # the loopback device that drops encapsulated packets. The test sends packets # from the first VXLAN device and verifies that by default these packets are # received by the second VXLAN device. The test then enables the nolocalbypass # option and verifies that packets are no longer received by the second VXLAN # device.
ip -n $ns1 address add 192.0.2.1/32 dev lo
ip -n $ns1 address add 198.51.100.1/32 dev lo
ip -n $ns1 link add name vx0 up type vxlan id 100 local 198.51.100.1 \
dstport 4789 nolearning
ip -n $ns1 link add name vx1 up type vxlan id 100 dstport 4790
}
-t <test> Test(s) to run (default: all)
(options: $TESTS)
-p Pause on fail
-P Pause after each test before cleanup
-v Verbose mode (show commands and output)
EOF
}
################################################################################ # Main
trap cleanup EXIT
while getopts ":t:pPvh" opt; do
case $opt in
t) TESTS=$OPTARG ;;
p) PAUSE_ON_FAIL=yes;;
P) PAUSE=yes;;
v) VERBOSE=$(($VERBOSE + 1));;
h) usage; exit 0;;
*) usage; exit 1;;
esac done
# Make sure we don't pause twice.
[ "${PAUSE}" = "yes" ] && PAUSE_ON_FAIL=no
if [ "$(id -u)" -ne 0 ];then echo"SKIP: Need root privileges"
exit $ksft_skip; fi
if [ ! -x "$(command -v ip)" ]; then echo"SKIP: Could not run test without ip tool"
exit $ksft_skip fi
if [ ! -x "$(command -v bridge)" ]; then echo"SKIP: Could not run test without bridge tool"
exit $ksft_skip fi
if [ ! -x "$(command -v mausezahn)" ]; then echo"SKIP: Could not run test without mausezahn tool"
exit $ksft_skip fi
if [ ! -x "$(command -v jq)" ]; then echo"SKIP: Could not run test without jq tool"
exit $ksft_skip fi
ip link help vxlan 2>&1 | grep -q "localbypass" if [ $? -ne 0 ]; then echo"SKIP: iproute2 ip too old, missing VXLAN nolocalbypass support"
exit $ksft_skip fi
cleanup
for t in $TESTS do
setup; $t; cleanup; done
if [ "$TESTS" != "none" ]; then
printf "\nTests passed: %3d\n" ${nsuccess}
printf "Tests failed: %3d\n" ${nfail} fi
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.