Ubuntu 20.04-22.04 shared internet access

1. Share the common connection, not the one on which there is an active internet.

For example:

ethernet is common

WiFi is the access to the Internet

Therefore, sharing to be enabled on the ethernet

NlwhjsL.png

2. Make sure no other DHCP server operating on common (ethernet) connection

3. By default, 10.42.x.x will be issued to the common (ethernet) network. If a specific subnet is needed, follow the steps outlined below:

sudo nmcli c

3QbFx.png

If sharing the internet on "Wired Connection 1".

Take down the interface:

sudo nmcli c down "Wired Connection 1"

Assign the ip4 IP to use, such as 192.186.1.1/24. (please note the /24 This is important or else dnsmasq will complain)

sudo nmcli c modify "Wired Connection 1" ipv4.address 192.168.1.1/24

Then bring up the interface:

sudo nmcli c up "Wired Connection 1"