127

I want to share the wireless Internet connection on my desktop with my old laptop, through ethernet.

I have ticked the option "Make available to others" on both connections, on my desktop, but my laptop doesn't connect. Am I doing something wrong or is it a bug?

Eric Carvalho
  • 54,385

2 Answers2

136

On the server computer:

  1. On the computer, which is connected to the Internet, click the network icon in the panel and go to "Edit Connections..." at the bottom of the menu.

    Edit Connection...

  2. Double click your Wired Connection (Leave your wireless connection untouched, the one connected to Internet and the one you want to share, as I understand).

    Network Connections Dialog

  3. On the "IPv4 Settings tab", select Method: "Shared to other computers"

    Editing Wired Connection

  4. Reconnect by clicking on the Wired Network, so it gets a new IP address. (The two computers must be connected by an ethernet cable for this step, so connect them now if you haven't already.)

  5. Click on "Connection Information" in the network menu and write down the IP address and network mask (in my case it was assigned 10.42.0.1/255.255.255.0 but I do not know if that will always be the case).

    Connection Information

On the client computer:

  1. Go to "Edit Connections..." and assign a "Manual" Method. Assign an IP address on the same subnetwork (10.42.0.69 for example) and put the IP and network mask you wrote down in "Netmask" "Gateway" and "DNS servers"

    Editing Client Wired

  2. Reconnect to the network to let the new settings be assigned.

  3. Pat yourself on your back and surf away!!!

SuperMau
  • 1,653
  • 16
    The first 4 steps were enough in my case (Ubuntu 14.04). What is wrong with the automatic assignment (DHCP)? Why are you manually reassigning it? – toto_tico Dec 06 '14 at 22:54
  • If i try to put wired and wifi network in same network, and configure wired network with manual it will it work ? – Ankur Loriya Jan 10 '15 at 17:39
  • How to do the same, but using DHCP on the client? – dolmen Apr 16 '15 at 12:43
  • 1
    This should be marked as the correct answer! :) – jackyalcine Sep 20 '15 at 18:36
  • 2
    I've done this dozens of times. Just use auto instead of manually assigning it on the non-server computer and don't forget to leave ports 67, 68, 52 and 53 open for dhcp and dns access. Also, don't forget that ufw blocks incoming, so you will have to either disable it on the server computer or set the rules accordingly. – mchid Sep 23 '15 at 00:10
  • I connected a WiFi router to my Ethernet port so it is doing the DHCP. Steps 1-4 was all I needed. Why this way? Because the paid WiFi connection wasn't letting me have more than one user at a time. Now my wife and I have 4 computers on the same WiFi account. Thanks. – Bob Brunius Dec 23 '15 at 02:32
  • I tried this with sharing from my laptop to a raspberry pi and it was unsuccessful. – wordsforthewise Jul 04 '16 at 10:41
  • Relevant: http://askubuntu.com/questions/64494/wired-connection-shared-with-other-computers-connects-then-disconnects-in-the-nm – OlivierBlanvillain Aug 30 '16 at 16:43
  • This was perfect for my cluster configuration. I need the compute nodes to each have a fixed IP and share the internet from the head node. – Steven C. Howell Aug 30 '16 at 20:46
  • 10
    This solution worked fine for me. The only think I would like to add is: If the method "Shared to other computers" is not listed on the configuration menu from IPV4 tab (this was my case running Ubuntu 17.10 with default Gnome interface) you can start the network settings from the command line with nm-connection-editor. As seen here. – leomilrib Jan 19 '18 at 18:08
  • 2
    Wow it took me forever to configure the according netplan on my client because I forgot to set the gateway to the hosts IP-address... So if anybody can use ssh but fails to share the internet connection: Remember your gateway to be your hosts IP! – Markus Dec 12 '19 at 22:25
  • This worked for me also from Ubuntu server to Windows client. I did not have to do anything on the client. – esperluette Mar 13 '20 at 10:12
  • 5
    This answer is still useful! But it would be so much more useful if it were updated to reflect the current GUI - or even better, using the CLI tools to do the configuration. – Seamus Jul 22 '20 at 08:57
  • In Cockpit you can manage this settings in Networking page https://prnt.sc/26efq9n – dobs Jan 16 '22 at 19:53
0

With network-manager in KDE in 2022 I don't need to do anything too complicated: just create a new shared connection (default configuration works fine):

  1. open the configurations:

enter image description here

2.add a new connection

enter image description here

  1. select "Wired ethernet (shared)" (or similar), give it a name like partageinternet, and save (no need to configure it):

enter image description here

  1. Then, plug you ethernet cable to your other computer (tested with a rasperry). A new entry should appear in the Network Manager menu to start to share the previously created connection. Actually if the entry is not visible (in my case it did not appeared the first time, not sure why), you can force NM to start it:
$ nmcli connection show
…
partageinternet …
…
$ nmcli connection up partageinternet

That's all! The other computer should automatically connect.

tobiasBora
  • 2,448