stevejclarke
Posts: 8
Joined: Wed Oct 17, 2018 1:27 pm

Unable to Access Internet

Wed Oct 17, 2018 1:45 pm

I've got my RPi up and running on Raspbian/Debian with Domoticz loaded and managing my HA devices. Everything is working fine and I can access it on my local network via PuTTY etc. However, although I know the IP address is 192.168.1.94 and 192.168.1.95 for WiFi, the ethernet address isn't listed on my BT Home Hub 5 router page, and I can't connect to the interrnet from it. Pinging an outside address results in 'Destination Host Unreachable'.
I've tried some of the solutoions found on the web, and rebooting the PRi but nothing seems to work.
Here's the output from ifconfig:

Code: Select all

[email protected]:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.94  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::658c:d5fe:8acf:ad50  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:57:ab:fb  txqueuelen 1000  (Ethernet)
        RX packets 16340  bytes 1217697 (1.1 MiB)
        RX errors 0  dropped 2324  overruns 0  frame 0
        TX packets 868  bytes 95471 (93.2 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 342  bytes 38304 (37.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 342  bytes 38304 (37.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.95  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::ba27:ebff:fe02:feae  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:02:fe:ae  txqueuelen 1000  (Ethernet)
        RX packets 5574  bytes 715626 (698.8 KiB)
        RX errors 0  dropped 2322  overruns 0  frame 0
        TX packets 180  bytes 19562 (19.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Help please !

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

Re: Unable to Access Internet

Wed Oct 17, 2018 2:06 pm

Sounds like a routing problem. Post the output of

Code: Select all

route

stevejclarke
Posts: 8
Joined: Wed Oct 17, 2018 1:27 pm

Re: Unable to Access Internet

Wed Oct 17, 2018 2:55 pm

[email protected]:~ $ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface

default 192.168.1.1 0.0.0.0 UG 202 0 0 eth0
default 192.168.1.254 0.0.0.0 UG 303 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0

DirkS
Posts: 10018
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to Access Internet

Wed Oct 17, 2018 3:25 pm

You have 2 default routes for the same subnet. Did you try to set a static IP address?
Did you make any changes to /etc/dhcpcd.conf and / or /etc/network/interfaces?

The BT Homehubs I have seen so far use 192.168.1.254 as the gateway, so it looks to me that somewhere a gateway with IP 192.168.1.1 was introduced.

stevejclarke
Posts: 8
Joined: Wed Oct 17, 2018 1:27 pm

Re: Unable to Access Internet

Wed Oct 17, 2018 3:38 pm

Hi, no, I didn't make any changes, nor set a static address. All I did was load the OS, load Domoticz & plug it in.
However, when I discovered the date was wrong I did try to install some timesever packages, that's when I discovered the problem was lack of internet access.

PhatFil
Posts: 1439
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Unable to Access Internet

Wed Oct 17, 2018 3:43 pm

double post in error please delete
Last edited by PhatFil on Wed Oct 17, 2018 3:47 pm, edited 1 time in total.

PhatFil
Posts: 1439
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Unable to Access Internet

Wed Oct 17, 2018 3:46 pm

its odd to be sure, imho best test is to download the os again, reflash and confirm network/internet conectivity before installing anything else,

its not a common issue and even though the latest release is only a week or so old atm if it were a package fault it would have come to light by now so to me it smells like a slight corruption of the download could be at the root of this..

DirkS
Posts: 10018
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to Access Internet

Wed Oct 17, 2018 3:49 pm

PhatFil wrote:
Wed Oct 17, 2018 3:46 pm
to me it smells like a slight corruption of the download could be at the root of this..
I would disagree. What I see looks more like a misconfiguration than corruption.

stevejclarke
Posts: 8
Joined: Wed Oct 17, 2018 1:27 pm

Re: Unable to Access Internet

Wed Oct 17, 2018 3:49 pm

However, I've just discovered the contents of dhcpcd.conf, no idea how this happened.

interface eth0
static ip_address=192.168.1.94/24 # << change to a spare IP Address in your network (make sure it's outside of the DHCP range)
static routers=192.168.1.1 # << change to your gateway (usually your router)
static domain_name_servers=192.168.1.1 # << change to your DNS (usually your router)

DirkS
Posts: 10018
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to Access Internet

Wed Oct 17, 2018 3:50 pm

stevejclarke wrote:
Wed Oct 17, 2018 3:38 pm
Hi, no, I didn't make any changes, nor set a static address. All I did was load the OS, load Domoticz & plug it in.
However, when I discovered the date was wrong I did try to install some timesever packages, that's when I discovered the problem was lack of internet access.
Can you post the contents of /etc/dhcpcd.conf and /etc/network/interfaces.

stevejclarke
Posts: 8
Joined: Wed Oct 17, 2018 1:27 pm

Re: Unable to Access Internet

Wed Oct 17, 2018 3:53 pm

interface eth0
static ip_address=192.168.1.94/24 # << change to a spare IP Address in your network (make sure it's outside of the DHCP range)
static routers=192.168.1.1 # << change to your gateway (usually your router)
static domain_name_servers=192.168.1.1 # << change to your DNS (usually your router)

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1

# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1

# fallback to static profile on eth0
#interface eth0
#fallback static_eth0

stevejclarke
Posts: 8
Joined: Wed Oct 17, 2018 1:27 pm

Re: Unable to Access Internet

Wed Oct 17, 2018 3:53 pm

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

DirkS
Posts: 10018
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to Access Internet

Wed Oct 17, 2018 3:58 pm

Code: Select all

nterface eth0
static ip_address=192.168.1.94/24 # << change to a spare IP Address in your network (make sure it's outside of the DHCP range)
static routers=192.168.1.1 # << change to your gateway (usually your router)
static domain_name_servers=192.168.1.1 # << change to your DNS (usually your router) 
I don't know who (or what) made this chance, but it's not the default contents.
Maybe something to do with the HA package?

'static routers=192.168.1.1' introduces the misconfiguration. That address should be 192.168.1.254
domain_name_servers should also be changed to the same address.
Last edited by DirkS on Wed Oct 17, 2018 4:01 pm, edited 1 time in total.

stevejclarke
Posts: 8
Joined: Wed Oct 17, 2018 1:27 pm

Re: Unable to Access Internet

Wed Oct 17, 2018 4:00 pm

Should I change it and reboot ?

DirkS
Posts: 10018
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to Access Internet

Wed Oct 17, 2018 4:01 pm

stevejclarke wrote:
Wed Oct 17, 2018 4:00 pm
Should I change it and reboot ?
Yes. But see my change above first (domain name server also needs to be changed)

stevejclarke
Posts: 8
Joined: Wed Oct 17, 2018 1:27 pm

Re: Unable to Access Internet

Wed Oct 17, 2018 4:09 pm

That seems to have done the trick, brilliant, many thanks.

DirkS
Posts: 10018
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Unable to Access Internet

Wed Oct 17, 2018 4:27 pm

stevejclarke wrote:
Wed Oct 17, 2018 4:09 pm
That seems to have done the trick, brilliant, many thanks.
Great!

Return to “Troubleshooting”