I use the internet by connecting to the WiFi (NetworkManager). I have a LAN port on the computer. Now, can I use that port to share internet connection to another computer that has a LAN port? It’s also running EOS.
It can be done. Take a look at this article to get started: https://wiki.archlinux.org/title/Internet_sharing
NetworkManager provides a neat interface that masks all the details involving setting up NAT and routing. To set up a shared connection with NetworkManager, you need to have dnsmasq
installed. It is listed as one of NetworkManager’s optional dependencies, so you will have to install it manually.
sudo pacman -Syu dnsmasq
You may have to start/enable dnsmasq.service
after installation.
NetworkManager abstracts away the low-level details via an option called ipv4.method
in a connection profile. Usually, when you create a connection, ipv4.method
is set to auto
. However, if you wish to share a connection, you need to create a new connection profile with ipv4.method
set to shared
.
You can do this with GUI tools (such as nm-connection-editor
) for NetworkManager, but I’m just going to use the command line interface nmcli
in this example. Let’s assume that the wired connection on your computer (the one connected to the wifi) has the interface name eth0
(this is just a dummy name used for the sake of discussion; you need to check the actual interface name for your ethernet).
Before you start, make sure that the two machines are connected to each other via an ethernet cable. After you do that, run this command on the machine that is connected to the wifi (remember to replace eth0
with the actual interface name on the machine):
nmcli connection add type ethernet ifname eth0 ipv4.method shared con-name my-shared-con
After you create the profile, the connection should be activated automatically. To check the availability of the new connection, run this command:
nmcli device
You should see something like this:
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected my-shared-con
wlan0 wifi connected my-wifi
If you didn’t see the new profile in the list or if its state is something other than “connected”, run:
nmcli connection up my-shared-con
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.