How to share wired network connection in 18.04

21,085

Solution 1

The graphical program that shows the feature you need is

nm-connection-editor

You can launch it from a terminal window or with Alt+F2

Higlight an adapter and hit the cog

enter image description here

Solution 2

To anyone who comes here and is still lost on what to do, I found a tutorial that explains it here.

Basic rundown

First run nm-connection-editor in your terminal.

Next, you will see a screen that lists a bunch of different network devices.

picture of network connection list

Click on your wired connection and then click on the cog at the bottom of the window.

A window will open giving you a bunch of options to edit the connection. Go to the IPV4 settings tab and change the method to share to other computers. Finally hit save.

Picture of connection editor

You should be all set to go! It's important to note that you may have to unplug and replug your network cable or reset the connection in order for it to work.

Solution 3

Using nm-connection-editor set the usb-ethernet connections under IPv4 Settings to Shared to other computers. Leave the internet ethernet connection alone.

For context, I wanted to give a USB ethernet (eth1) gadget (Pi Zero) access to the internet by sharing the PCI ethernet (eth0) internet connection. However, the only way I could get it working was to set eth1 to Shared ..., the total opposite of what I expected the setup to be.

Share:
21,085

Related videos on Youtube

Chris Lundy
Author by

Chris Lundy

I like to use Linux and Ubuntu, but I am not an expert. I have just enough knowledge to be dangerous. I test things until they break.

Updated on September 18, 2022

Comments

  • Chris Lundy
    Chris Lundy over 1 year

    I had been sharing my network connection through my computer (previously windows 10) with two other computers using usb-ethernet adaptors, and I can't get it to work now that my host computer is running Ubuntu 18.04.

    The three wired connections appear in network settings as expected, but I don't know how to configure them to share internet and network.

    Tutorials on the internet show a different network settings UI, with IPv4 Settings tab Method: "Shared to other computers". I don't have the option "Shared to other computers" and "Link-Local Only" does not seem to work.

    How can I share one wired connection with two others?

    • tallowhawk
      tallowhawk over 5 years
      To anyone who comes here and is still lost there's a good tutorial here that explains the process.
  • Chris Lundy
    Chris Lundy almost 6 years
    Thank you! That was what I needed, now it works perfectly.
  • nazikus
    nazikus over 4 years
    how do you do this from terminal, without gui ?
  • Admin
    Admin almost 2 years
    If you see Unable to init server: Could not connect: Connection refused check if you're in something like tmux and missing $DISPLAY.