Fumboralma
Posts: 6
Joined: Thu Jun 15, 2017 12:06 pm

Ethernet connection through laptop

Thu Jun 15, 2017 12:34 pm

Hello, I've encountered a problem when trying to access internet through a laptop's wifi-connection. I'm new to Raspberry Pi and have limited experience with raspbian

Hardware:
Raspberry Pi 2B
Ethernet Cable tried two different sorts
Laptop with windows 10
SD card(16GB) preinstalled with NOOBS
Peripherals(keyboard,mouse,display(through HDMI)), all working

I've previously been able to run apt-get update through the ethernet connection. But today it can't find the appropriate mirrors.
ping www.google.com yields
ping: unknown host www.google.com
which would infer that the Pi can't access the internet if I interpreted it correctly

The wifi is shared via the windows network and sharing interface.
in the same interface the ethernet has "no network access"

Concerning the hardware both lights(green and orangey) on the ethernet port on the Pi are lit. The ifconfig lists that no rx or tx packages are dropped or error:ed.

I have tested turning the Pi, laptop and sharing off in different configurations but with no result.
I am now unsure as how to proceed and would gladly accept help.
If I've omitted something of importance please tell me and I'll try to ammend the post.

Kind regards

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Ethernet connection through laptop

Thu Jun 15, 2017 1:57 pm

Does the laptop ethernet interface have a dhcp server? If not, have you set static network settings on the RPi?
Check the RPi network settings with ifconfig.

Fumboralma
Posts: 6
Joined: Thu Jun 15, 2017 12:06 pm

Re: Ethernet connection through laptop

Fri Jun 16, 2017 10:11 pm

Hello and thank you for your reply. I do not have an automatically assigned ip address set for the ethernet but rather a static. I used this since I wanted to be able to use the Pi in a headless mode. e.g. to use it without a HDMI and instead use a laptop through an ethernet connection. I've made some progress but I seem to be missing some part. The Pi can now be accessed from a vnc at it's static address but the pi can not access the internet.
The etc/dhcpd.conf has been altered in the following fashion as per https://www.modmypi.com/blog/how-to-giv ... ess-update:

[instructions...]
interface etho0
static ip_address=A/24
static routers=B
static domain_name_servers=B

And in the laptop the ethernet interface is
Use the following ip address:
ip address:B
subnet mask: 255.255.255.0
Use the following DNS server:
Preferred:B
Alternate: [nothing entered]

Are there any fields which should be switched or otherwise altered?

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Ethernet connection through laptop

Fri Jun 16, 2017 10:42 pm

I don't know, but probably A or B.

Can you ping B from the RPi?
Can you ping the IP of the laptop's wifi interface?
Can you ping the IP of the wireless router?
Can you ping 8.8.8.8?

Fumboralma
Posts: 6
Joined: Thu Jun 15, 2017 12:06 pm

Re: Ethernet connection through laptop

Sun Jun 18, 2017 9:33 am

I can't successfully ping any of these ip:s. (100% packet loss). The vnc is still successfully working though.

Ernst
Posts: 1335
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Ethernet connection through laptop

Sun Jun 18, 2017 10:22 am

Fumboralma wrote:Hello and thank you for your reply. I do not have an automatically assigned ip address set for the ethernet but rather a static. I used this since I wanted to be able to use the Pi in a headless mode. e.g. to use it without a HDMI and instead use a laptop through an ethernet connection. I've made some progress but I seem to be missing some part. The Pi can now be accessed from a vnc at it's static address but the pi can not access the internet.
The etc/dhcpd.conf has been altered in the following fashion as per https://www.modmypi.com/blog/how-to-giv ... ess-update:

[instructions...]
interface etho0
static ip_address=A/24
static routers=B
static domain_name_servers=B

And in the laptop the ethernet interface is
Use the following ip address:
ip address:B
subnet mask: 255.255.255.0
Use the following DNS server:
Preferred:B
Alternate: [nothing entered]

Are there any fields which should be switched or otherwise altered?
If you are using ICS then you must change everything back to use dhcp, you do not need static addresses with ICS!
If you are not using ICS then I need a picture of your network with all IP-addresses because A and B are not valid.
The road to insanity is paved with static ip addresses

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Ethernet connection through laptop

Sun Jun 18, 2017 10:23 am


SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Ethernet connection through laptop

Sun Jun 18, 2017 12:20 pm

Until you can ping the laptop's ethernet IP from the RPi, the rest will fail.

