Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have an ubuntu box set up to do some monitoring but due to the placement are unable to run CAT5 to the box itself. I have an Atheros PCI card that works great as long as someone is logged into Gnome and it doesn't disconnect from the AP during that time.

Is there a way to have Ubuntu connect to the AP during boot, and always reconnect if it finds a signal from a specified AP? The box would have a static IP and only connecting to a specific AP using WEP.

share|improve this question
    
The same question on SuperUser superuser.com/questions/16090/… –  Vanuan Jan 12 '11 at 8:26

5 Answers 5

up vote 4 down vote accepted

Depending on the physical security of the box, you could configure gdm to auto-login using an unprivileged user account that has access to the wireless device. Then Network Manager would handle all of the auto-reconnection issues.

This is configured under System | Administration | Login Window | Security

share|improve this answer
    
It's not my preferred action, but its what I ended up having to do. Network Manager still doesn't automatically reconnect for whatever reason, but it at least works at 'boot' now. –  dragonmantank Jun 10 '09 at 17:48

First, it's worth knowing that a default Ubuntu Desktop installation uses a piece of software named NetworkManager to manage the network.

The advantage of that is that it's very useful on laptops where you move around among different networks a lot, since it makes it very easy to find and connect to wireless networks.

The drawback is that it seems you must be logged in to get a network connection, and that's obviously less than optimal for a server.

Instead of running NetworkManager, the way to go is to configure your network settings in the file /etc/network/interfaces, a file which will be read at startup. I'm a bit uncertain on how to disable networkmanager, but I think it will detect that an interface has already been configured and stay away from it when you login.

Anyway, assuming that your network card is named ath0, you need to add something like the example below to /etc/network/interfaces:

auto ath0
iface ath0 inet static 
    address 10.20.30.40
    netmask 255.255.255.0
    gateway 10.20.30.1
    wireless-essid ESSID
    wireless-ap 00:60:1D:01:23:45
    wireless-key 0123-4567-89

It's been a while since I tested doing this, so the above is untested. The following manpages should be of help:

  • interfaces(5)
  • iwconfig(8)
  • wireless(7)
share|improve this answer

How can I make NetworkManager connect to a network before I login?

On version 0.7.1 or later edit the profile of the connection you with to start prior to login and select the box in the bottom left "Available to all users"

share|improve this answer

Use wpa_supplicant to manage your wifi connection.

You do not have to be using WPA for this. It will work with wep or even an open wireless network. When your AP is rebooted or looses power wpa_supplicant will start scanning for available APs and check if one of them matches the config file.

Have a look at this blog post on how to setup wpa_supplicant.

share|improve this answer

Sure, you should be able to place the appropriate iwconfig and ifconfig commands in /etc/init.d/rc.local though that's not the "Ubuntu way".

share|improve this answer
    
That doesn't help if card disassociates or the AP is rebooted, the server would still require manual reconnection. –  dragonmantank Jun 3 '09 at 15:41

Your Answer

 
discard

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.