I just started using raspberry pi.I am trying to sharing wifi internet connection with Raspberry Pi 2 - MODB through LAN (Headless mode)
What I have done so far?
Flashed SD card with 2015-05-05-raspbian-wheezy image
Enable “Allow other network users to connect through this computer‘s Internet connection” option for Wireless Network Connection Properties.
Append ip=Fixed IP:: Lan IP in cmdline.txt file
Open SSH with Fixed IP on PUTTY.
Issue:
Now through SSH, I am able to ping 8.8.8.8 IP which means I got internet access to my raspberry module. But not able to ping DNS - http://google.com, getting error unknown host
. And also not able to perform and updates, getting error Failed to fetch http://___
Getting confused whether raspberry board got internet access or not. And if yes, then why not able to access DNS and updates.
Outputs:
- Command prompt
C:\Users\Harish>ipconfig
Windows IP Configuration
Wireless LAN adapter Wireless Network Connection:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::51c4:e1df:75:72f8%14
IPv4 Address. . . . . . . . . . . : 192.168.0.111
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::1939:628b:ec79:f8a9%13
IPv4 Address. . . . . . . . . . . : 192.168.137.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
C:\Users\Harish>arp -a
Interface: 192.168.137.1 --- 0xd
Internet Address Physical Address Type
192.168.137.4 b8-27-eb-1f-05-15 dynamic
192.168.137.255 ff-ff-ff-ff-ff-ff static
224.0.0.2 01-00-5e-00-00-02 static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static
Interface: 192.168.0.111 --- 0xe
Internet Address Physical Address Type
192.168.0.1 14-cc-20-f5-cb-ba dynamic
192.168.0.103 08-ed-b9-d1-c3-f5 dynamic
192.168.0.107 48-d2-24-c4-0f-f0 dynamic
192.168.0.110 8c-a9-82-5d-8b-ac dynamic
192.168.0.255 ff-ff-ff-ff-ff-ff static
224.0.0.2 01-00-5e-00-00-02 static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static
Also able to ping LAN and FIXED ip through command prompt.
2. SSH output
pi@raspberrypi ~ $ sudo cat /etc/network/interfaces
auto io
inface lo inet loopback
auto eth0
allow-hotplug etho
inface eth0 inet manual
auto wlan)
allow-hotplug wloan0
inface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
auto wlan1
allow-hotplug wlan1
inface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
pi@raspberrypi ~ $ ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:a8:cf:a4
inet addr:192.168.137.4 Bcast:192.168.137.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:795 errors:0 dropped:0 overruns:0 frame:0
TX packets:814 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:61996 (60.5 KiB) TX bytes:114753 (112.0 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:308 errors:0 dropped:0 overruns:0 frame:0
TX packets:308 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24856 (24.2 KiB) TX bytes:24856 (24.2 KiB)
root@raspberrypi:/home/pi# route –n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
0.0.0.0 192.168.137.1 0.0.0.0 UG 0 0 0 eth0
192.168.137.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
I also tried after modifying interface file, but still not able to ping DNS.
pi@raspberrypi ~ $ sudo cat /etc/network/interfaces
auto io
inface lo inet loopback
auto eth0
allow-hotplug etho
inface eth0 inet dhcp
address 192.168.137.4
netmask 255.255.255.0
network 192.168.137.0
broadcast 192.168.137.255
gateway 192.168.137.1
auto wlan)
allow-hotplug wloan0
inface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
auto wlan1
allow-hotplug wlan1
inface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
cat /etc/resolv.conf
– jet Sep 6 '15 at 0:21nameserver 8.8.8.8
line should be sufficient. This file configures the DNS server(s) for the system hence failing to resolve domain names when was not configured. – jet Sep 6 '15 at 14:27