-
-
Save rm77/bd6845b6c0e98db754d3c55e90d9d0ac to your computer and use it in GitHub Desktop.
Linux VxLAN performance test setup script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -xe | |
# $0 host dev remote_ip | |
# host is 1 or 2 | |
# on vmA | |
# ./mk-vx.sh 1 ens3 10.10.10.9 | |
# on vmB | |
# ./mk-vx.sh 2 ens3 10.10.10.15 | |
if [[ $# -ne 3 ]]; then | |
echo "Usage: $0 <1|2> <base-interface> <remote-tunnel-ip>" | |
exit | |
fi | |
H=$1 | |
OH=$((3 - H)) | |
# mac for vxlan interface | |
MAC=2a:c2:d3:00:00:0$H | |
O_MAC=2a:c2:d3:00:00:0$OH | |
DEV=$2 | |
# ip for vxlan interface | |
INNER_IP=192.168.0.$H | |
REMOTE_IP=$3 | |
REMOTE_INNER=192.168.0.$OH | |
ip link del vxlan42 || true | |
ip link add vxlan42 type vxlan id 42 dstport 4789 nolearning dev $DEV proxy udpcsum | |
#ip link add vxlan42 type vxlan id 42 dstport 4789 nolearning dev $DEV proxy udpcsum remcsumtx remcsumrx | |
#ip link add vxlan42 type vxlan id 42 dstport 4789 nolearning dev $DEV proxy noudpcsum | |
#ip link add vxlan42 type vxlan id 42 dstport 4747 nolearning dev $DEV proxy udpcsum | |
ip link set address $MAC vxlan42 | |
ip neigh add $REMOTE_INNER lladdr $O_MAC dev vxlan42 | |
bridge fdb append $O_MAC dev vxlan42 dst $REMOTE_IP | |
ip address add ${INNER_IP}/29 dev vxlan42 | |
ip link set vxlan42 up | |
ip -d link show vxlan42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment