8

Connecting to the wireless is relatively simple.

After some struggle, you have wifi in your installer. You can install Ubuntu Server and everything is alright. You are ready to boot your new system.

After setup finished, wifi settings disappeared.

tl;dr: How do I connect to a wireless (WPA2 Personal) network from Ubuntu Server 12.10?

What I have tried so far:

Connected with iw* commands. Obtained IP address with dhclient. Put these commands to etc/rc.local.

On boot, the server waits 120 seconds with message "Waiting for network to come up"

To fix this, I removed everything /etc/network/interfaces (wpa-psk and wpa-ssid).
This did not work. It was still waiting. I found an answer, which said I could just remove the /etc/... (the file that was in charge of the 120 second wait time.)

I did that, and kept a backup of it. Now the server waits ~3 seconds (modified sleep within the file) and boots up. However, there's no network connection available. It's some dhcp error.

As I was out of options, I tried using the one in comment. The one that used "tee".
Turns out it does not work either.

How can this whole thing be so inconsistent? How can they not install the firmwares on the ISO while it would perfectly fit (673+~10MB = 683). How can the installer NOT copy the necessary files and set up the connection to be used later? (Or ask if the user wants to use it.)

Olli
  • 9,129
Apache
  • 5,102

3 Answers3

12

1) Install the package wpasupplicant.

2) Then write:

sudo su
wpa_passphrase [SSID] >> /etc/wpa_supplicant.conf
exit

Where [SSID] is SSID of point where you want to connect. After entering this command, you have to write password for that acces point.

3) Run wpa_suplicant with new config file.

sudo wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf

Make sure that your interface is wlan0, or change it if needed!

-B is for background running.

-D is used driver.

-i is interface.

4) You should be connected now :)

NGRhodes
  • 9,680
HELU
  • 326
6

I used instructions from https://wiki.debian.org/WiFi/HowToUse#WPA-PSK_and_WPA2-PSK.

Don't forget to remove anything you added in etc/rc.local as it could conflict

First, make sure you have installed (can't remember if its installed by default or not) the package "wpasupplicant"

Then you need to edit the "/etc/network/interfaces" file.

The stanza used was based on the example from the above link (reproduced below):

auto wlan0
iface wlan0 inet dhcp
    wpa-ssid mynetworkname
    wpa-psk mysecretpassphrase

You will need to check which interface your Wifi card is (its usually wlan0) and you need the key and ssid of your wireless network.

NGRhodes
  • 9,680
1

Here are my notes for connecting to an

Android portable hotspot

/etc/network/interfaces

iface wlan1 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant_android.conf

/etc/wpa_supplicant/wpa_supplicant_android.conf

network={
    ssid="AndroidAP"
    psk="password"
}

Notes

  • use $ ifup wlan1 to bring the interface up. Insert 'auto wlan1' in the line before 'iface wlan1 inet dhcp' to have linux automatically bring up the interface
  • $ip link is a useful bash command to identify the wireless identifier (wlan*).

iPad/MAC personal hotspot/wifi

/etc/network/interfaces

iface wlan1 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant_ipad.conf

/etc/wpa_supplicant/wpa_supplicant_ipad.conf

network={
    ssid="Hamish’s iPad"
    psk="myPassword"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP
    auth_alg=OPEN
}

Notes

  • Beware the "’" character, it is not the same as "'"
  • Unlike with the Android network, wpa supplicant requires additional paparameters to connect to the MAC based wifi...
hamish
  • 171