Page 1 of 1

Internet problem if connected with Ethernet to PC

Posted: Tue Feb 21, 2017 12:22 pm
by MJ5
Good morning,
I have an Internet problem when I connect my Raspberry Pi 3 with Ethernet cable to my laptop in order not to work with a screen.

I have the Raspberry Pi 3 connected by Ethernet cable via SSH connection to my laptop. I have to do this instead of using WiFi or any other way because I am with my Thesis at the University and the connection at the University is so complex we cannot use any other way. The problem comes when we need to use Internet in the RPi in order to download any libraries or whatever, because we canĀ“t use Internet. How could I get Internet to the RPi?
Could anyone help me with this?

We changed the config with:

Code: Select all

sudo nano /etc/dhcpcd.conf
Including:

Code: Select all

Interface eth0
static ip_address=192.168.137.2
static routers=192.168.137.1
static domain_name_servers=192.168.137.1
We also configured the interfaces with:

Code: Select all

sudo nano /etc/network/interfaces

iface eth0 inet static
address 192.168.137.2
netmask 255.255.255.0
gateway 192.168.137.1

Thank you.

Re: Internet problem if connected with Ethernet to PC

Posted: Tue Feb 21, 2017 12:42 pm
by Ernst
You do not say which operating system has been installed on your laptop, this could be important, in the meanwhile I will assume that you are using some Windows version,

I suggest that remove everything you did as it is wrong to do so, instead you must configure "Internet Connection Sharing" on your laptop. (http://www.dummies.com/computers/operat ... windows-7/)
Do not configure static addresses, ICS will install a "mini-dhcp" server to take care of this.

There is one small inconvenience, you may have to install bonjour or use a bonjour browser (https://hobbyistsoftware.com/bonjourbrowser), to find the IP address of your raspberry. The ethernet port on your laptop will be configured by ICS with the IP-address 192.168.137.1, on your PI another address in the same range will be offered, with DNS and router pointing to 192.168.137.1 which will be forwarded to the internet via your WiFi connection.