vishalkumar uppin
Posts: 10
Joined: Fri Feb 10, 2017 5:35 am

Raspberry pi is unable to reach Gateway

Fri Feb 10, 2017 7:42 am

Recently we brought raspberry pi 3b.Beginning we used to access the internet using an ethernet cable and it used to connect properly but now raspberry pi is not able to reache the gateway itself and it's taking its default IP address i.e 169.xxx.xxx.xx.
what would be the issue?we tried to reinstalling the operating system again the same issue .it worked for one day after that same problem.so please help me to solve the issue.

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

Re: Raspberry pi is unable to reach Gateway

Fri Feb 10, 2017 1:37 pm

vishalkumar uppin wrote:Recently we brought raspberry pi 3b.Beginning we used to access the internet using an ethernet cable and it used to connect properly but now raspberry pi is not able to reache the gateway itself and it's taking its default IP address i.e 169.xxx.xxx.xx.
what would be the issue?we tried to reinstalling the operating system again the same issue .it worked for one day after that same problem.so please help me to solve the issue.
You are looking in the wrong place for the problem, I suggest you check the ethernet cable, the cable could be faulty. This is the first place to check.

"Default IP address" 169.254.xxx.xxx points to a communication problem to the network. The dhcp client on the raspberry does a broadcast on the network to find a dhcp server, if this is not successful the dhcp client will assign a random address in the 169.254.0.0/16 network.

You must follow the network to find out why your dhcp server did not reply, alternatively why the broadcast does not get to your dhcp server. In most home networks the dhcp server is in the internet router and a faulty (or not plugged in) ethernet cable is a very likely cause of the problem.
The road to insanity is paved with static ip addresses

vishalkumar uppin
Posts: 10
Joined: Fri Feb 10, 2017 5:35 am

Re: Raspberry pi is unable to reach Gateway

Tue Feb 14, 2017 4:15 am

no problem with the ethernet cable .if I try to do ssh from my system to raspberry pi using ethernet cable then also it's showing the same ip.i cannot do ssh also.
what might be the issue?

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

Re: Raspberry pi is unable to reach Gateway

Tue Feb 14, 2017 7:47 am

vishalkumar uppin wrote:no problem with the ethernet cable .if I try to do ssh from my system to raspberry pi using ethernet cable then also it's showing the same ip.i cannot do ssh also.
what might be the issue?
What is your system ? Is the Pi connected to a switch or connected to another computer using an ethernet cable ?
The road to insanity is paved with static ip addresses

vishalkumar uppin
Posts: 10
Joined: Fri Feb 10, 2017 5:35 am

Re: Raspberry pi is unable to reach Gateway

Tue Feb 14, 2017 8:02 am

pi is connected to other pc using ethernet cable...

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

Re: Raspberry pi is unable to reach Gateway

Tue Feb 14, 2017 8:15 am

vishalkumar uppin wrote:pi is connected to other pc using ethernet cable...
Did you search the forum or used google to find more information on this problem ?

I do not know what you are trying to do because my crystal ball is currently in for repairs, for me to understand you must give me a complete description what you are doing, why you are doing it and what result you expect, and a some information on the world around the Pi / PC could help a lot. It is also very good to know what the operating system is running on the Pi and the PC.
The road to insanity is paved with static ip addresses

vishalkumar uppin
Posts: 10
Joined: Fri Feb 10, 2017 5:35 am

Re: Raspberry pi is unable to reach Gateway

Tue Feb 14, 2017 10:25 am

1.Mainly pi is not getting connected to the internet using the ethernet cable.
2.pi is not getting connected to any of the devices through ethernet lets say it could be router or else it could be some other c from where I want to do ssh.
3.i want to do ssh.so if i connect it to my pc using ethernet cable its taking its default ip i.e 169.254.xxx.xxx instead of my pcs ip.
4.os
Raspbeery pi- Raspbian jessie.
PC - windows 7

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

Re: Raspberry pi is unable to reach Gateway

Tue Feb 14, 2017 10:32 am

The road to insanity is paved with static ip addresses


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

Re: Raspberry pi is unable to reach Gateway

Tue Feb 14, 2017 11:09 am

Are you sure ? I suggest you first try what I gave you before jumping into the deep end of networking.

EDIT: the post you referred to was before it was known that the Pi is connected directly to a notebook,
instead you should follow the last two entries on installing ICS which will make your PC the DHCP server.
The road to insanity is paved with static ip addresses

vishalkumar uppin
Posts: 10
Joined: Fri Feb 10, 2017 5:35 am

Re: Raspberry pi is unable to reach Gateway

Tue Feb 14, 2017 11:42 am

http://www.home-network-help.com/window ... aring.html
As per above-suggested method, .i tried to do but I am not able to find sharing option on the adapter setting.

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

Re: Raspberry pi is unable to reach Gateway

Tue Feb 14, 2017 11:52 am

