Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to bind to interface when multiple interfaces are present #1572

Closed
bOsowski opened this issue Sep 5, 2023 · 2 comments
Closed

Failing to bind to interface when multiple interfaces are present #1572

bOsowski opened this issue Sep 5, 2023 · 2 comments

Comments

@bOsowski
Copy link

bOsowski commented Sep 5, 2023

Context

  • Version of iperf3:

Both client and server are using the following docker image: https://hub.docker.com/r/networkstatic/iperf3

iperf 3.9 (cJSON 1.7.13)
Linux 893c486a2ac3 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64
Optional features available: CPU affinity setting, IPv6 flow label, SCTP, TCP congestion algorithm setting, sendfile / zerocopy, socket pacing, authentication

  • Hardware:
    Client has two interfaces connected - an eth0 cabled connection and usb0 (LTE modem)

Server is a standard AWS EC2 instance with one network connection

  • Operating system (and distribution, if any):
    As per the docker image above.

Also tried to install iperf3 on the underlying OS (same results):

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
  • Other relevant information (for example, non-default compilers,
    libraries, cross-compiling, etc.):

Internet connectivity via the usb0 interface works:

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1430
        inet 192.168.225.28  netmask 255.255.255.0  broadcast 192.168.225.255
        inet6 fe80::416f:fe8:6320:c48a  prefixlen 64  scopeid 0x20<link>
        ether 72:9a:72:49:24:fd  txqueuelen 1000  (Ethernet)
        RX packets 672  bytes 91071 (88.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 836  bytes 143284 (139.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
ping -I usb0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 192.168.225.28 usb0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=59 time=137 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=59 time=106 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=59 time=116 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 106.325/119.694/136.660/12.642 ms
$ curl --interface usb0 google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>

Bug Report

  • Expected Behavior
    Speedtest results when running
    iperf3 -c serveraddress.com --bind 192.168.225.28

  • Actual Behavior
    iperf3: error - unable to send control message: Bad file descriptor

  • Steps to Reproduce
    Run iperf3 client from a linux machine that has multiple network interfaces with internet connectivity and try to bind to them.

From my testing, it seems that iperf3 runs fine if bound to the interface that has the very first default route, but it doesn't for other interfaces. This is surprising since other tools such as ping, or curl work fine for both interfaces, as shown above.

  • Possible Solution
@bmah888
Copy link
Contributor

bmah888 commented Oct 30, 2023

This might be a problem that's already been solved. If you can update to iperf-3.10 or newer (3.15 is current), there's a --bind-dev option that might be needed for your use case. Something like --bind 192.168.225.28 --bind-dev usb0. That should work for your bare-metal installation. I'm not sure what would happen in the container deployment, iperf3 was never intended to work inside containers.

@bOsowski
Copy link
Author

bOsowski commented Sep 3, 2024

Thank you, specifying the additional --bind-dev parameter did work as expected!

@bOsowski bOsowski closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants