1

I have my raspberry pi running on raspbian jessie lite. I have created a hotspot on my windows machine and connected my raspberry pi to the hotspot. The pi has got an ip address assigned to it, but when I ping www.google.com I get unknown host, and when I ping 8.8.8.8 I get network is unreachable.

I tried connecting my phone to the wifi hotspot and it got connected to the internet. The hotspot shows that both my phone and raspberry pi is connected to the PC but the raspberrt pi is not connecting to the internet, while my phone is working fine.

ifconfig:

eth0 Link encap:Ethernet HWaddr b8:27:eb:ae:1a:8a

      inet6 addr: fe80::3a87:90a8:b2e7:b84a/64 Scope:Link
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo Link encap:Local Loopback

      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:340 errors:0 dropped:0 overruns:0 frame:0
      TX packets:340 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1
      RX bytes:27440 (26.7 KiB)  TX bytes:27440 (26.7 KiB)

wlan0 Link encap:Ethernet HWaddr 50:2b:73:ec:0d:12

      inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
      inet6 addr: fe80::64f1:6e14:507d:7cb7/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:808 errors:0 dropped:0 overruns:0 frame:0
      TX packets:540 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:80924 (79.0 KiB)  TX bytes:87654 (85.5 KiB)

route:

Kernel IP routing table Destination Gateway Genmask

Flags Metric Ref Use Iface link-local *

255.255.0.0 U 303 0 0 wlan0 192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0

I work on embedded systems ,this linux and networking just makes me mad.

6
  • As you have not told us how you configured the Pi any answer is speculative. The problem is more likely to be configuration of Windows.
    – Milliways
    Commented Nov 20, 2016 at 22:34
  • @Milliways I used a opensource hotspot creator for windows. I checked and it was working fine with my mobile. Commented Nov 21, 2016 at 6:39
  • Ping following: <br> 1. gateway<br> 2. WAN interface of gateway <br> 3. gateway of gateway.<br> and tell us the result.
    – Sean83
    Commented Nov 21, 2016 at 7:19
  • @Sean83 I'm not sure which is the gateway in my system(windows). I tired looking up all the device ip in my system. I'm not able to find out what my ip is. I tend to get ip under wireless lan adapter, ppp adapter, and ethernet adapter. My pc is connected to the isp through pppoe and the created hotspot shares this connection over wifi. Which one should I ping Commented Nov 21, 2016 at 16:03
  • @Sean83 If I'm right this is my gateway itallic_PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data. 64 bytes from 192.168.0.1: icmp_seq=1 ttl=128 time=1.57 ms 64 bytes from 192.168.0.1: icmp_seq=2 ttl=128 time=1.25 ms 64 bytes from 192.168.0.1: icmp_seq=3 ttl=128 time=1.15 ms 64 bytes from 192.168.0.1: icmp_seq=4 ttl=128 time=1.14 ms ^X64 bytes from 192.168.0.1: icmp_seq=5 ttl=128 time=1.16 ms 64 bytes from 192.168.0.1: icmp_seq=6 ttl=128 time=1.19 ms 64 bytes from 192.168.0.1: icmp_seq=7 ttl=128 time=1.16 ms _italic Commented Nov 21, 2016 at 16:42

1 Answer 1

1

At minimum, you need to add a default gateway:

route add default gw <IP of gateway device>

The IP will be the IP address of the hotspot.

To resolve names to IP addresses, you'll need to add at least one DNS server:

echo "nameserver <IP of DNS server>" >> /etc/resolv.conf

The IP here will be that of your DNS server (quite possibly the same IP as the gateway above, but that's not certain as I don't know your network).

2
  • The default gateway and nameserver gets reset(deleted) after reboot. any workarounds? Commented Nov 21, 2016 at 17:39
  • Add dns-nameservers to /etc/network/interfaces, Ref. : wiki.debian.org/NetworkConfiguration
    – MatsK
    Commented Aug 8, 2017 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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