diff options
author | Joe Crayne <joe@jerkface.net> | 2020-01-24 00:12:57 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-01-24 03:01:27 -0500 |
commit | 140381ff489213ce890e660ae37a18ae7587c4fb (patch) | |
tree | 3dd7649091e324935051e1d3cd3ff242f1997395 /dht/vnet/tcp-clean.sh | |
parent | ebacfa8f8cbd8b5cc3a1995188cc2cc8c260d76e (diff) |
vnet tests: tcp cage scripts.
Diffstat (limited to 'dht/vnet/tcp-clean.sh')
-rwxr-xr-x | dht/vnet/tcp-clean.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dht/vnet/tcp-clean.sh b/dht/vnet/tcp-clean.sh new file mode 100755 index 00000000..7ee0bcbd --- /dev/null +++ b/dht/vnet/tcp-clean.sh | |||
@@ -0,0 +1,13 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | digit=${1:-0} | ||
4 | |||
5 | set -x | ||
6 | |||
7 | iptables -D FORWARD -i tcp$digit -o $iface -j DROP | ||
8 | nsenter --net=/var/run/netns/tcpp$digit iptables -D INPUT -j DROP | ||
9 | nsenter --net=/var/run/netns/tcpp$digit iptables -D INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | ||
10 | nsenter --net=/var/run/netns/tcpp$digit iptables -D OUTPUT -p udp -j DROP | ||
11 | |||
12 | ip link del tcp$digit | ||
13 | ip netns del tcpp$digit | ||