edit Post the network settings on the laptop and RPi ethernet interface. IP/subnet/gateway
Don't obfuscate them! No A and B. Post the private network settings. If you don't, I can't help you.

It may help if you also post the network settings on the laptop wireless interface. Maybe a conflict there?

Fumboralma
Posts: 6
Joined: Thu Jun 15, 2017 12:06 pm

Re: Ethernet connection through laptop

Tue Jun 20, 2017 12:24 pm

@Ernst
I am using ICS but if I use non-static addresses it will be impossible, in the current layout, to use VNC since VNC asks for an ip-address(which if I use dynamic will be unknown)
@Kll
I have done some things similar to the post but some things are not e.g. the ssh, and i am thus unsure how to use the information in the post since it requires a different setup.
@surferTim
Here are the configurations for the ethernet interface from RPi to the laptop without the algebra.

[instructions...]
interface etho0
static ip_address=192.168.137.2/24
static routers=192.168.137.1
static domain_name_servers=192.168.137.1

And in the laptop the ethernet interface is (version 4)
Use the following ip address:
ip address:192.168.137.1
subnet mask: 255.255.255.0
Use the following DNS server:
Preferred:192.168.137.1
Alternate: [nothing entered]

The Wifi is dynamically allocated, I don't think it will help to post them but if you want to I can do it?

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Ethernet connection through laptop

Tue Jun 20, 2017 12:29 pm

What do you mean "without the algebra"? I'm good up to trigonometry.
Can you ping 192.168.137.1 from the RPi?

edit: There is no sense going any further until you can ping the localnet gateway. Is there any entry in the laptop's firewall that may be stopping the ping?

Post the wifi network settings from the laptop.

Ernst
Posts: 1335
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Ethernet connection through laptop

Tue Jun 20, 2017 12:40 pm

Fumboralma wrote:@Ernst
I am using ICS but if I use non-static addresses it will be impossible, in the current layout, to use VNC since VNC asks for an ip-address(which if I use dynamic will be unknown)
@Kll
I have done some things similar to the post but some things are not e.g. the ssh, and i am thus unsure how to use the information in the post since it requires a different setup.
@surferTim
Here are the configurations for the ethernet interface from RPi to the laptop without the algebra.

[instructions...]
interface etho0
static ip_address=192.168.137.2/24
static routers=192.168.137.1
static domain_name_servers=192.168.137.1

And in the laptop the ethernet interface is (version 4)
Use the following ip address:
ip address:192.168.137.1
subnet mask: 255.255.255.0
Use the following DNS server:
Preferred:192.168.137.1
Alternate: [nothing entered]

The Wifi is dynamically allocated, I don't think it will help to post them but if you want to I can do it?
It is much simpler to find a dynamically assigned IP-address compared to fix/find a wrong static address assignment.
ICS does not need static addresses on Pi and on the laptop interface, ICS will assign addresses and provide proxy for DNS.
With avahi/bonjour you can find the address of the Pi, usually this will be 192.168.137.2.
I suggest you remove all static entries and try again.

If the OS on your PC does not support bonjour then you can use: https://hobbyistsoftware.com/bonjourbrowser
The road to insanity is paved with static ip addresses

Fumboralma
Posts: 6
Joined: Thu Jun 15, 2017 12:06 pm

Re: Ethernet connection through laptop

Wed Jun 21, 2017 9:22 am

@SurferTim
The algebra thing was substituting the numerals for symbols, e.g. 192... -> A
I don't think the Pi:s ping should be blocked by the firewall if it allows for vnc to run through the same connection?
IPV4 address: 192.168.0.7
Subnet mask: 255.255.255.0
Default gateway: 192.168.0.1

@Ernst
My reason for choosing the static setup was that it seemed easier. So if I would change the setup as per you suggestion I would do the following:
Clear static lines in the etc/dhcpd.conf (Pi)
Clear the static in the ethernet interface (Laptop)
Install a ssh-client (laptop)
Install avahi (pi)
install bonjour(laptop)
-download itunes
-extract the bonjour installer via unzipping program from the itunes files
-install bonjuour
Run the services, does avahi on the Pi need to autoconfigured to run at startup?

It seemed and to me it still seems a little more trouble than necessary but perhaps it's easier than using a static setup?

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Ethernet connection through laptop

Wed Jun 21, 2017 9:33 am

Your posts are conflicting. One post states the RPi IP is 192.168.137.2 and the other 192.168.0.7.

Ditch the algebra. Post the RPi IP, the laptop ethernet IP, and the laptop wifi IP.

Did you use Internet Connection Sharing, or did you bridge the connections?

Ernst
Posts: 1335
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Ethernet connection through laptop

Wed Jun 21, 2017 9:45 am

Fumboralma wrote:@SurferTim
The algebra thing was substituting the numerals for symbols, e.g. 192... -> A
I don't think the Pi:s ping should be blocked by the firewall if it allows for vnc to run through the same connection?
IPV4 address: 192.168.0.7
Subnet mask: 255.255.255.0
Default gateway: 192.168.0.1

@Ernst
My reason for choosing the static setup was that it seemed easier. So if I would change the setup as per you suggestion I would do the following:
Clear static lines in the etc/dhcpd.conf (Pi)
Clear the static in the ethernet interface (Laptop)
Install a ssh-client (laptop)
Install avahi (pi)
install bonjour(laptop)
-download itunes
-extract the bonjour installer via unzipping program from the itunes files
-install bonjuour
Run the services, does avahi on the Pi need to autoconfigured to run at startup?

It seemed and to me it still seems a little more trouble than necessary but perhaps it's easier than using a static setup?
too much work, you are doing an overkill.
1) Download bonjour browser and install it on your laptop.
2) Download Raspbian Lite and write to a SD card with Win32Imager (recommended to start with a clean slate), make sure that you create /boot/ssh.
3) Boot you Raspberry Pi and connect it to your laptop with the ethernet cable. This is a precautionary step to ensure that your cable is "live" for the next step.
5) Configure ICS on your laptop, create a binding from your ethernet interface to your WiFi interface
6) Reboot the Raspberry Pi (pulling the power cable at this moment will not cause problems if it has been switched on for several minutes)
7) Wait for the green led on the Pi to quiet down.
8) Start bonjour browser and do a scan, find the IP address of your Pi
9) Use Putty to connect to the IP address you found in 8. (very likely 192.168.137.2)
That is all. Bonjour browser is just a tool to find local IP addresses, you do not need iTunes or anything else.
The road to insanity is paved with static ip addresses

fruitoftheloom
Posts: 23549
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Ethernet connection through laptop

Wed Jun 21, 2017 10:14 am

Fumboralma wrote:Hello, I've encountered a problem when trying to access internet through a laptop's wifi-connection. I'm new to Raspberry Pi and have limited experience with raspbian

Hardware:
Raspberry Pi 2B
Ethernet Cable tried two different sorts
Laptop with windows 10
SD card(16GB) preinstalled with NOOBS
Peripherals(keyboard,mouse,display(through HDMI)), all working

I've previously been able to run apt-get update through the ethernet connection. But today it can't find the appropriate mirrors.
ping http://www.google.com yields
ping: unknown host http://www.google.com
which would infer that the Pi can't access the internet if I interpreted it correctly

The wifi is shared via the windows network and sharing interface.
in the same interface the ethernet has "no network access"

Concerning the hardware both lights(green and orangey) on the ethernet port on the Pi are lit. The ifconfig lists that no rx or tx packages are dropped or error:ed.

I have tested turning the Pi, laptop and sharing off in different configurations but with no result.
I am now unsure as how to proceed and would gladly accept help.
If I've omitted something of importance please tell me and I'll try to ammend the post.

Kind regards
https://pihw.wordpress.com/guides/direc ... onnection/
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot) RaspiOS64 ARM64
Asus ChromeBox 3 Celeron is my other computer...

Fumboralma
Posts: 6
Joined: Thu Jun 15, 2017 12:06 pm

Re: Ethernet connection through laptop

Wed Jun 21, 2017 2:55 pm

@SurferTim, the last post was the current state of the dynamic wifi (copied from the result in ip-config) i.e. not the ip of the RPi. Summarized below
Rpi ethernet -> laptop ethernet
interface etho0
static ip_address=192.168.137.2/24
static routers=192.168.137.1
static domain_name_servers=192.168.137.1

laptop ethernet -> Pri ethernet
ip address:192.168.137.1
subnet mask: 255.255.255.0
Use the following DNS server:
Preferred:192.168.137.1
Alternate: [nothing entered]
Laptop -> router(wifi)
IPV4 address: 192.168.0.7
Subnet mask: 255.255.255.0
Default gateway: 192.168.0.1

@Ernst
I don't have a SD-card reader so it might be hard to reformat the card. I'll try to use the dynamic settings and a scanner such as Bonjour if the static layout seems to be unresolvable.

@fruitoftheloom
Yes that is quite similiar to the method which Ernst described

Return to “Troubleshooting”