"Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, B.Sc., M.Sc., M.A., Ph.D., Sc.D.
I am trying to set this up on Ubuntu server 12.04 64bit to connect to a WPA2 secured network. Everything seems to work and I can connect to my SSID with the following command:
Output from iwconfig shows I'm connected to my network "Legendary"sudo wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext
bmather9@bmather9:~$ iwconfigas0t1 no wireless extensions.
lo no wireless extensions.
as0t0 no wireless extensions.
wlan0 IEEE 802.11g ESSID:"Legendary"
Mode:Managed Frequency:2.422 GHz Access Point: 00:21:29:67:7A:23
Bit Rate=300 Mb/s Tx-Power:32 dBm
RTS thr:2347 B Fragment thr:2346 B
Power Managementff
Link Quality:93/100 Signal level:-36 dBm Noise level:-96 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:32 Invalid misc:7814 Missed beacon:0
as0t3 no wireless extensions.
eth0 no wireless extensions.
as0t2 no wireless extensions.
Unfortunately I can't seem to get an IP address. I've tried using the dhclient command, but it just hangs and never gives me an IP. I don't think the router is the problem as every other device connects without problems to it.
Here is the output of ifconfig, you can see I don't get an IPv4 address for wlan0:
So what is my problem? I honestly don't know anything about network config in linux. I tried editing the /etc/network/interface file, but it didn't seem to do anything. I also tried to set a static IP address using this interface file, but nothing changed. Any help is greatly appreciated!bmather9@bmather9:~$ ifconfig
eth0 Link encap:Ethernet HWaddr b8:97:5a:06:d6:26
inet addr:192.168.9.10 Bcast:192.168.9.255 Mask:255.255.255.0
inet6 addr: fe80::ba97:5aff:fe06:d626/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4576 errors:0 dropped:0 overruns:0 frame:0
TX packets:10024 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:685917 (685.9 KB) TX bytes:1100580 (1.1 MB)
Interrupt:42 Base address:0xa000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:11310 errors:0 dropped:0 overruns:0 frame:0
TX packets:11310 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2375609 (2.3 MB) TX bytes:2375609 (2.3 MB)
wlan0 Link encap:Ethernet HWaddr 4c:60:de:ed:c0:99
inet6 addr: fe80::4e60:deff:feed:c099/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:232 errors:0 dropped:0 overruns:0 frame:0
TX packets:279 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:26216 (26.2 KB) TX bytes:41620 (41.6 KB)
bmather9@bmather9:~$
Aren't you using Network Manager? It ought to do all this for you and without the terminal command:Moreover, NM is designed to disallow an IP address for wireless if you have one for ethernet, which you do:sudo wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -DwextI suggest you detach the ethernet, click the NM icon and try to connect.eth0 Link encap:Ethernet HWaddr b8:97:5a:06:d6:26
inet addr:192.168.9.10 Bcast:192.168.9.255 Mask:255.255.255.0
inet6 addr: fe80::ba97:5aff:fe06:d626/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
"Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, B.Sc., M.Sc., M.A., Ph.D., Sc.D.
It's a headless server so the gui is not installed. Can I still use network manager? I'll try to round up a keyboard and monitor so I can try to configure with the ethernet unplugged; I've been doing everything over ssh so far.
Ahhh, a server. I suggest you amend /etc/network/interfaces to something like:Then get the system to see the change:Code:auto lo iface lo inet loopback #auto eth0 iface eth0 inet dhcp auto wlan0 iface wlan0 inet static address 192.168.0.87 netmask 255.255.255.0 gateway 192.168.0.1 wpa-ssid your_ssid wpa-psk your_password dns-nameservers 8.8.8.8 8.8.4.4Assuming there are no errors, I'd think you could safely detach the ethernet and ssh to the wlan0 address.Code:sudo ifdown wlan0 && sudo ifup -v wlan0
"Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, B.Sc., M.Sc., M.A., Ph.D., Sc.D.
I set my interfaces file as above then ran the command:# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo eth0
iface lo inet loopback
# The primary network interface
iface eth0 inet dhcp
post-up iptables-restore < /etc/iptables.up.rules
auto wlan0
iface wlan0 inet static
address 192.168.9.12
netmask 255.255.255.0
gateway 192.168.9.1
wpa-ssid Legendary
wpa-psk ********
dns-nameservers 8.8.8.8 8.8.4.4
Looks like I'm still connected to my network.bmather9@bmather9:~$ sudo ifdown wlan0 && sudo ifup -v wlan0ifdown: interface wlan0 not configured
Configuring interface wlan0=wlan0 (inet)
run-parts --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
wpa_supplicant: terminating wpa_supplicant daemon via pidfile /var/run/wpa_supplicant.wlan0.pid
Stopped /sbin/wpa_supplicant (pid 17663).
wpa_supplicant: removing /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
wpa_supplicant: wpa-driver nl80211,wext (default)
wpa_supplicant: /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -C /var/run/wpa_supplicant
Starting /sbin/wpa_supplicant...
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
wpa_supplicant: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
wpa_supplicant: ctrl_interface socket located at /var/run/wpa_supplicant/wlan0
wpa_supplicant: configuring network block -- 0
wpa_supplicant: wpa-ssid "Legendary" -- OK
wpa_supplicant: wpa-psk ***** -- OK
wpa_supplicant: enabling network block 0 -- OK
ip addr add 192.168.9.12/255.255.255.0 broadcast + dev wlan0 label wlan0
RTNETLINK answers: File exists
Failed to bring up wlan0.
Wlan0 doesn't show up in ifconfigbmather9@bmather9:~$ iwconfigas0t1 no wireless extensions.
lo no wireless extensions.
as0t0 no wireless extensions.
wlan0 IEEE 802.11g ESSID:"Legendary"
Mode:Managed Frequency:2.422 GHz Access Point: 00:21:29:67:7A:23
Bit Rate=300 Mb/s Tx-Power:32 dBm
RTS thr:2347 B Fragment thr:2346 B
Power Managementff
Link Quality:100/100 Signal level:-32 dBm Noise level:-96 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:34 Invalid misc:8439 Missed beacon:0
as0t3 no wireless extensions.
eth0 no wireless extensions.
as0t2 no wireless extensions.
bmather9@bmather9:~$ ifconfig
eth0 Link encap:Ethernet HWaddr b8:97:5a:06:d6:26
inet addr:192.168.9.10 Bcast:192.168.9.255 Mask:255.255.255.0
inet6 addr: fe80::ba97:5aff:fe06:d626/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6823 errors:0 dropped:0 overruns:0 frame:0
TX packets:4823 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4311957 (4.3 MB) TX bytes:1042762 (1.0 MB)
Interrupt:42 Base address:0xa000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2268 errors:0 dropped:0 overruns:0 frame:0
TX packets:2268 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:483319 (483.3 KB) TX bytes:483319 (483.3 KB)
What's next?
I am not yet sure it has much to do with the issue, but may we see:Code:Starting /sbin/wpa_supplicant... ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argumentAs always, please disguise the WPA key. Do verify, however, that it is correct in every respect and exactly matches that in the /etc/network/interfaces file.Code:cat /etc/wpa_supplicant.conf
"Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, B.Sc., M.Sc., M.A., Ph.D., Sc.D.
I originally had the psk in quotes and in hex, but have now changed it to normal ASCII characters still with quotes. Doesn't seem to affect anything either way when trying to bring up wlan0.bmather9@bmather9:~$ cat /etc/wpa_supplicant.conf
network={
ssid="Legendary"
psk="**********"
}
My original attempt shown below also gives invalid arguments:
bmather9@bmather9:~$ sudo wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
Last edited by bmather9; September 27th, 2013 at 04:20 AM.
What is here? It ought to be the key in clear text; that is, the exact key you put in the router. For example, if the key you put in the router's fill-in for the WPA key is ihatewarmbeer, then the interfaces file should be:# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo eth0
iface lo inet loopback
# The primary network interface
iface eth0 inet dhcp
post-up iptables-restore < /etc/iptables.up.rules
auto wlan0
iface wlan0 inet static
address 192.168.9.12
netmask 255.255.255.0
gateway 192.168.9.1
wpa-ssid Legendary
wpa-psk ********
dns-nameservers 8.8.8.8 8.8.4.4Is that what you have?# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo eth0
iface lo inet loopback
# The primary network interface
iface eth0 inet dhcp
post-up iptables-restore < /etc/iptables.up.rules
auto wlan0
iface wlan0 inet static
address 192.168.9.12
netmask 255.255.255.0
gateway 192.168.9.1
wpa-ssid Legendary
wpa-psk ihatewarmbeer
dns-nameservers 8.8.8.8 8.8.4.4
"Oh, Ubuntu, you are my favorite Linux-based operating system" --Dr. Sheldon Cooper, B.Sc., M.Sc., M.A., Ph.D., Sc.D.
Yea, I have the WPA password in plain text (not hex) in the interfaces file. I double and triple checked it now.
Bookmarks