What is the best solution for a temporary direct ethernet cable connection between Linux home server and Windows laptop.

Let's assume the that the Linux home server is headless, and is normally connected by ethernet cable to a router, from which it gets IP via dhcp.

Now, I need temporarily to unplug that ethernet cable and plug it into my Windows PC laptop. Let's say I need to measure ethernet speed with iperf between those two machines to prove that my LAN rooter is the bottleneck, the reason I am not getting those 1Gbps speeds both cards are capable of.

Option one: manual IP configuration. The most laborious; risky in breaking something in otherwise perfectly working system; and tricky with headless server.

Option two: set link-local on Linux server and rely on APIP (Automatic Private IP) on Windows side. APIP is automatically invoked on Windows. On Linux side it not automatic, sadly, but setting link-local is an easy-peasy change in Network Manager GUI (Wired Ethernet -> IPv4 tab -> Method: Link-Local). But with headless server, again, it's tricky.

Option three: APIP on Windows side and trying something similar on Linux - avahi-autoipd. I have never tried that, it's not on by default on my openSUSE. This can work well; when ethernet is plugged to router server would get IP from dhcp, if plugged to laptop, APIP/avahi-autoipd would kick in, and back again. All automatic, perfect solution for a headless server. Or am I too optimistic? Slight extra problem here, how to get IP of the headless server assuming auto-ip addresses are assigned randomly; I posted a separate question for his.

Would the third solution work as I imagined? Did I miss something?
Is there a better solution?

  • You have two option ones... – Ryan Prechel Jul 12 '19 at 5:35
  • Typo fixed, thanks! – Espinosa Aug 14 '19 at 0:30

For this test i would use manual IP config, or on your windows laptop a small dhcp server.

Sometimes you need a crossed networkcable.

| improve this answer | |
  • Manual config is tedious, and with headless server twice as much with headless setup. It is possible but it involves lost of changes and then reverting them. So easy to make a mistake and make the server inaccessible. Manual IP configs has it's place still - in relatively fixed network setups of data centers. Not in home networking, that's not worth of 2019. – Espinosa Jul 12 '19 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.