thedoc8
Posts: 14
Joined: Sun Dec 28, 2014 7:44 pm

Static

Sun Jan 14, 2018 11:58 am

Been trying for a week to get internet on my pi2 b. I have read many articles on how to do it, each with something a little different
This is a pi2b with Raspbain and all the latest updates

I have internet until I add the following 3 lines to my /etc/dhcpcd.conf to set a static address for the pi

interface eth0
static ip_address=192.168.1.180/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1

Soon as I add these lines to fresh install my local network functions like it should, but I get know internet.
If comment these lines out I then have internet but the local net will not work.

I have tried many many different things like static domain_name_servers = "nothing I have put here gets me internet"

I have seen where they want you to edit all the different files to make this work and nothing does.

Does anybody actually know what file is the proper one and what to add to get internet...?

1 can get internet without the above lines but no local
2 can get local net to work with the lines above but no internet . Can't get both
3 However I configure the static domain_name_servers= line, makes no difference

Thanks if you can help, im out of thing to try
Last edited by thedoc8 on Sun Jan 14, 2018 1:32 pm, edited 2 times in total.

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

Re: Static

Sun Jan 14, 2018 12:04 pm

It may be that your router has no DNS specified try changing your "static domain_name_servers=192.168.1.1" line to
"static domain_name_servers=8.8.8.8"

Code: Select all

interface eth0

static ip_address=192.168.1.180/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8
Please only ask questions in the forum I will not answer questions sent to me directly via PM
Remember we want information.......................no information no help

User avatar
HawaiianPi
Posts: 1517
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Static

Sun Jan 14, 2018 12:16 pm

That's really odd. You should not need to do anything special at all to get Internet and local network access with a Pi computer connected to your router using Ethernet.

What OS?

What kind of router, and are you using any special configuration (MAC filtering, AP isolation, or...)?

What kind of local access are you attempting that fails?

With the latest version of Raspbian you should just be able to plug the Ethernet cable into your router, boot up the Pi2, and have both Internet and local network access for typical Linux network services. If you want to use something special like SAMBA/CIFS (Windows shares) or media server functions, then you'll need some additional configuration, but for basic stuff like SSH or mounting an NFS file server, it should just work.
My password is the last 8 digits of Pi.

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

Re: Static

Sun Jan 14, 2018 12:55 pm

I know this is picky, and may be a typo when posted here, but router should be routers (plural).

Code: Select all

interface eth0
static ip_address=192.168.1.180/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1

thedoc8
Posts: 14
Joined: Sun Dec 28, 2014 7:44 pm

Re: Static

Sun Jan 14, 2018 1:10 pm

pcmanbob wrote:
Sun Jan 14, 2018 12:04 pm
It may be that your router has no DNS specified try changing your "static domain_name_servers=192.168.1.1" line to
"static domain_name_servers=8.8.8.8"

Code: Select all

interface eth0

static ip_address=192.168.1.180/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8
Using fully updated raspbain pi2b
Fresh install, multiple times
If comment out the above lines I have internet, but the local network breaks and I can't see pie from windows and pie can't see files on windows

Many people with same problem and no fix,
Tried "static domain_name_servers=8.8.8.8" "static domain_name_servers=8.8.8.8.8.8.4.4
"static domain_name_servers=209.18.47.62 (got from router) and many others that don't work but I will try anything.
I know its a dns problem, but don't know. Thanks

thedoc8
Posts: 14
Joined: Sun Dec 28, 2014 7:44 pm

Re: Static

Sun Jan 14, 2018 1:12 pm

SurferTim wrote:
Sun Jan 14, 2018 12:55 pm
I know this is picky, and may be a typo when posted here, but router should be routers (plural).

Code: Select all

interface eth0
static ip_address=192.168.1.180/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
yes I use routers, thanks
Last edited by thedoc8 on Sun Jan 14, 2018 1:26 pm, edited 1 time in total.

thedoc8
Posts: 14
Joined: Sun Dec 28, 2014 7:44 pm

Re: Static

Sun Jan 14, 2018 1:18 pm

