File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ #!/bin/bash
2
+
3
+ # iperf test.sh
4
+ # published as part of https://github.com/pConst/basic_verilog
5
+ # Konstantin Pavlov,
[email protected]
6
+
7
+ # allows to test network performance on single local machine with two ports
8
+
9
+
10
+
11
+ # create namespaces to force linux to pass data through the cable
12
+ sudo ip netns add ns_server
13
+ sudo ip netns add ns_client
14
+ sudo ip link set enp1s0f0 netns ns_server
15
+ sudo ip netns exec ns_server ip addr add dev enp1s0f0 192.168.2.1/24
16
+ sudo ip netns exec ns_server ip link set dev enp1s0f0 up
17
+ sudo ip link set enp1s0f1 netns ns_client
18
+ sudo ip netns exec ns_client ip addr add dev enp1s0f1 192.168.2.2/24
19
+ sudo ip netns exec ns_client ip link set dev enp1s0f1 up
20
+
21
+ # start server (first terminal window)
22
+ sudo ip netns exec ns_server iperf -s 192.168.2.1
23
+
24
+ # start client (second termonal window)
25
+ sudo ip netns exec ns_client iperf -c 192.168.2.1 -d -i1 -t60
26
+
27
+ # remove namespaces
28
+ sudo ip netns del ns_server
29
+ sudo ip netns del ns_client
30
+
You can’t perform that action at this time.
0 commit comments