0

I have just tried to set static ip on my raspbian.

I have added those line into /etc/dhcpcd.conf

interface INTERFACENAME(ETH0/WLAN0)
static ip_address=192.168.101.46/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 

And then I've reboot the raspberry.

when the system start I can login via SSH to the new local ip, but when I try to ping google there is no response. I have tried to put Google DNS 8.8.8.8 but I have not recevied any respond.

Thanks.

BTW - I've seen similar questions over here but I still unable to fix the problem.

Itzik.B
  • 111
  • 5
  • I have disabled it, and restart. same same :( I get: ping: google.co.il: Temporary failure in name resolution – Itzik.B Apr 11 '18 at 13:22
  • 1
    The given IPv4 address `192.168.101.46` in combination with the mask bit `24` results in a CIDR address range of `192.168.101.0 - 192.168.101.255`. Nice tool for this: [CIDR Calculator](http://www.subnet-calculator.com/cidr.php). – Fabian Apr 12 '18 at 13:29

3 Answers3

4

If:

static ip_address=192.168.101.46/24
static routers=192.168.1.1

Your router subnet is incorrect for your device because the subnet mask says your devices network is 192.168.101 and your router network is 192.168.1.

HTH

ghosts
  • 71
  • 3
2

I very much doubt you have an interface INTERFACENAME(ETH0/WLAN0) - there are other obvious errors.

If you absolutely MUST set a static address How to set up Static IP Address explains how to do it.

I still fail to understand why so many Pi users WANT to set a static IP address, particularly when they seem to have little understanding of networking.

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • by writing `INTERFACENAME(ETH0/WLAN0)` I have meant that the interfacename should be eth0 or wlan0 and its still need to be the same as the interface himself. – Itzik.B Apr 12 '18 at 16:03
0

@itzikb I think you put wrong address meanwhile in changing IP address process. as @ghost said, your router subnet is incorrect for your device. You have to change your configuration. look at this link might give you answer of your solution.

prince
  • 23
  • 5
  • 1
    fyi: we have verified the IP addresses on chat and I can confirm: SSH from PC to RPi at 192.168.101.46 is working, the routers webinterface is available at 192.168.1.1 – Fabian Apr 12 '18 at 13:44