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

Linux distributions these days come with NetworkManager to allow a user to configure a WiFi network adapter. However I can't seem to figure out how to configure a system-wide network adapter. There seems to be some suggestion that NetworkManager can use some source of data other than the user clicking to get things like WPA passphrases and such, but I can't find even a single rumour of a document explaining how to do this.

I am using Fedora 10 but frankly would consider switching to any distro to get this working in a nice, supported way that doesn't involve me hacking up some network config script that I stick into rc.local. I want the most generic solution possible.

How do I set up a system-wide WiFi network card so that it connects on boot and stays connected?

share|improve this question

7 Answers 7

I think you should be looking at iwconfig and wpa_supplicant. You should be able to use those appropriately within /etc/network/interfaces (on ubuntu or debian at least) to do said config.

Some googling for 'system wide wireless network config' turns up that "Fedora 10 still provides the older system-config-network tools for easy system-wide configuration and activation of your network interfaces" .

share|improve this answer
    
yes, I know about iwconfig and wpa_supplicant, but how do those integrate with the distro's boot process to enable the card? –  Mr. Shiny and New 安宇 May 1 '09 at 13:07
    
system-config-network doesn't support Wifi properly as far as I can tell. –  Mr. Shiny and New 安宇 May 1 '09 at 13:31

You can still use NetworkManager!

Set up your wireless using NetworkManager. Then right-click the NetworkManager applet, choose "Edit Connections...", find your wireless connection under the Wireless tab, choose "Edit", and select the "Available to all users" checkbox. Once your settings have been saved, NetworkManager should bring the connection up on boot without anyone logging in - I tested by switching to a VT before logging in with X, and ifconfig(8) showed an IP address.

(This is on Ubuntu 9.04, which uses NetworkManager 0.7.1.)

share|improve this answer
    
This doesn't work on Fedora 10 or 11 by default because NetworkManager is installed incorrectly for some reason. –  Mr. Shiny and New 安宇 Nov 26 '09 at 15:07

Assuming that wlan0 is the name for your wireless interface, you can try creating a configuration file /etc/sysconfig/network-scrpits/ifcfg-wlan0 using the following template.

DEVICE=wlan0
BOOTPROTO=dhcp
ONBOOT=yes
MODE=Managed
ESSID="essid_name"
RATE="auto"
KEY=*********************

Do a reboot or a /etc/init.d/network restart after creating the file. The interface should come up automatically and stay up irrespective of whether you are logged in or not.

If you do not use DHCP and want to manually specify IP details you can add the following properties to the config file above.

IPADDR=x.x.x.x
NETMASK=x.x.x.x
NETWORK=x.x.x.x
BROADCAST=x.x.x.x
share|improve this answer

You want to install NetworkManager and the various GUIs. This will allow you to easily manage your network when logged into X, However, you should also be able to configure your wireless networks by using system-config-network Using these two items, I have successfully and painlessly connected to wifi networks.

share|improve this answer
1  
The network Manager guis require a user to log in. In Fedora 10 I can't seem to find any way to make a Wifi connection that is available on boot. The system-config-network does not seem to work with Wifi cards. When I set one up this way it never connects. When I invoke wpa_supplicant it connects but doesn't get an IP address. I have to manually invoke dhcpclient. It seems there is something missing. –  Mr. Shiny and New 安宇 May 1 '09 at 18:04

This will work for any distro:

  • Make sure your kernel is compiled with the appropriate modules
  • Configure your wireless card on the command line while writing down all the steps
  • put the steps in a shell script
  • Put the shell script in the init scripts or the last script that gets started of your OS (for gentoo for example this is: /etc/conf.d/local.start, I'm sure figuring out where this is for debian/ubuntu/fedora/whatnot won't be hard)

While this is not very clean, it works. After this you can finetune the script so it supports the start/stop commands of a real service.

share|improve this answer
    
Yeah, I was hoping to avoid this kind of configuration. The reason is that there are other features typically put into the main networking system, such as reconnecting the network when it goes down,etc. I don't want to have to reinvent that stuff myself :( –  Mr. Shiny and New 安宇 May 1 '09 at 19:41
1  
wpa_supplicant + dhcpcd will do this automaticly for you. If it's just the wireless setup, this combination will do just fine. –  Gert M May 1 '09 at 20:26

Like StackKrish mentioned, try a /etc/sysconfig/network-scripts/ file. That should be automatically launched by init on boot.

If you're going to be using NetworkManager, I highly recommend finding a 0.7.x version, because I've had no end of problems on 0.6. Crashes, inability to connect to WPA networks despite supporting them, and random disconnects.

share|improve this answer
up vote 0 down vote accepted

I finally solved my problem. I suppose it was a Fedora problem all along but Fedora was not letting me edit system connections in NetworkManager. I changed NetworkManager's configuration so that it used its native connection information backend and edited the policy to allow my user account to edit the connection information; once I did that the "available to all users" checkbox finally started working.

Thanks to all those who answered.

share|improve this answer

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.