Using Wifi on Ubuntu Server with auto connect on boot

Hi all,

during the setup of my small server, I had the need to use only Wifi network connection instead of the „standard“ LAN connection.

Using Wifi was possible during installation, but after the first boot after the installation process I was not able to connect to the internet from the server or connect to the server from another workstation. In other words: network connection was not working.

After several tries with installation of GUI (apt-get install xubuntu-desktop) and several Network manager ( network-manager, wicd –> very good tool) I found the solution. It seems that network manager are only working for a user. That means the user has to login to use that tools. But a server should connect directly on boot / startup. To get rid of that problem, I used the /etc/network/interfaces config file. I set the wlan0 connection to type „auto“ and I set the parameters for the WIFI ssid and password:

# 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
iface lo inet loopback

# The primary network interface
auto wlan0
iface wlan0 inet dhcp
wpa-ssid <MyWifiName>
wpa-psk <MyWPA_Password>
# This is an autoconfigured IPv6 interface
iface eth0 inet6 auto

You can try your settings with the ifup wlan0 and ifdown wlan0 commands.
ifup starts the wlan0 interface, ifdown stops it. You need to be root for those commands.

After your settings are correct, you can restart your server. The server should now automatically connect to your Wifi network on startup. You can also check the logs in:


See also: