0

I have a Pi3B connected to my router via Ethernet, and have no problem on my LAN- WiFi is OK.
In fact, I use it as a file and LAMP server using Raspbian STRETCH. But I recently noticed the clock was off by several minutes, so it was rebooted, and still it was wrong.
THEN- After a apt-get update didn't work, I noticed I couldn't even do a ping 8.8.8.8 ! It hadn't been connected to the internet for several months!
In spite of Apache, PHP and Samba running along OK!
I'm using a static IP (...200.99) instead of a DHCP address.

So what's the problem?
Here's a copy of my ifconfig- And note that there is no WLAN in it, so I assume it's connected to the router via Ethernet.

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.200.99  netmask 255.255.255.0  broadcast 192.168.200.255
        inet6 fe80::ba27:ebff:fe8f:a5bf  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:8f:a5:bf  txqueuelen 1000  (Ethernet)
        RX packets 70004  bytes 13843226 (13.2 MiB)
        RX errors 0  dropped 2  overruns 0  frame 0
        TX packets 2381  bytes 175770 (171.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1495  bytes 150918 (147.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1495  bytes 150918 (147.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  • As you haven't told us what you did this is unanswerable – Milliways Mar 30 at 4:29
  • 1
    How do you set the static ip address? Please insert the information to the question together with the output of ip route. The first line of your ifconfig output is missed. Is it for eth0? – Ingo Mar 30 at 12:03
  • Listen- hold off on this for a while. I made changes to my router's DD-WRT a coupla months ago. Magically, My Win-10 connections to the internet AND to the Raspberries (using SAMBA) corrected themselves, after telling me about the changed SSID names (arbitrarily done by DDWRT!) Doubly compounded by the router address (..200.6) different from its gateway (..200.1) - I use the router also as a fileserver. All is still is connected OK somehow, EXCEPT the Raspberries connections to the Internet. So, I'll have to check the dhcpcd again and straighten them out! - Thanx! – aqk Mar 30 at 23:36
1

Have a look at the /etc/dhcpcd.conf file. It needs to read something like

interface eth0
   static ip_address=192.168.1.10/24
   static routers=192.168.1.1
   static domain_name_servers=1.1.1.1 208.67.220.220

Key thing is the static routers line - that should point to the home router to give internet access.

| improve this answer | |
  • Yep- no problem. See my comments re DDWRT above (he said, embarrassed) – aqk Mar 30 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.