Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

How do I set my computer to have a static IP in Ubuntu 11.04? The only two lines in /etc/network/interfaces are:

auto lo
iface lo inet loopback

I think usually when people do this they have a wired connection and just edit the eth0 settings, however I'm using a wireless adapter.

share|improve this question
up vote 2 down vote accepted

You can use Network Manager with a static IP address.

If you want a system-wide setting, you can use /etc/network/interfaces for a wireless adapter. The only difference with a wired adapter is that you'll need extra settings for the encryption (unless your wifi network is unencrypted).

For WPA (any supported variant), use wpa-supplicant Install wpasupplicant.

auto wlan0
iface wlan0 inet static
    wpa-ssid chez-jackson
    wpa-psk swordfish

The wpa- parameters are those you could put in a block in wpa_supplicant.conf, with wpa- prefixed.

For WEP, the wireless-tools Install wpasupplicant package has all you need. Instead of the wpa- settings, put wireless- settings, e.g.

    wireless-essid chez-jackson
    wireless-key 0123456789abcdef
share|improve this answer
Great answer, thanks. – Jackson Jul 10 '11 at 21:59

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.