Sunday, March 26, 2023

How to network two linux computers together with an ethernet cable

This is known to work on Manjaro and Ubuntu/mint at the time of the writing of this. But I am not sure with DIY distros or any other ones.

First verify what the name of your ethernet NIC device is with nmcli in the terminal:

nmcli -p device show

Scroll down until you find the entry that says ethernet under GENERAL.TYPE. If you dont have more than one ethernet adapter this should be the one. the name of your device is under GENERAL.DEVICE
So on the first computer we enter:

sudo ip address add 192.168.68.1/24 dev devicename
where device name is the name of the device you found using the nmcli command.
Follow the same steps for the computer at the other end except the last digit of the ip is one more increment. So on the second computer we'd type:

sudo ip address add 192.168.68.2/24 dev devicename

If everything worked okay you'll get a message on the screen saying the connection has been established. Though you might want to ping the other computer to double check.

ping 192.168.68.2

If nothing happens or you get a no route to host something may have gone wrong.

No comments:

Post a Comment

A list of some software I installed on Arch Linux

This is a list of packages I installed on Arch Linux. When you install Arch Linux you get to choose whatever you want to install, though som...