[SOLVED] Shared connection two ethernet cards

Issues related to configuring your network
Post Reply
Posts: 14
Joined: 2008/10/21 14:14:30

[SOLVED] Shared connection two ethernet cards

Post by warpino » 2023/03/15 12:54:32

Hi all,

I have a workstation with two ethernet cards, and I want to share the Internet connection (provided by one card) with a laptop connected to the other.
I managed to do it flawlessly on a previous Ubuntu 22.04 install through a Network Manager GUI. Alas, I am not able to do the same no my fresh Centos 7 install.
The internet connect card (eno1) works with no problems. On the other, which the laptop connects to, I choose "Shared to other computers" in the IPv4 Settings tab of Network Manager GUI. Apparently NM is doing something (two green dots and a spinning blue tail in the notification panel, ifconfig shows an IP for the card), but then the connection fails (no ip showing anymore). Clearly the laptop is not connected either (shows a self-assigned ip in the wrong subnet).
Can you suggest me how to solve this?

Additional info: I have uninstalled firewalld and installed ufw and dhcp
Last edited by warpino on 2023/03/15 13:12:19, edited 1 time in total.

Posts: 14
Joined: 2008/10/21 14:14:30

Re: Shared connection two ethernet cards

Post by warpino » 2023/03/15 13:12:05

Wow, I found the solution myself looking at

Code: Select all

jounralctl -xe

Code: Select all

unable to find dnsmasque binary
That's crazy! :-)

User avatar
Posts: 4551
Joined: 2007/12/11 08:17:33
Location: Finland

Re: [SOLVED] Shared connection two ethernet cards

Post by jlehtone » 2023/03/15 13:35:06

That is true, the package dnsmasq is not included in all typical setups.

It is installed as dependency when libvirt (virtualization) is installed, because libvirt's virtual subnets do use dnsmasq as the DHCP and DNS server.

You used term "shared connection". I'd say the workstation is now a router, because it routes traffic between external (eno1) "WAN" and your new, private "LAN", which has only workstation and laptop.

Like any "home router", it now runs DHCP server (dnsmasq) for the LAN, so other LAN members (the laptop) do conveniently get proper network config.

A "plain" workstation does not need to run DHCP server, so that is probably why the package is not in default installation.
(Even the plain workstation could use the dnsmasq as caching DNS resolver, as it might be more efficient than the default resolver in glibc.)

Post Reply