Need help?
<- Back

Comments (157)

  • rmunn
    That used to require a crossover cable; I've done precisely that (with a crossover cable) back before https://en.wikipedia.org/wiki/Medium-dependent_interface#Aut... became widespread. With a straight-through cable, you'd be connecting the Transmit (TX) pin of one adapter to the TX pin of the other one, and the Receive (RX) pin of one to the RX pin of the other — and neither device would "hear" the messages the other one was sending. A crossover cable flipped those wires, so each device's TX pin was connected to the RX pin on the other end, and both devices could "hear" each other.But with auto MDI-X, each device would notice "hey, I'm sending but not receiving anything," and would try flipping its Transmit and Receive functions around (transmitting on the RX pin and receiving on the TX pin). Since each device waited a random period before doing that, it was very unlikely (nigh-impossible) that they would both flip at the exact same moment. And if they did, the second interval would most likely not be identical either.I'm simplifying a bit in the explanation above, but that's the broad strokes. And that's how my carefully-labeled crossover cables started gathering dust. (And then I realized "hey wait, I can just use these as normal cables now", and pulled them back out of storage and mixed them with my normal patch cables).
  • yjftsjthsd-h
    I am 95% confident you don't actually need to assign IPs. Do this: # ping all link-local devices on an interface: ping ff02::1%eth0 And then do your socat/rsync/whatever to the only IP that responds.
  • brandolini10x
    I wonder how we managed to invent the Internet before this trick. Next week's front page will be "Amazing trick: connect two wheels with a platform and you can ride instead of walk"
  • yitchelle
    This remind myself the good old 8bit days of using a cross-over RS232 cable to send a file from one computer to another. even at 30bps, it was much more reliable than write my data to a cassette tape on one computer and then reading on the other.
  • yonatan8070
    My usual method for this is to spin up a small webserver using the built-in Python module: python -m http.server Then just wget the file I need from the other system.
  • SillyUsername
    You can also pipe it through zstd on the fly, for data that compresses well you'll often see 1.5 to 3× the raw throughput, so a gigabit link can effectively move 165–330MB/s.Receiver: socat -u TCP6-LISTEN:1234,reuseaddr STDOUT | zstd -d -c | tar -xpf - -C /destinationSender: tar -C /source -cf - directory | zstd -T0 -6 -c | socat -u STDIN 'TCP6:[fd42:dead:beef::2]:1234'-T0 uses all cores. Bump the level above -6 for more compression, drop it for more speed, but if your CPU can't keep up, high levels will actually slow it down. Already compressed data won't see much benefit.
  • 1vuio0pswjnm7
    "I think it's underappreciated for non-internet applications and doesn't even need a local network: point to point wiring is perfectly fine."In the 1990s I used crossover cable for years with Apple computers that I bought for music productionTo keep the disk drives "clean", I never connected these computers to the internetIf I needed to transfer files to or from Apple computers I connected them to a laptop with crossover cableI grew up using Apple computers that had no internet connection at home and school so this seemed perfectly naturalI used computers running Windows 3.11 that had no internet connection, only LANNeedless to say, "Big Tech" companies like Apple are not what they used to beThese companies don't really produce anything to be used "offline" anymore. Watching the default network traffic from "Big Tech" marketed computers and software is sadNot automatically trying to phone home is bad for the "business" of data collection, surveillance and ad servicesThere used to be a different attitude toward the internet; there was less trust. I can still find traces of this in the archives at textfiles.com
  • awruko
    I literally had to cross over the cable once. It was some sort of demo and the cross over cable was missing. The local computer stores didn’t have one and under the time pressure … I have used the pocket knife and convert the cable. It was before 2000 so the speed was limited to 10/100 Mbit - ifconfig did’t report errors and demo went smooth.
  • nkurz
    It would be nice if this article defined a "ethernet patch cable". I think he's just using "patch" as a slang term for a short cable and it actually works with any length of standard cable, but I'm not certain.Traditionally (pre-2000?), one had to use a special "crossover cable" to do direct connections like this, but apparently modern Gigabit ethernet adapters are able to detect this situation automatically?
  • 3r7j6qzi9jvnve
    tbstream looks fun, but hard to use for the casual user -- not sure if it'll get simpler but I don't think I'll remember messing in configfs just to transfer a file:https://git.kernel.org/pub/scm/linux/kernel/git/westeri/thun...
  • sgt
    Even easier on macOS.Something like this should work: ifconfig enX inet6 fd42:dead:beef::1 prefixlen 48 No ned to bring it up as it should already be up. enX should be your USB/thunderbolt ethernet adapter, e.g. en6.Then you can go ahead and transfer with socat to your other machine, even if it's a Linux machine. I tend to use nc but socat will definitely be faster.Why the deadbeef network one might wonder? It's private space so won't conflict with public addresses.That being said though, in 99% cases of big files I'll just airdrop the files!
  • pcblues
    Yup."Computer to computer should not be seen without a device in between (unless playing ROTT with your housemates)"35 years ago maybe :) I had serial and parallel socket, and routerless networking happening on my home systems :)Use cases? Emergencies and maybe dedicated backup.
  • Yannik_Sc
    The USB/Thunderbolt one is a nice catch and good to know if you want to move you data to a new PC. Dell XPS (with soldered SSD) to Framework move just took a few minutes by dd'ing through the created network interfaces (it's different from the tbstream). The limiting factor was the Dell's SSD actually.
  • lstodd
    I remember we played warcraft 2 over ~15m of cat3 cable stretched outside between two flats on 6th floor. Those were the times, lol.
  • superdisk
    I used to do this to play Minecraft with my cousin without a router.
  • riobard
    For the time spent finding the ethernet adapter, plugging the cable, configuring IP addresses, and testing with pings, any decent portable SSD drives should have finished copying tens of GB of data.
  • theodric
    "Plug two computers into each other with a network cable and staticly configure the IP addresses" should not be a novel or notable enough idea to trend on HN! This is boggling.
  • ButlerianJihad
    It seems a strange choice, for the demo and for the script, to manually configure addresses on both ends. If your TCP/IP stack is functioning properly, this will not be necessary. Once DHCP fails, you should get a pair of 169.254.0.0/16 (APIPA) addresses, and then Bob's your uncle.Configuring all this manually adds extra complexity when it seems that the goal is simply to connect up your cable and let 'er fly.
  • ltbarcly3
    Ok is there a version for usb-c? Because that would be 10x or more faster and I have a usb-c port and a usb-c cable at all times.
  • slipperybeluga
    [dead]
  • steve1977
    People discovering that network cables can be used to network things. And then calling it a "trick" (I'm surprised it's not a "hack" actually).