cchisholm
Posts: 78
Joined: Sat Mar 07, 2015 4:47 pm

Loose access to internet when I setup static IP

Tue Mar 20, 2018 6:01 pm

My goal is to control a headless rp3 from a win10 machine. by following these instructions (twice)...
https://raspberrypi.stackexchange.com/q ... 4428#74428
...I was able to successfully set the static IP and access it from VNC....but then things got strange.

Here is the output from ifconfig showing the proper IP address...

Code: Select all

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.215  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::574d:3c4d:490a:6fb5  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:ca:d8:e8  txqueuelen 1000  (Ethernet)
        RX packets 150  bytes 26452 (25.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 213  bytes 23242 (22.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
I can ping the rp3 fine from the win10 machine. but now, I can't see the internet from the rp3 saying anything on the outside is "unreachable", and when I try to ping the win10 machine, it just sits there and does nothing...

Code: Select all

[email protected]:~ $ ping 192.168.0.20
PING 192.168.0.20 (192.168.0.20) 56(84) bytes of data.
Apparently, I have left a step out or something, but not sure what.

Any suggestions??

BTW, I know I am terrible about laying out my question, so please ask if I am still not clear.
Charlie

MaxVMH
Posts: 111
Joined: Mon Mar 19, 2018 1:26 pm

Re: Loose access to internet when I setup static IP

Tue Mar 20, 2018 6:05 pm

Maybe that IP address is already in use, can you try another one?

Also, don't forget to reboot afterwards.
Webserver stack: 2x Pi 3B | 1x Pi 3B+ ||| Pi Zero W for fooling around

Working on a soccer prediction web app:
https://github.com/MaxVMH/mijnscore
Attempt at writing up-to-date tutorials on making a Raspberry Pi webserver:
http://blog.mijnscore.be/

cchisholm
Posts: 78
Joined: Sat Mar 07, 2015 4:47 pm

Re: Loose access to internet when I setup static IP

Tue Mar 20, 2018 10:41 pm

I checked and there are only four machines on the network at the moment and I know the IP's on all.

I have rebooted several times since discovering this and the problem persists.

I am still trying to get my head around setting up a fixed IP in dhcpcd.conf rather than interfaces, so I figure I am doing something wrong there. The only thing I did was add the following at the bottom of dhcpcd.conf...

Code: Select all

interface wlan0
static ip_address=192.168.0.215
static routers=192.168.0.1
static domain_name_servers=192.168.0,1
this gave me the fixed IP but took away access to the internet.
Was there something else I needed to do?

fbe
Posts: 325
Joined: Thu Aug 17, 2017 9:08 pm

Re: Loose access to internet when I setup static IP

Tue Mar 20, 2018 10:51 pm

You should add /24 to your ip address
You must replace the komma by a dot in the domain_name_servers ip address

crchisholm
Posts: 6
Joined: Sun May 04, 2014 3:14 pm

Re: Loose access to internet when I setup static IP

Wed Mar 21, 2018 12:46 am

fbe wrote:
Tue Mar 20, 2018 10:51 pm
You should add /24 to your ip address
You must replace the komma by a dot in the domain_name_servers ip address
I had added the /24 after posting, but didn’t see the comma until you pointed it out, but I have this same problem on two different RP3’s and I know the second one does not have that typo.

I will correct the comma, but I suspect the problem will persist since the second RP3 without the typo behaves exactly the same way.

MaxVMH
Posts: 111
Joined: Mon Mar 19, 2018 1:26 pm

Re: Loose access to internet when I setup static IP

Wed Mar 21, 2018 6:49 am

Try using only:

Code: Select all

interface wlan0
static ip_address=192.168.0.215/24

And then reboot ofcourse. PS: why are you trying to use 192.168.0.1 as a DNS-server?
Webserver stack: 2x Pi 3B | 1x Pi 3B+ ||| Pi Zero W for fooling around

Working on a soccer prediction web app:
https://github.com/MaxVMH/mijnscore
Attempt at writing up-to-date tutorials on making a Raspberry Pi webserver:
http://blog.mijnscore.be/

pcmanbob
Posts: 4265
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Loose access to internet when I setup static IP

Wed Mar 21, 2018 11:33 am

MaxVMH wrote:
Wed Mar 21, 2018 6:49 am
why are you trying to use 192.168.0.1 as a DNS-server?
Some routers have provision for you to enter the DNS servers you want to use in their settings, you can then just point any PC or Pi at the router address for its DNS server and the router will redirect the request to the entered DNS servers.

cchisholm.

Try following the raspberrypi.org lesson on networking to set a static IP on your pi.

https://www.raspberrypi.org/learning/ne ... p-address/
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

cchisholm
Posts: 78
Joined: Sat Mar 07, 2015 4:47 pm

Re: Loose access to internet when I setup static IP

Wed Mar 21, 2018 12:19 pm

pcmanbob wrote:
Wed Mar 21, 2018 11:33 am

Try following the raspberrypi.org lesson on networking to set a static IP on your pi.

https://www.raspberrypi.org/learning/ne ... p-address/
This is exactly what I did. Actually tried it on two different RP3’s and got the same result from both. One points back to the router for DNS (192,168.0.1) and the other points to 8.8.8.8, 8.8.4.4. In both cases, I have the static IP I want, but no access beyond the gateway.

Seems like there has to be another step I am missing.

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

Re: Loose access to internet when I setup static IP

Wed Mar 21, 2018 12:21 pm

Are you certain your router is at 192.168.0.1?

User avatar
RaTTuS
Posts: 10061
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Loose access to internet when I setup static IP

Wed Mar 21, 2018 12:35 pm

go back to dhcp
what does it say when you do
ifconfig
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
scruss
Posts: 1768
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Loose access to internet when I setup static IP

Wed Mar 21, 2018 12:55 pm

RaTTuS wrote:
Wed Mar 21, 2018 12:35 pm
go back to dhcp
Amen to that!

I dunno the fascination with static LAN addresses. We've been trying for decades to make the problem go away, and yet it comes up here 👏 all 👏 the 👏 time 👏.

Two ways to get a predictable address without breaking DHCP:
  1. In your router, bind specific MAC addresses to specific LAN addresses. It's not 100% reliable (what is?), but after the first reboot it's pretty stable.
  2. Use mDNS/Avahi/Bonjour and change the hostname. It's a bit poor in a Raspberry Pi meetup where everyone's starting new machines for the first time, so too many raspberrypi.locals with the same password happen at once, but in RL this is less of a problem.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

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

Re: Loose access to internet when I setup static IP

Wed Mar 21, 2018 1:03 pm

scruss wrote:
Wed Mar 21, 2018 12:55 pm
RaTTuS wrote:
Wed Mar 21, 2018 12:35 pm
go back to dhcp
Amen to that!

I dunno the fascination with static LAN addresses. We've been trying for decades to make the problem go away, and yet it comes up here 👏 all 👏 the 👏 time 👏.

Two ways to get a predictable address without breaking DHCP:
  1. In your router, bind specific MAC addresses to specific LAN addresses. It's not 100% reliable (what is?), but after the first reboot it's pretty stable.
  2. Use mDNS/Avahi/Bonjour and change the hostname. It's a bit poor in a Raspberry Pi meetup where everyone's starting new machines for the first time, so too many raspberrypi.locals with the same password happen at once, but in RL this is less of a problem.
Some of us need static IPs without using a router setup. Some of us have static IPs issued by our ISPs. Some don't have access to the router setup.

cchisholm
Posts: 78
Joined: Sat Mar 07, 2015 4:47 pm

Re: Loose access to internet when I setup static IP

Wed Mar 21, 2018 2:24 pm

SurferTim wrote:
Wed Mar 21, 2018 12:21 pm
Are you certain your router is at 192.168.0.1?
Yes. Absolutely sure. Been that for years.
RaTTuS wrote:go back to dhcp
what does it say when you do
ifconfig
As i showed in my openning question....

Code: Select all

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.215  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::574d:3c4d:490a:6fb5  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:ca:d8:e8  txqueuelen 1000  (Ethernet)
        RX packets 150  bytes 26452 (25.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 213  bytes 23242 (22.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
scruss: I need fixed IP because I am using the RP3's headless with VNC and have a few other processes that count on the IP remaining stable. With DHCP, if somewhere down the line (it's happened often) the DHCP assigns a different IP to the RP3, i have to reconfigure VNC and a couple other processes to the new IP. As far as your other two suggestions are concerned, I'm afraid they are above my skill set.

MaxVMH
Posts: 111
Joined: Mon Mar 19, 2018 1:26 pm

Re: Loose access to internet when I setup static IP

Wed Mar 21, 2018 2:25 pm

Can you try this on a fresh install?
MaxVMH wrote:
Wed Mar 21, 2018 6:49 am
Try using only:

Code: Select all

interface wlan0
static ip_address=192.168.0.215/24

And then reboot ofcourse.
Webserver stack: 2x Pi 3B | 1x Pi 3B+ ||| Pi Zero W for fooling around

Working on a soccer prediction web app:
https://github.com/MaxVMH/mijnscore
Attempt at writing up-to-date tutorials on making a Raspberry Pi webserver:
http://blog.mijnscore.be/

cchisholm
Posts: 78
Joined: Sat Mar 07, 2015 4:47 pm

Re: Loose access to internet when I setup static IP

Wed Mar 21, 2018 7:12 pm

MaxVMH wrote: Can you try this on a fresh install?
MaxVMH wrote:
Wed Mar 21, 2018 6:49 am
Try using only:

Code: Select all

interface wlan0
static ip_address=192.168.0.215/24

And then reboot ofcourse.
I will format another SD, download NOOBS again and install it and try what you suggest. I am not very optimistic though considering that this is happening on two different RP3's, with different SD cards, and different downloads of NOOBS. I still think it's something I did wrong when I set it up, but I will try again with everything fresh.

Maybe three times is the charm.

MaxVMH
Posts: 111
Joined: Mon Mar 19, 2018 1:26 pm

Re: Loose access to internet when I setup static IP

Fri Mar 23, 2018 1:32 pm

Did it work?
Webserver stack: 2x Pi 3B | 1x Pi 3B+ ||| Pi Zero W for fooling around

Working on a soccer prediction web app:
https://github.com/MaxVMH/mijnscore
Attempt at writing up-to-date tutorials on making a Raspberry Pi webserver:
http://blog.mijnscore.be/

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

Re: Loose access to internet when I setup static IP

Fri Mar 23, 2018 1:35 pm

If this is all that was entered in /etc/dhcpcd.conf

Code: Select all

interface wlan0
static ip_address=192.168.0.215/24
then it didn't work. If you want internet access, you must enter a routers and domain_name_servers parameter also.

Code: Select all

interface wlan0
static ip_address=192.168.0.215/24
static routers=192.168.0.1
static domain_name_servers=8.8.8.8

User avatar
RaTTuS
Posts: 10061
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Loose access to internet when I setup static IP

Fri Mar 23, 2018 1:38 pm

also , don't use noobs use raspbain or raspbian lite if no desktop needed
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

MaxVMH
Posts: 111
Joined: Mon Mar 19, 2018 1:26 pm

Re: Loose access to internet when I setup static IP

Fri Mar 23, 2018 2:25 pm

SurferTim wrote:
Fri Mar 23, 2018 1:35 pm
If this is all that was entered in /etc/dhcpcd.conf

Code: Select all

interface wlan0
static ip_address=192.168.0.215/24
then it didn't work. If you want internet access, you must enter a routers and domain_name_servers parameter also.

Code: Select all

interface wlan0
static ip_address=192.168.0.215/24
static routers=192.168.0.1
static domain_name_servers=8.8.8.8
Using only those 2 lines work for me though, I use it on multiple debian-based OS’s.
Webserver stack: 2x Pi 3B | 1x Pi 3B+ ||| Pi Zero W for fooling around

Working on a soccer prediction web app:
https://github.com/MaxVMH/mijnscore
Attempt at writing up-to-date tutorials on making a Raspberry Pi webserver:
http://blog.mijnscore.be/

Return to “Troubleshooting”

Who is online

Users browsing this forum: 5ft24dave, klricks, murksiuke, thomas valance and 63 guests