Connecting two computers directly

I’m having a bit of trouble googling someone I want to research before I jump into it. Let’s say that there are two computers running some flavor of linux, both connected to a switch via standard 1G ethernet, allowing them to receive internet and other connections via the local network.

Then let’s say both computers also are connected directly to each other with faster 10G add in NICs, in order to shuffle data faster only between these two computers. These would be both on the same subnet, unless that is a bad ideas somehow.

In linux, does this just automagically work, or is there special configuration involved? If so what key phrases/terms should I look up for this, and does anyone have a handy tutorial?

Does These would be both on the same subnet mean you want to assign addresses to the 10G on the same subnet as the 1G network? Or does it mean the two 10G nics will be on the same subnet, but that subnet is different from the 1G network?

You can do both. But putting the 10G nics on a subnet different from the 1G network requires much less configuration and will be pretty close to “automagic”.

The trick will be getting the routing table setup, but it’s not difficult. By way of example: on computer A you could assign it the address 10.0.0.1 with the command ip address add 10.0.0.1/30 dev eth1 and on computer B you assign it the address 10.0.0.2/30 dev eth1 with the similar command ip address add 10.0.0.2/30 dev eth1 and that should setup the routing table on both computers so that there is the route 10.0.0.0/30 dev eth1. But if it doesn’t you can manually add the route with the command ip route add 10.0.0.0/30 dev eth1

And that should be all there is to a barebones setup.

2 Likes

Put the direct connect on a different private network and then when access the other use that address. Thats pretty much all you need to do.

1 Like

If you haven’t bought the 10 GbE NICs yet, you may want to look into 100 GbE Infiniband PCIe cards which are cheap on eBay. You can connect PCs directly with Ethernet over InfiniBand so it works transparently with all applications.

Yeah but if he gets 10gbe switches later would those 100 GbE Infiniband work with that?

No, you’d need an InfiniBand switch. The cards are easy enough to sell on eBay.

Yeah so good reason to go 10gb imo, lets you have access to more devices later without direct connections. Might be worth it tho not sure what OPs work load is like or what the future looks like

Already have the hardware, this is so I can skip getting another switch for what will be a temporary (few months) layout. Otherwise I would be looking at things like 40g and the like since that’s barely above 10g these days.

Thanks for that in-depth reply. That really helps clarify what to look into, especially for someone who only has a vague understanding of real network configuration.