Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iperf between 2 interfaces on same host

I am looking for a way how I can run iperf benchmark between 2 interfaces on the same host as shown on the schema:

Setup Schema

Both of the machines (pc and router) are linux.
I'm need a way to run some functional tests on my "router" machine using my only 1 PC with 2 ethernet ports.


I tried already few different ways to solve it but still no luck:
1) Adding static routes for destination hosts with metric
2) Binding iperf to specific ip address
3) Disabling local loopback interface

Basicly what I'm looking for is to run traffic 192.168.1.10<-->1.1.1.10 thru the router device (with ip forwarding enabled).

like image 405
user2988257 Avatar asked Nov 02 '25 19:11

user2988257


1 Answers

Don't forget to bind the server as well:

For the server run iperf -s -B 1.1.10 in terminal and on another terminal instance for the client run iperf -c 1.1.10 -B 192.168.1.10 This will normally work if your OS doesn't use the loop-back interface by default.

like image 155
Mostafa Pakparvar Avatar answered Nov 05 '25 09:11

Mostafa Pakparvar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!