8 ms·
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 o
by yonatan8070 16d ago
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.
- bitpush 16d agoBut that requires both the machines to be on a network right? I believe what OP is demonstrating two (isolated) machines talking to each other.
- yonatan8070 16d agoIt works just as well if they're on a direct link as demonstrated in the OP, as long as there's working IP connectivity. This isn't to say the way it's done in the OP is wrong, socat is also great, and you can also compress them on the fly by piping through zstd as others mentioned in this thread.
- bitpush 16d agoApologies if this is obvious but I'm not following it. > as long as there's working IP connectivity. Dont you need to be on a network to get 'IPs'. It is usually a router's job to setup the network, and also provision IPs. Two devices, not connected to a LAN has nothing. No IP, except 127.0.0.1 and localhost. So then, how do you talk to another device. There isnt an address. OP's article is essentially setting up a P2P connection when there's no third party (router)
- zamadatix 16d agoTwo devices connected to each other are just another form of LAN - one with 2 nodes instead of many. You can manually configure IPs without a router exactly as this article demonstrates: # On sender... ip address add dev eth0 fd42:dead:beef::1/48 ip link set dev eth0 up # On receiver... ip address add dev eth0 fd42:dead:beef::2/48 ip link set dev eth0 up The first 2 lines are run on one host and the second two lines on the second host. The 1st line of each segment sets the IPv6 address to use and the second line of each segment makes the adapter enabled. Plug an ethernet cable in and they can reach each other. As to why, just think of it as "the same way the computer would figure out how to send a packet to the gateway, just to another client in the network segment instead" You only need a router set up to go to a different subnet. If both hosts are in the same subnet then it's just a neighbor resolution (well, you can do neighbor discovery manually too if you really want... but, since it's automatic, no reason too) followed by ethernet bridging. Two hosts with nothing else just plugged into each other should actually already have assigned themselves IPs you could use for this though. They are known as IPv6's link local addresses and are explicitly meant for communication on the local subnet. Ethernet & IP are fun abstractions to really get into the weeds about. When it comes to running networks it's actually a bit of a fight to try to make sure only the addresses the router allows can be used! A whole bevy of technologies address that for the different protocols.
- Hikikomori 15d agoOn windows you get 169.254 addresses if you don't get a dhcp response. And with ipv6 you get link local address by default and you can use that to communicate with another link local.