The road to insanity is paved with static ip addresses

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

Re: Raspberry pi is unable to reach Gateway

Tue Feb 14, 2017 5:03 pm

vishalkumar uppin wrote:1.Mainly pi is not getting connected to the internet using the ethernet cable.
2.pi is not getting connected to any of the devices through ethernet lets say it could be router or else it could be some other c from where I want to do ssh.
3.i want to do ssh.so if i connect it to my pc using ethernet cable its taking its default ip i.e 169.254.xxx.xxx instead of my pcs ip.
4.os
Raspbeery pi- Raspbian jessie.
PC - windows 7
This is a very difficult description of your configuration. Networking is a difficult subject because there can be so many variables that can make solving a problem difficult. To be really successful it is necessary to have a very broad knowledge of all the components and software involved. I have already explained why the interface(s) have been assigned an IP-address in the 169.254.0.0/16 subnet, this means that a DHCP server was not found.

I still do not have a clear understanding on how you are connecting the Pi to the "internet", before I go into this I have to explain something. DHCP (Dynamic Host Configuration Protocol) is used to deliver a network configuration to a client (host). The basic configuration parameters are IP-address, subnet mask, router address, and (optionally) dns server address. If the host does not receive a reply from a DHCP server the host will randomly use an address in the subnet 169.254.0.0/16. (https://tools.ietf.org/html/rfc3927) with subnet mask 255.255.0.0, default gateway and DNS server will be left blank. (per definition the subnet can not be routed!)

In most home networks there will be a DHCP server in the internet router or WiFi access point serving the local subnet only because DHCP traffic will not be routed. Normally a client connected to the internet router with an ethernet cable, or using WiFi to the access point, will receive an IP-address from the DHCP server. If the DHCP server can not be reached you will see 169.254.0.0/16 addresses.

Note: You must be aware that is possible to connect a computer directly to the internet modem, in this case the DHCP server will be with the internet service provider. There are historic reasons why some of the features exist.

When you use an ethernet cable to connect the Pi to a computer there will be a problem with DHCP because there is no DHCP server on the cable. For this reason each interface will assign an address in the 169.254.0.0/16 network.

There are two options to make this work, each has advantages and disadvantages. I will start with the one that has most disadvantages.

The first option is to bridge network interfaces on your computer. You can use your WiFi interface to connect to your access point and the cable to to connect to your Pi. In this case the local DHCP server in the router/access point will be used by the Pi and the computer. You must be aware that this option does not work if the computer is connected to the internet modem because the ISP DHCP server will not support this.

The second option is to configure ICS on the interface connected to the internet to provide access on the another private interface. In this case a mini DHCP server will be installed on the computer which will be used to provide clients on the private interface with a private IP-address (192.168.137.x). At the same time the computer will be configured to function as a gateway and DNS forwarder on the private ethernet interface address. For a PC connected to an internet modem this is the option to share internet to other clients.

The first option (bridging) has the disadvantage that you must always have a connection to a network for the PI to be able to request configuration parameters from the DHCP server. The second option will always work, even when you do not have a connection to the network.

However, you can communicate from the computer to the PI using 169.254.0.0/16 addresses with the use of avahi/bonjour, but for internet from the Pi you need a proper IP-address.
The road to insanity is paved with static ip addresses

vishalkumar uppin
Posts: 10
Joined: Fri Feb 10, 2017 5:35 am

Re: Raspberry pi is unable to reach Gateway

Fri Feb 17, 2017 6:36 am

I did whatever they have mentioned on this page, but still I am not getting sharing option.
http://www.home-network-help.com/window ... aring.html


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

Re: Raspberry pi is unable to reach Gateway

Fri Feb 17, 2017 7:32 am

vishalkumar uppin wrote:Even this is also not working at all..
https://answers.microsoft.com/en-us/win ... f091711095
I suggest you look around where you live to find somebody to help you. I can not diagnose your problems with the little, incomplete, information provided until now. If you would like somebody to help then must give as much as possible information when asked so that the other person can visualize the problem, without that it becomes a guessing game.

My advice at this point: find somebody who can help with your computer because this is where the problem starts.
The road to insanity is paved with static ip addresses

vishalkumar uppin
Posts: 10
Joined: Fri Feb 10, 2017 5:35 am

Re: Raspberry pi is unable to reach Gateway

Fri Feb 17, 2017 7:58 am

i gave complete information about what you have asked.
thank you

vishalkumar uppin
Posts: 10
Joined: Fri Feb 10, 2017 5:35 am

Re: Raspberry pi is unable to reach Gateway

Wed Feb 22, 2017 9:36 am

Finally, I am able to figure it out after trial and error method. I have missed "auto eth0" before the iface statement i.e

auto eth0

iface eth0 inet static

address xxx.xxx.xxx.xxx

network 255.255.255.0

gateway xxx.xxx.xxx.xxx

dns-nameservers 8.8.8.8

Return to “Beginners”