0

There is currently only WiFi at my place, but I have a PC (running Ubuntu 16.04) with no card for WiFi built in. I also have a laptop (Ubuntu 16.04 + Windows 7) that has WiFi and a LAN cable. What I want is to get internet on my PC from the laptop's WiFi via the LAN cable. I found instructions for Ubuntu 14.04 here (from the most upvoted answer), followed the steps but it didn't; hope that someone can help. Steps that I did so far:

1) Connected laptop and PC via cable.

2) On the laptop, typed nm-connection-editor in the terminal, chose 'Wired Connection', clicked on 'Edit' and then selected 'Shared to other computers' as 'Method' under the IPv4 Settings. Typing hostname -I in the laptop's terminal gave 10.42.0.1 192.168.1.97. (I assumed that the first one is the my IP address as viewed from the outside and the second one is the internal for the network with my PC.)

3) Typing hostname -I in a terminal on the PC gives only 192.168.1.1. I followed the instructions from the first answer in the link also on the PC, i.e., went to 'Wired Connections', selected 'IPv4 Settings', chose 'Manual' under 'Method', then entered 192.168.1.1 under 'Address', 255.255.255.0 under 'Netmask' and 192.168.1.97 under 'Gateway'. In the field for 'DNS servers' I also put 192.168.1.97.

However, after saving the settings there is still no internet on my PC. Can anyone help? What am I doing wrong?

Update #1:

dpkg -l *dnsmasq* (laptop and PC) gives: 
un dnsmasq <none> <none> (no description available) 
ii dnsmasq-base 2.75-1ubuntu0.1.04 amd64 Small caching DNS proxy and DHCP/TFTP server

Update #2:

Now it works! I don't know why but when I started the PC today and connected it to the laptop, it had internet. I haven't changed anything in the settings. Perhaps the system just needed to be restarted. Thanks a lot!

1 Answers1

0

In the terminal...

dpkg -l *dnsmasq* # looking for dnsmasq-base

un dnsmasq <none> <none> (no description available) 
ii dnsmasq-base 2.75-1ubuntu0.1.04 amd64 Small caching DNS proxy and DHCP/TFTP server

Look for dnsmasq-base as the only installed dnsmasq anything. It should be status "ii". If you don't see it, then:

sudo apt update # update the software database

sudo apt install dnsmasq-base # install dnsmasq-base


Set up the laptop as you have before...

On the laptop, typed nm-connection-editor in the terminal, chose 
'Wired Connection', clicked on 'Edit' and then selected 'Shared 
to other computers' as 'Method' under the IPv4 Settings.

Set up the PC with an ethernet connection set to DHCP (not manual).

Connect the ethernet cable and it should work.


If for some reason DHCP doesn't work, try a manual connection profile, with:

address = 10.42.0.2/24

gateway = 10.42.0.1

Retry connection.

heynnema
  • 73,649