HawaiianPi wrote:
Sun Jan 14, 2018 12:16 pm
That's really odd. You should not need to do anything special at all to get Internet and local network access with a Pi computer connected to your router using Ethernet.

What OS? Raspbain fully updated

What kind of router, and are you using any special configuration (MAC filtering, AP isolation, or...)? The router is netgear r7000p and nothing changed on it sep password.

What kind of local access are you attempting that fails? Just see shares windows>pie and pi > windows which works without those lines.

With the latest version of Raspbian you should just be able to plug the Ethernet cable into your router, boot up the Pi2, and have both Internet and local network access for typical Linux network services. If you want to use something special like SAMBA/CIFS (Windows shares) or media server functions, then you'll need some additional configuration, but for basic stuff like SSH or mounting an NFS file server, it should just work.
Raspbian fully updated The router is netgear r7000p and nothing changed on it sept password.

Out of the box, have internet, put those lines in and the static address works as does the shares, but no internet

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

Re: Static

Sun Jan 14, 2018 1:24 pm

If you use "router" (singular), your static settings will fail. You must use "routers" (plural, with an 's').

thedoc8
Posts: 14
Joined: Sun Dec 28, 2014 7:44 pm

Re: Static

Sun Jan 14, 2018 1:29 pm

SurferTim wrote:
Sun Jan 14, 2018 12:55 pm
I know this is picky, and may be a typo when posted here, but router should be routers (plural).

Code: Select all

interface eth0
static ip_address=192.168.1.180/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
believe me have made that error without the s. Where did I post the code without the s....? Thanks, tired, up all night again.

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

Re: Static

Sun Jan 14, 2018 1:32 pm

Your OP had "router". Ensure you are using a text editor to edit the files. I use leafpad or nano.

I have no problem assigning static settings to any of my network devices. Don't know what else to tell you, except don't put any entries in /etc/network/interfaces unless it is a bridge.

thedoc8
Posts: 14
Joined: Sun Dec 28, 2014 7:44 pm

Re: Static

Sun Jan 14, 2018 1:43 pm

SurferTim wrote:
Sun Jan 14, 2018 1:32 pm
Your OP had "router". Ensure you are using a text editor to edit the files. I use leafpad or nano.

I have no problem assigning static settings to any of my network devices. Don't know what else to tell you, except don't put any entries in /etc/network/interfaces unless it is a bridge.
Thanks I have only modified /ect/dhcpcd.conf with nano
One person that seem to know what he was talking about, said it is a major bug in the lastest raspbain and had a 2 page fix that I have not tried to do yet. The browser always say errors about dns. Thanks again.

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

Re: Static

Sun Jan 14, 2018 2:01 pm

Well the latest raspbian image is dated 29-11-2017 so if there was a major problem with network like this I would have expected to have seem many posts about it by now.

out of interest remove your static IP details from dhcpcd.conf and allow your router to assign an address then do

Code: Select all

ifconfig
and post the results.

I would also try rebooting your router its not unknown for them to do strange things especially if you have had a mains dip.

Edit.

Download raspbian stretch dated 29-11-2017 flashed to new SD card. enabled ssh and changed user password and nothing else, can access web pages and seen on local network ok, ssh'ed in no problem. so image on web site is good , if you are still having problems I would suggest downloading a fresh copy of the image file and trying again.
Please only ask questions in the forum I will not answer questions sent to me directly via PM
Remember we want information.......................no information no help

User avatar
HawaiianPi
Posts: 1517
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Static

Sun Jan 14, 2018 7:17 pm

Yup, what pcmanbob said above ^

I also have been using the latest Raspbian Stretch images on my Pi computers without any problems. There is nothing wrong with the image.
  1. Why are you using a static IP?
  2. Why not set a reserve IP in your router instead of using a static IP?
  3. Where did you get your OS image?
  4. Did you verify the SHA256 hash sum of your download?
  5. How did you write your image?
thedoc8 wrote:
Sun Jan 14, 2018 1:10 pm
...
Many people with same problem and no fixs
Really, where?
My password is the last 8 digits of Pi.

Return to “Troubleshooting”

Who is online

Users browsing this forum: gkreidl, jojopi and 27 guests