0

I'm new to Raspberry Pi, and went through the setup instructions, which were painless. I installed the wireless nano USB dongle and followed these instructions to set it up.

Almost immediately I saw an IP attached to wlan0, so I unplugged the ethernet cable, and sure enough, I was able to SSH into the Pi on the wireless IP. However, it seems when only using the wireless, it can access no WAN IPs. Pinging google.com or 8.8.8.8 returns the error connect: Network is unreachable. I have several other wireless machines (mostly Ubuntu) on the network, and they have no issues connecting to the Internet.

What's wrong? It is working to some extend, because it can connect to my router and allow me to SSH into it. I doesn't seem like a DNS issue, because I can't even ping IPs.

Also, when the ethernet cable is connected, the wireless loses its IP and becomes inaccessible. Is there anyway to make the wired and wireless connections work at the same time?

This forum post suggests it may be a bug in Debian that causes the route to not be set on wlan0. How do you configure wlan0 to automatically have the correct route setup without having to reboot each time the ethernet cable gets plugged/unplugged?

Cerin
  • 2,211
  • 7
  • 30
  • 49
  • There is nothing wrong with the post you quoted, but the EASIEST is to boot to the GUI and let the wireless wizard set it up for you. – Milliways Apr 20 '15 at 00:54
  • @Milliways, will the wizard set wireless up in a way that it will dynamically switch between wifi and wired depending on which is available? – Cerin Apr 20 '15 at 01:33

6 Answers6

1

Milliways is right. Boot to the desktop gui and let your network manager do the switching for you. You most likely have Network Manager or Wicd as you wireless device manager. The software typically switches from ethernet to wireless when the network cable is unplugged: unplugged-wireless, plugged-ethernet. Hope that helps

sam coleman
  • 175
  • 4
  • Network Manager is not installed by default in Raspbian. I did install it, but I was not able to get it to work. – Cerin Apr 20 '15 at 12:43
1

This applies to Raspbian Wheezy prior to 2015-05-05 for later (and Jessie) See How do I set up networking/WiFi/Static IP

You should not need any additional software to make WiFi work.

The following link shows 3 ways of setting up WiFi, http://www.raspberrypi.org/documentation/configuration/wireless/README.md

Te easiest is to set up using GUI, but if you follow the detailed instructions you can do via the command line.

When the ethernet cable is connected, wpa-roam causes the wireless to becomes inactive. This is normal behaviour.

It is possible to make the wired and wireless connections work at the same time, but unless you have some special reason to do so creates routing problems. This is an advanced issue.

PS These instructions assume you haven't already destroyed the default settings in /etc/network/interfaces which should be something like

auto lo

iface lo inet loopback
iface eth0 inet dhcp

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

iface default inet dhcp
Milliways
  • 54,718
  • 26
  • 92
  • 182
1

This eventually resolved itself. I installed Ubuntu 16.04, upgraded the firmware using the standard rpi_update tool, and then did a hard power-down reboot, and wireless worked.

Cerin
  • 2,211
  • 7
  • 30
  • 49
0

That page shows how to connect to a WPA wireless network but doesn't have details about configuring the interface. It may simply be an incomplete configuration on your wireless interface.

What do you have in /etc/network/interfaces? What shows in /etc/resolv.conf?

bobstro
  • 3,978
  • 12
  • 27
0

I found an answer that works for my RPi3. I just bought it and was not able to connect to the school WiFi, which later I found out is WPA2 Enterprise wireless network. Here I linked the solution to this website (Professor Unver made a minor mistake and I posted the code he intended).

Under sudo nano /etc/wpa_supplicant/wpa_supplicant.conf, you enter/edit the code:

network={

ssid="ssid"

scan_ssid=1

key_mgmt=WPA-EAP

group=CCMP TKIP

eap=PEAP

identity="username"

password="password"

phase1="peapver=0"

phase2="MSCHAPV2"
}

Under sudo nano /etc/network/interfaces, you edit/enter the code:

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0 inet dhcp
     pre-up wpa_supplicant -B -Dwext -I wlan0
-c /etc/wpa_supplicant/wpa_supplicant
     post-down killall -q wpa_supplicant

Let me know how it works for you guys :)

Greenonline
  • 2,448
  • 4
  • 18
  • 33
0

I've had the same problem in the past while working on my Raspberry pi 3 model B.

While setting up the static IP address in the cmdline.txt file in the boot directory, I accidentally removed something.

I reinstalled the OS and never faced anything like that ever since. :)

Manav
  • 117
  • 3