Page 1 of 1
Connect Internet
Posted: Tue Mar 04, 2014 11:11 am
by yyyyazj
I want to connect my RaspberryPi with Ethernet by using DNS, but I have a problem like: cannot resolve proxy hostname. How can I fix this?
Re: Connect Internet
Posted: Tue Mar 04, 2014 11:48 am
by DougieLawson
Please post the output from the following commands
cat /etc/network/interfaces
ifconfig -a
route -n
cat /etc/resolv.conf
ping -c3 8.8.8.8
ping -c3 google.com
Re: Connect Internet
Posted: Thu Mar 06, 2014 8:09 am
by yyyyazj
Here is the result of these command:
cat /etc/network/interfaces:
auto lo
iface lo inet loopback
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.50.175
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.50.1
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
ifconfig -a:
eth0 Link encap:Ethernet Hwaddr b8:27:eb:38:2f:84
inet addr:192.168.50.175 Bcast:192.168.0.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST
MTU:1500 Metric:1
RX packets:3188 errors:0 dropped:0 overruns:0
frame:0
TX packets:72 errors:0 dropped:0 overruns:0
carrier:0
collisions:0 txqueuelen:1000
RX bytes:261189(255.0 KiB) TX bytes:9507(9.2KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:163 errors:0 dropped:0 overruns:0
frame:0
TX packets:163 errors:0 dropped:0 overruns:0
carrier:0
collisions:0 txqueuelen:0
RX bytes:13564(13.2 KiB)
TX bytes:13564(13.2 KiB)
route -n:
Kernel IP routing table
Destination Gateway Genmask Flags Metric
0.0.0.0 192.168.50.1 0.0.0.0 UG 0
192.168.50.0 0.0.0.0 255.255.255.0 U 0
Ref Use Iface
0 0 eth0
0 0 eth0
cat /etc/resolv.conf:
domain home
search home
Nameserver 194.167.30.130
ping -c3 8.8.8.8:
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss,
time 2006ms
ping -c3 google.com:
ping: unknown host google.com
Re: Connect Internet
Posted: Thu Mar 06, 2014 8:14 am
by DougieLawson
Can you open a command window on your Windows system and post the output from an
ipconfig /all
command.
Re: Connect Internet
Posted: Thu Mar 06, 2014 8:57 am
by yyyyazj
No, because the result is obtained in Raspberry PI, I cannot open a Windows system to test the command
Re: Connect Internet
Posted: Thu Mar 06, 2014 8:58 am
by DougieLawson
Can you ping your router?
ping -c3 192.168.50.1
Re: Connect Internet
Posted: Fri Mar 07, 2014 7:24 am
by yyyyazj
Yes, I can. But it can't always connect. They change information three times and then disconnect.
ping -c3 192.168.50.1:
64 bytes from 192.168.50.1: icmp_req=1 ttl=64 time=2.06ms
64 bytes from 192.168.50.1: icmp_req=2 ttl=64 time=3.20ms
64 bytes from 192.168.50.1: icmp_req=3 ttl=64 time=4.58ms
---192.168.50.1 ping statistics---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev=2.065/3.284/4.584/1.031 ms
Re: Connect Internet
Posted: Fri Mar 07, 2014 7:46 am
by ripat
I don't know if this was intended or if this is the cause of your problem but your broadcast mask is not on the same subnet than your IP.
In the /etc/network/interfaces file:
Code: Select all
# change to
broadcast 192.168.50.255
And restart your network service.
Re: Connect Internet
Posted: Fri Mar 07, 2014 8:15 am
by DougieLawson
ripat wrote:I don't know if this was intended or if this is the cause of your problem but your broadcast mask is not on the same subnet than your IP.
In the /etc/network/interfaces file:
Code: Select all
# change to
broadcast 192.168.50.255
And restart your network service.
It's much easier to simply remove any broadcast and network statements.
With ip address netmask and gateway you can easily calculate the broadcast and network addresses. The ip and ifconfig commands do that maths.
Coding them in /etc/network/interfaces just opens up another way to get it wrong.
Re: Connect Internet
Posted: Fri Mar 07, 2014 8:54 am
by ripat
DougieLawson wrote:It's much easier to simply remove any broadcast and network statements.
True.