I'm trying to get rpi to connect to the Internet via wifi (wlan0) - it will connect to a mobile hotspot. It also has to have wired connection (eth0) to a router that is not connected to the Internet.

My desktop PC is also connected to the router. I'm doing this so that I can access a web application running on rpi from my desktop pc, while rpi has its own wifi connection to the Internet.

I understand that this is a bit strange, but this is the only way that I can run local web applications in my office without hopefully breaking any security policies.

I've followed the instructions on this post. My rpi can only ping www.google.com but not my router

I've been tinkering around for over two hours now but I still can't have it so that rpi will respond when I ping from my desktop pc, and at the same time google will respond when I ping www.google.com from rpi.

I'd really appreciate it if someone could give me a hand on this...

  • does this work from the Pi - ping -I eth0 ? <-- that is a capital i and not a lowercase l before eth0...What IP address does eth0 have ?
    – Lawrence
    Commented Sep 26, 2013 at 5:45
  • 1
    Welcome to Raspberry Pi Stack Exchange! Please don't add "thanks" to your question. Upvote answers you like, this is the Raspberry Pi Stack Exchange way of saying thank you.
    – Piotr Kula
    Commented Sep 26, 2013 at 8:38
  • What does netstat -r show? Commented Sep 26, 2013 at 13:40
  • 3
    @Lawrence: I still get "Destination Host Unreachable" message when I ping the router. All the configuration settings are exactly the same as described on this post (except for ssid and pass of course): (raspberrypi.stackexchange.com/questions/8851/…)
    – Ji Park
    Commented Sep 27, 2013 at 4:25
  • 1
    @Lawrence: dang it... this is very embarrassing... the ethernet cable was disconnected this whole time! so it's working now. Thank you for taking a look into this!
    – Ji Park
    Commented Sep 28, 2013 at 5:16

1 Answer 1


Using the USB Wi-fi adapter, I was able to connect RPi to the Internet via a mobile hotspot. It has a wired connection to a router as well. Also, I have a PC connected to the router, which means I can access web applications running on RPi. Please note that just as described in the original post, I was able to accomplish this by following the instructions on this post. Here are the configuration settings that I have on my RPi:

pi@raspberrypi ~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
pairwise=CCMP TKIP

pi@raspberrypi ~ $ sudo cat /etc/network/interfaces

auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet static
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

pi@raspberrypi ~ $ sudo cat /etc/default/ifplugd

ARGS="-q -f -u0 -d10 -w -I"

pi@raspberrypi ~ $ sudo cat /etc/rc.local

#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
sudo ifplugd eth0 --kill
sudo ifup wlan0
exit 0

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.