2

So, I've successfully set up a Raspberry Pi over SSH and have installed and configured Raspbian (2014-01-07-wheezy-raspbian) on it. I intend to keep this a headless system.

I'm currently travelling and don't have access to a router or a stable internet connection besides my phone's Wi-Fi hot spot feature. I don't have a USB Wi-Fi adapter for the Pi either. Thus, the only way I can connect my Pi to the internet would be via my laptop which is connected to the hot spot via Wi-Fi and to the Pi via an Ethernet cable.

After making all the physical connections, I have enabled ICS on the Wi-Fi network to share the connection over Ethernet. The IP for the LAN is set to be assigned automatically whereas I've set the Raspberry Pi's IP as static in the cmdline.txt file.

The following are the IPs of all the devices in question.

  • Windows Phone (192.168.137.1)
  • Laptop Wi-Fi (192.168.137.47)
  • Ethernet (169.254.88.195)
  • Raspberry Pi (169.254.88.200)

My laptop is able to ping both an internet server as well as the Pi whereas the Pi is not able to reach an internet server.

Any ideas? Networking is not really my strong suit so I would really appreciate some proper explanations and solutions, if possible.

On Windows

Windows IP Configuration

   Host Name . . . . . . . . . . . . : Sidhartha-NB
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Mixed
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : mshome.net

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Realtek PCIe FE Family Controller
   Physical Address. . . . . . . . . : F0-DE-F1-9D-1E-FC
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::b18f:4472:8367:58c3%15(Preferred)
   Autoconfiguration IPv4 Address. . : 169.254.88.195(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . :
   DHCPv6 IAID . . . . . . . . . . . : 418438897
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-9B-EA-C5-74-DE-2B-91-FE-D1

   DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%2
                                       fec0:0:0:ffff::2%2
                                       fec0:0:0:ffff::3%2
   NetBIOS over Tcpip. . . . . . . . : Enabled

Wireless LAN adapter Wireless Network Connection:

   Connection-specific DNS Suffix  . : mshome.net
   Description . . . . . . . . . . . : Atheros AR9285 Wireless Network Adapter
   Physical Address. . . . . . . . . : 74-DE-2B-91-FE-D1
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::3801:7d16:54af:653b%13(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.137.47(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : 25 February 2014 01:38:43
   Lease Expires . . . . . . . . . . : 04 March 2014 01:38:43
   Default Gateway . . . . . . . . . : 192.168.137.1
   DHCP Server . . . . . . . . . . . : 192.168.137.1
   DHCPv6 IAID . . . . . . . . . . . : 292871723
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-9B-EA-C5-74-DE-2B-91-FE-D1

   DNS Servers . . . . . . . . . . . : 192.168.137.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Ethernet adapter Bluetooth Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Bluetooth Device (Personal Area Network)
   Physical Address. . . . . . . . . : 60-D8-19-ED-78-4E
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{A627A3AA-3D22-4C8D-BE44-C8AB3B8CE420}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.mshome.net:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : mshome.net
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2001:0:9d38:6abd:14f4:11ca:3f57:76d0(Pref
erred)
   Link-local IPv6 Address . . . . . : fe80::14f4:11ca:3f57:76d0%14(Preferred)
   Default Gateway . . . . . . . . . : ::
   NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter isatap.{17C6D3A4-3281-4D06-BBCC-182D42C5F72A}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter 6TO4 Adapter:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft 6to4 Adapter
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Pinging 169.254.88.200 with 32 bytes of data:
Reply from 169.254.88.200: bytes=32 time=1ms TTL=64
Reply from 169.254.88.200: bytes=32 time<1ms TTL=64
Reply from 169.254.88.200: bytes=32 time<1ms TTL=64
Reply from 169.254.88.200: bytes=32 time<1ms TTL=64

Ping statistics for 169.254.88.200:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

On Raspberry Pi

pi@raspberrypi ~ $ cat /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

pi@raspberrypi ~ $ ping 8.8.8.8
connect: Network is unreachable

pi@raspberrypi ~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0

pi@raspberrypi ~ $ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether b8:27:eb:dc:e5:68 brd ff:ff:ff:ff:ff:ff
    inet 169.254.88.200/16 brd 169.254.255.255 scope global eth0
       valid_lft forever preferred_lft forever
4
  • DNS server entered? Gateway? Proper subnet mask? Commented Feb 24, 2014 at 17:53
  • I have no idea what to enter in either of those. All three except the Pi are assigned automatically. For the Pi, I don't know what to enter or how to, to make it work. Could you point me in the right direction?
    – Siddharth
    Commented Feb 24, 2014 at 20:03
  • Copy your /etc/network/interfaces file into your question. Also, ip addr on the pi, and ipconfig /all in Windows Commented Feb 24, 2014 at 20:05
  • Except the IP, which I've manually entered as mentioned above. If I do need to enter the rest for the Pi, how do I? Please elaborate.
    – Siddharth
    Commented Feb 24, 2014 at 20:05

2 Answers 2

1

There's too little information, but here's a guess... Not all the pertinent information is available to the Pi.

From the Pi, paste your /etc/network/interface file. In it, you should see a static IP address assigned to it, as well as the Subnet Mask, Default Gateway, Broadcast address, and the Network address. Below is an example from mine:

auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
        address 192.168.0.4
        netmask 255.255.255.0
        gateway 192.168.0.1
        broadcast 192.168.0.255
        network 192.168.0.0

To see what it's actually getting for an address, execute ip addr from the shell:

# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 1c:6f:65:c4:44:37 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.4/24 brd 192.168.0.255 scope global eth0

If that all lines up, then check your name lookup. If you can ping 8.8.8.8, but not ping www.google.com, it's likely your name servers are not registered properly. Edit your /etc/resolv.conf file to add in a DNS server to use for name lookups. For example:

# more resolv.conf
domain ca.shawcable.net
search ca.shawcable.net
nameserver 192.168.0.1

This will go to 192.168.0.1 if it doesn't know the hostname's IP address. If you can't even ping 8.8.8.8, then you have a routing issue. Check your default routes:

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

Make sure the destination of 0.0.0.0 has a Gateway of your default gateway; in this case, 169.254.88.195.

9
  • I just added all the details you requested. Could you please take a look?
    – Siddharth
    Commented Feb 24, 2014 at 20:23
  • Still missing the PING tests from your Pi, the route -n output, the ip addr output. Commented Feb 24, 2014 at 20:25
  • Added those too. How about now?
    – Siddharth
    Commented Feb 24, 2014 at 20:30
  • This would be much easier if you had a DHCP server running on your network. The issue is that your Pi doesn't have the routing information setup. That's past my knowledge, so I won't be able to help much more. Sorry Commented Feb 24, 2014 at 20:32
  • That's alright. Is there any way I can set up a DHCP server, considering this is a direct connection from the laptop to the Pi?
    – Siddharth
    Commented Feb 24, 2014 at 20:42
1

Since you are using the Windows Internet connection sharing (ICS) feature, here is how you can easily fix the internet connection.

  1. Instead of assigning a static IP to Pi, set it up to obtain IP address using DHCP.
  2. Restart your laptop and Pi. The Pi will now obtain an IP address from the built-in DHCP server of Windows and will have internet connection.
  3. You can find the IP address that has been assigned to Pi using the command "ping raspberrypi.mshome.net" assuming raspberrypi is the hostname of your Pi.
  4. You can use the IP address that is returned from Ping command to SSH or remote log into the Pi from your laptop.

Note that the ping raspberrypi.mshome.net command will work only when your Pi is connected through the Window ICS feature. If you want to find the IP address of Pi while it is connected to any network, you should be running Samba on the Pi. When you have Samba running, you can find the IP address using the command "ping raspberrypi"

Here is a detailed post about sharing laptop's internet connection with Pi http://carbonstone.blogspot.com/2014/02/connecting-to-pi-from-laptops-ethernet.html

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.