Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been testing a Wifi card in my machine and I can't seem to get it to connect to my home router. The card is a ralink rt37, I compiled the modules that I needed into the kernel and downloaded a firmware file, I can now see the card using ifconfig -a. I can also bring the card up using ip link wlan1 up. Then when the device is up, if I run iw dev wlan1 scan I can see the SSID of my home router.

Now it seems the card is functional I want to connect to my router. The router is secured with WPA, so I need to use wpa_supplicant (as far as I understand). I tried following this tutorial to get set up.

I have followed their steps and have the following files:

  • /etc/wpa_supplicant.conf:

    proto=WPA RSN
    pairwise=CCMP TKIP
    group=CCMP TKIP
  • /etc/network/interfaces:

    # Configure Loopback
    auto lo
    iface lo inet loopback
    auto eth0
    iface eth0 inet static 
    auto wlan1
    iface wlan1 inet static
    pre-up wpa_supplicant -Dwext -iwlan1 -c/etc/wpa_supplicant.conf
    post-down killall -q wpa_supplicant

I can then run the command wpa_supplicant -Dwext -iwlan1 -c/etc/wpa_supplicant.conf & and then run ip dev wlan1 link and I see the following output:

    Connected to 4c:17:eb:a1:83:c7 (on wlan1)
freq: 2462
RX: 295890 bytes (1942 packets)
TX: 53549 bytes (1379 packets)
signal: -82 dBm
tx bitrate: 36.0 MBit/s 

It seems that I'm past the authentication stage but I don't have a connection, there's no IP assigned to wlan1, and when I try ping I get a message saying network unreachable.

If I run route I see this:

    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     *        U     0      0        0 eth0

My suspicion is that I've not set the interface file up properly, in particular the gateway line. If anyone can give me any help I'd be really grateful. Sorry for the long post, just wanted to give as much of the relevant info as possible

share|improve this question
Why aren't using using NetworkManager? – slm Aug 12 '13 at 22:32
This is in an embedded environment with an OS I have compiled myself. – Kells1986 Aug 13 '13 at 12:16
You can use NetworkManager still in a headless environment, it provides a command line tools, nm-cli and nm-tool for headless systems. – slm Aug 13 '13 at 12:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.