1

Context: all my devices at home are connected through WiFi, and everything works as expected. At times, though, I'd like to transfer files from one PC to another. WiFi proves really slow for that. I can link the source and destination PCs with an Ethernet cable. But how do I tell/force rsync to use the eth interface?

I'm aware that some network-aware programs respect the proxy settings via environment variables. Does something similar exist for network interfaces?

I heard that one can potentially utilize namespaces/containers to do this. I'd appreciate suitable a docker command.

4
  • In the first place, why use the same subnet when this is a point-to-point connection between two PCs? If you don't, everything will work automatically. Commented Apr 27, 2024 at 14:04
  • Because the PCs don't normally need to talk to each other that fast, other than when needing to transfer files. Commented Apr 27, 2024 at 14:17
  • Not sure what to make of your reply, sorry. Please describe, in full detail, your network situation when two PCs are connected directly using an Ethernet cable. Are they still connected to your Wi-Fi network? What are their Wi-Fi IP addresses? What are their IP addresses on the Ethernet link? What does the routing table contain? How are you invoking rsync when it doesn’t deliver the expected performance? Commented Apr 27, 2024 at 16:20
  • 2
    To elaborate on the comment by @DanielB, if your WiFi is using 192.168/blah for communications, why don't you use 172.16.0.0/24 for the direct connection between the two systems. You can then rsync from 172.16.0.1 to 172.16.0.2 without touching WiFi. Commented Apr 27, 2024 at 18:03

1 Answer 1

1

Rsync doesn't seem to have a parameter for specifying the interface directly, but you can specify the address of the interface indirectly using the parameter --address=x.x.x.x of the command-line.

The address parameter is defined as:

--address=ADDRESS       bind address for outgoing socket to daemon

See the Stack Overflow post How to bind rsync to a specific interface?

1
  • This option is only for running rsync as a daemon (for example, as rsyncd). I would suggest that most of the time most people running network transfers do not use rsync in that fashion but connect across ssh (eg rsync -a /path/to/source/ remoteHost:/path/to/target). Regardless of my opinion, however, it cannot be used by the rsync client to control the network routing to a server Commented May 4, 2024 at 15:11

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.