0

I have a Wifi adapter for the Raspberry Pi that I want to use to get access to the Wifi network.

I have done all the steps from this tutorial, using Wicd-curses, the wifi network was detected and I have selected a static ip and entered the following

IP Address: 192.168.1.3
Subnet Mask: 255.255.255.0 
Gateway: 192.168.1.1

and now, doing ifconfig wlan0 shows me that my IP is 169.254.59.150 (it's different than 192.168.1.3).

I was able to connect to the network correctly from the Raspbian Desktop but I can't connect to any page in the browser. And running:

 sudo apt-get update
 cannot fetch @adress No adress associated with hostname

when trying to connect via ssh:

ssh pi@192.168.1.3 
ssh: connect to host 192.168.1.3 port 22: No route to host  :arrow: 
ssh pi@169.254.59.150 
ssh: connect to host 169.254.59.150 port 22: Connection timed out

when trying with the ping command:

ping 127.0.0.1

all packets transmitted has been received 0% packet loss with:

ping 168.254.89.0

I get Destination host unreachable with:

ping 192.168.1.0

connect: network unreachable

    sudo ifconfig
    eth0      Link encap:Ethernet  HWaddr b8:27:eb:ed:6c:fe  
          inet addr:10.42.0.12  Bcast:10.42.0.255  Mask:255.255.255.0
          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
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:160 errors:0 dropped:0 overruns:0 frame:0
          TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:12960 (12.6 KiB)  TX bytes:12960 (12.6 KiB)

wlan0     Link encap:Ethernet  HWaddr 04:8d:38:31:af:bf  
          inet addr:169.254.89.150  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:3 overruns:0 frame:0
          TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:9830 (9.5 KiB)

sudo iwconfig
wlan0     IEEE 802.11bg  ESSID:"COMPANY"  Nickname:"<WIFI@REALTEK>"
      Mode:Managed  Frequency:2.412 GHz  Access Point: 14:B9:68:E4:62:68   
      Bit Rate:54 Mb/s   Sensitivity:0/0  
      Retry:off   RTS thr:off   Fragment thr:off
      Encryption key:****-****-****-****-****-0000-00   Security mode:open
      Power Management:off
      Link Quality=100/100  Signal level=62/100  Noise level=0/100
      Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
      Tx excessive retries:0  Invalid misc:0   Missed beacon:0

  sudo route 
    Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.42.0.1       0.0.0.0         UG    0      0        0 eth0
10.42.0.0       *               255.255.255.0   U     0      0        0 eth0
link-local      *               255.255.0.0     U     303    0        0 wlan0

the file /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet static
address 10.42.0.12
netmask 255.255.255.0
network 10.42.0.0
broadcast 10.42.0.255
gateway 10.42.0.1

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

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

Any help will be appreciated , thanks :)

  • Could you cut&paste the output of sudo ifconfig, and sudo iwconfig, and sudo route, and add that information to your question? – joan Aug 20 '15 at 14:32
  • @joan please see the updated question , but what do you mean by sudo root it's output command not found – The Beast Aug 20 '15 at 15:13
  • I meant sudo route (not root). route gives the IP routing table. It's probably irrlelevant. – joan Aug 20 '15 at 15:20
  • You might one to replace any sensitive inormation with * (e.g. the encryption key). – joan Aug 20 '15 at 15:21
  • Unplug the ethernet cable, reboot - then try again to configure the wifi. – ifermon Aug 20 '15 at 15:40
1

Make sure to boot the Pi with the usb dongle attached.

Edit /etc/network/interfaces and add the following to the bottom:

iface wlan0 inet dhcp
        wpa-ssid "your network name"
        wpa-psk "your password"

If you want to give it a static ip then just do:

    iface wlan0 inet static
        address 192.168.0.XX          #static ip address
        netmask 255.255.255.0
        gateway 192.168.0.XX          #must match your router address
        wpa-ssid "your network name"
        wpa-psk "your password"

EDIT: Without knowing your network type, etc., they most simple method is to use the GUI.

On fresh boot go to gui desktop using startx

Then open (should be on the desktop) Wifi Config

Hit scan

Connect to your network

EDIT 2: Assuming WPA2 network:

Edit /etc/wpa_supplicant/wpa_supplicant.conf

And add

network={
    ssid="your network name"
    psk="your password"
}
  • I tried this but when rebooting i could not have an adress with ifconfig wlan0 and i get those 2 failure in boot up 'not running dhcpcd because /etc/network/interfaces failed' and 'not running interfaces that will use a dhcp client' – The Beast Aug 20 '15 at 16:35
  • Please see edit @Frankenstein – D-W Aug 20 '15 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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