Page 1 of 1
Can't access internet sites
Posted: Thu Dec 22, 2016 1:35 pm
by crchisholm
On a new rp3, I have ...
Installed noobs rasping.
Modified /etc/dhcpcd.conf to set static ip's for both eth0 and wlan0.
Pinged both ip's successfully from a Windows pc and Ubuntu.
Attached to my local LAN.
I can see all the routers in my neighborhood.
But I still get the "Aw snap ... " error message if I attempt to go to any internet site.
Can someone help me figure out what to look at next?
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 4:58 pm
by DougieLawson
Get the results from the following commands
ip addr show
ip route
sudo ping -c3 $(ip route | awk '/default/ {print $3}')
sudo ping -c3 8.8.8.8
sudo ping -c3 google.com
cat /etc/resolv.conf
And we can work out what's wrong with your network.
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 5:32 pm
by cchisholm
Ok, I will have to work on how to do that. For whatever reason, this morning, I can not connect using putty (connection refused) on both the eth0 and wlan0 connections. I can run the command you provided on the pi directly, but I have no way of capturing the resulting info for cut and paste, so I will have to retype everything....hopefully with a minimum of types. I will start on that now.
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 5:33 pm
by DougieLawson
You've got a phone, take a photo, post the photo on
http://imgur.com, post the link on here.
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 6:47 pm
by Anchan

Here is the answer.Follow this video step by step
https://youtu.be/S1UHoTQn11Y
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 6:52 pm
by cchisholm
The phone was a good idea that never occured to me until reading your reply. I had already retyped all the output (blue) before reading it. I am pretty sure there are no major typos.
ip addr show
1: lo: <LOOPBACK, UP, LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0 <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:2f:73:01 brd ff:ff:ff:ff:ff:ff
inet 192.158.0.160/24 brd 192.168.0.255 scope global eth0
valid_lft forever referred_lft forever
inet6 fe80::98c0:129f:9006:250e/64 scope link
valid_lft forever referred_left forever
3: wlan0 <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:7a:26:54 brd ff:ff:ff:ff:ff:ff
inet 192.158.0.158/24 brd 192.168.0.255 scope global eth0
valid_lft forever referred_lft forever
inet6 fe80::9e0d5:dbbc:fdfa:b511/64 scope link
valid_lft forever referred_left forever
ip route
default via 192.168.0.1 dev eth0 metric 202
default via 192.168.0.1 dev wlan0 metric 303
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.160 metric 202
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.158 metric 303
sudo ping -c3 $(ip route | awk '/default/ {print $3}')
PING 192.168.0.1 (192.168.0.1) 56(124) bytes of data.
--- 192.168.0.1 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2005ms
sudo ping -c3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=43 time=35.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=43 time=21.6 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=43 time=22.1 ms
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 21.603/26.387/35.409/6.384 ms
sudo ping -c3 google.com
ping: unknown host google.com
cat /etc/resolv.conf
# Generated by resolvconf
nameserver 192.168.0.1
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 7:16 pm
by DougieLawson
sudo ping -c3 $(ip route | awk '/default/ {print $3}')
PING 192.168.0.1 (192.168.0.1) 56(124) bytes of data.
--- 192.168.0.1 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2005ms
There's your problem. Your eth0 interface is the prefered route but isn't connected to your router.
Take the
Code: Select all
interface eth0
static routers=192.168.0.1
lines out of your /etc/dhcpcd.conf file. Leave it so that only one interface has a static routers line.
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 7:32 pm
by cchisholm
Then I guess I don't know what I did wrong. Here is a link to what I added to the bottom of dhcpcd.conf. Can you tell me what's wrong with it?
http://imgur.com/t23gOjC
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 7:34 pm
by 6by9
Connecting both interfaces to the same subnet 192.168.0.0/24 seems wrong if they aren't both actually the same network. If they are the same network then both should be able to contact the router on 192.168.0.1.
It sounds like you've the same issue as covered in
viewtopic.php?f=63&t=168513 - ethernet gets a metric of 202, wlan of 303, therefore ethernet is preferred if a gateway is defined.
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 7:42 pm
by DougieLawson
cchisholm wrote:Then I guess I don't know what I did wrong. Here is a link to what I added to the bottom of dhcpcd.conf. Can you tell me what's wrong with it?
http://imgur.com/t23gOjC
Take the four lines (from interface eth0) out then reboot.
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 8:49 pm
by cchisholm
Great! I am almost there. But now (at least starting today), I can no longer access the Pi via putty. It was working yesterday, but apparently something I did in trying to sort this out has caused it to stop working. I get a "connection refused" when I try and access it.
Any ideas what I can look at for that?
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 9:38 pm
by cchisholm
So far, so good. I am able to got to chilipeppr.com and I can access the pi from via VNC viewer. I guess I don't need putty any more.
Thank you for all the help. I can't promise I won't get myself into trouble again, but at least all four wheels are on the road right now.
Thanks agan.
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 9:51 pm
by DougieLawson
Try disabling and re-enabling ssh. The latest Raspbian did stuff to make ssh more secure - one of those things being not enabling it by default.
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 10:14 pm
by cchisholm
Well, enabling SSH worked. What I ussually do is connect via putty SSH and then use the remote desktop viewer, but now the RDV doesn't want to run. I had to run x11 (tightVNC) on RP2 B. I thought that enabling VNC in the raspi-config would do away with that. Was I wrong?
Re: Can't access internet sites
Posted: Thu Dec 22, 2016 10:18 pm
by DougieLawson
xrdp/rdp isn't compatible with RealVNC, which is a lot more secure than tightvncserver. xrdp/rdp is also an exceedingly insecure protocol. So the RPF folks replaced the VNC on your Raspberry to improve Raspbian security.
Easiest option is to install the free realvnc client on Windows and forget xrdp/rdp ever existed. Or run MobaXterm on Windows which uses PuTTY/ssh for the connection.