mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-05-14 14:02:45 +00:00
iperf3 testing script
This commit is contained in:
parent
c4ed29b234
commit
fe85ecd15c
1 changed files with 14 additions and 7 deletions
|
@ -1,6 +1,13 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# sudo apt install iperf3 dante-server
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
echo $SCRIPT_DIR
|
||||||
|
|
||||||
netns="test"
|
netns="test"
|
||||||
dante="sockd"
|
dante="danted"
|
||||||
tun2proxy="../../target/release/tun2proxy"
|
tun2proxy="${SCRIPT_DIR}/../../target/release/tun2proxy"
|
||||||
|
|
||||||
ip netns add "$netns"
|
ip netns add "$netns"
|
||||||
|
|
||||||
|
@ -20,10 +27,10 @@ ip netns exec "$netns" ip addr add 127.0.0.1/8 dev lo
|
||||||
ip netns exec "$netns" ip link set dev lo up
|
ip netns exec "$netns" ip link set dev lo up
|
||||||
|
|
||||||
echo "Starting Dante in background ..."
|
echo "Starting Dante in background ..."
|
||||||
ip netns exec "$netns" "$dante" -f dante.conf &
|
ip netns exec "$netns" "$dante" -f ${SCRIPT_DIR}/dante.conf &
|
||||||
|
|
||||||
# Start iperf server in netns
|
# Start iperf3 server in netns
|
||||||
ip netns exec "$netns" iperf -s -B 10.0.0.4 &
|
ip netns exec "$netns" iperf3 -s -B 10.0.0.4 &
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
|
@ -34,6 +41,6 @@ ip route add 10.0.0.4 dev tun0
|
||||||
"$tun2proxy" --proxy socks5://10.0.0.3:1080 &
|
"$tun2proxy" --proxy socks5://10.0.0.3:1080 &
|
||||||
|
|
||||||
# Run iperf client through tun2proxy
|
# Run iperf client through tun2proxy
|
||||||
iperf -c 10.0.0.4
|
iperf3 -c 10.0.0.4
|
||||||
|
|
||||||
iperf -c 10.0.0.4 -R
|
iperf3 -c 10.0.0.4 -R
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue