3

This is driving me crazy. I can't seem to get a static IP address configured on my WiFi interface (wlan0). I know that my wpa_supplicant.conf is correct because this same exact file works perfectly when I select dhcp instead of static on the iface statement.

The interface associates with my access point, but I get the error network settings not defined for default in /etc/network/interfaces in my syslog output (posted below).

/etc/network/interfaces

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet static
    network 192.168.1.32
    netmask 255.255.255.0
    gateway 192.168.1.254
    dns-nameservers 192.168.1.254
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

syslog

May 21 17:06:04 raspberrypi wpa_supplicant[14738]: wlan0: Trying to associate with **:**:**:**:**:** (SSID='******' freq=2462 MHz)
May 21 17:06:04 raspberrypi wpa_supplicant[14738]: wlan0: Association request to the driver failed
May 21 17:06:04 raspberrypi wpa_supplicant[14738]: wlan0: CTRL-EVENT-DISCONNECTED bssid=**:**:**:**:**:** reason=0
May 21 17:06:04 raspberrypi wpa_action: WPA_IFACE=wlan0 WPA_ACTION=DISCONNECTED
May 21 17:06:04 raspberrypi wpa_action: WPA_ID=0 WPA_ID_STR= WPA_CTRL_DIR=/var/run/wpa_supplicant
May 21 17:06:04 raspberrypi wpa_action: ifdown wlan0
May 21 17:06:05 raspberrypi wpa_supplicant[14738]: wlan0: Trying to associate with **:**:**:**:**:** (SSID='******' freq=2462 MHz)
May 21 17:06:05 raspberrypi wpa_supplicant[14738]: wlan0: Association request to the driver failed
May 21 17:06:05 raspberrypi wpa_supplicant[14738]: wlan0: Associated with 00:00:00:00:00:00
May 21 17:06:05 raspberrypi wpa_supplicant[14738]: wlan0: CTRL-EVENT-DISCONNECTED bssid=**:**:**:**:**:** reason=0
May 21 17:06:05 raspberrypi wpa_supplicant[14738]: wlan0: Associated with **:**:**:**:**:**
May 21 17:06:05 raspberrypi wpa_action: removing sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
May 21 17:06:06 raspberrypi wpa_supplicant[14738]: wlan0: WPA: Key negotiation completed with **:**:**:**:**:** [PTK=CCMP GTK=TKIP]
May 21 17:06:06 raspberrypi wpa_supplicant[14738]: wlan0: CTRL-EVENT-CONNECTED - Connection to **:**:**:**:**:** completed (reauth) [id=0 id_str=]
May 21 17:06:06 raspberrypi wpa_action: WPA_IFACE=wlan0 WPA_ACTION=CONNECTED
May 21 17:06:06 raspberrypi wpa_action: WPA_ID=0 WPA_ID_STR= WPA_CTRL_DIR=/var/run/wpa_supplicant
May 21 17:06:06 raspberrypi wpa_action: network settings not defined for default in /etc/network/interfaces
May 21 17:06:06 raspberrypi wpa_action: ifup wlan0=default
May 21 17:06:06 raspberrypi wpa_action: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
May 21 17:06:06 raspberrypi wpa_action: bssid=**:**:**:**:**:**
May 21 17:06:06 raspberrypi wpa_action: ssid=******
May 21 17:06:06 raspberrypi wpa_action: id=0
May 21 17:06:06 raspberrypi wpa_action: mode=station
May 21 17:06:06 raspberrypi wpa_action: pairwise_cipher=CCMP
May 21 17:06:06 raspberrypi wpa_action: group_cipher=TKIP
May 21 17:06:06 raspberrypi wpa_action: key_mgmt=WPA2-PSK
May 21 17:06:06 raspberrypi wpa_action: wpa_state=COMPLETED
May 21 17:06:06 raspberrypi wpa_action: address=**:**:**:**:**:**
May 21 17:06:07 raspberrypi wpa_supplicant[14738]: wlan0: WPA: Group rekeying completed with 00:26:50:15:31:19 [GTK=TKIP]
May 21 17:06:08 raspberrypi wpa_supplicant[14738]: wlan0: WPA: Group rekeying completed with 00:26:50:15:31:19 [GTK=TKIP]

What am I missing?

4

It doesn't look like you've actually defined an address in your /etc/network/interfaces. Try:

iface wlan0 inet static
    address 192.168.1.xxx
    netmask 255.255.255.0
    gateway 192.168.1.254
    dns-nameservers 192.168.1.254
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

See the Debian wiki article on network configuration for more details.

1

In addition to tapped-out's answer, the network statement you have supplied is incorrect. Either leave the network statement out altogether, or use the actual network address (in this example it would be 192.168.1.0)

  • Yes, my mistake was that I never intended to have a network statement. I meant to say address 192.168.1.32, but put network instead. – HeatfanJohn Oct 10 '13 at 1:28
0

Where I just able to comment instead of answer submit...

ncdownpat & Hurgh both have answered your question well, however, the dns-nameservers line is also un-nessisary for inital connection setup; often I'll leave it off and have no issues connecting.

Here's the link where I've gone to great detail already answering a similar question on StackExchange. Note I don't make use of the dns setting and I've also set the iface for wlan0 to manual and then made a virtual iface with the same name as what is set for the wpa_supplicant's id_str allowing for more than one access point to be added later. A single static IP was a bit boring so I've provided how to setup more than one internal static IP through the use of post-up & pre-down commands within the interfaces file. The bigest issue I've had with RPi's WiFi networking is that it'll die and not recover; so a scripted work around was also provided.

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.