Wireless networking with CentOS

15,723

When you edit the wireless settings you need to make sure that "Available to all users" and "Connect automatically" checkboxes are enabled and it will be available to everyone automatically. Early versions of Network Manager for some systems did not have "Available to all users" enabled by default (yours might be one of those systems) and the symptoms you describe are exactly the behavior that is supposed to happen with configuration setting. That was a confusing default setting for most people, so now the default is to have it enabled (at least it is for Ubuntu).

enter image description here

You can also check from the command line what devices and connections are managed by NetworkManager:

$ nmcli dev
DEVICE     TYPE              STATE        
wlan1      802-11-wireless   connected    
eth1       802-3-ethernet    connected    
$ nmcli con
NAME                      UUID                                   TYPE              TIMESTAMP-REAL                    
Yak n Yeti                b4e05828-e57e-4399-96aa-6cd988ee4975   802-11-wireless   Thu 27 Dec 2012 07:30:19 AM PST   

The settings are stored in /etc/NetworkManager/system-connections/ and you'll want to make sure that autoconnect=true and that either the users you want are listed permissions=user:whoever:root:; or the equivalent of "Available to all users" which is permissions=[];

[connection]
id=Yak n Yeti
uuid=b4e05828-e57e-4399-96aa-6cd988ee4975
type=802-11-wireless
permissions=user:whoever:;
autoconnect=false
timestamp=1355439451

[802-11-wireless]
ssid=Yak n Yeti
mode=infrastructure
mac-address=24:77:05:FF:97:BC
security=802-11-wireless-security

[802-11-wireless-security]
key-mgmt=wpa-psk
wep-key-flags=1
psk-flags=1
leap-password-flags=1

[ipv4]
method=auto

[ipv6]
method=auto
Share:
15,723

Related videos on Youtube

user134706
Author by

user134706

###Actively looking for freelance work ###About Me: I'm a professional software developer and have spent my time building provisioning and web based self-service systems for IIS, Apache and Citrix XenServer, amongst other things. My Curriculum Vitae can be viewed on Stack Overflow Careers (might be a bit out of date). Stuff I like to listen to at last.fm You can get in touch here: kevin.e.kenny #@# gmail.com (you know what to do with the # and spaces). No Survey Emails Please. Also not ashamed to admit I like trains, mostly diesels, late Era 8 (BR Sectorisation) and Era 9 onwards :) I'm also interested in signalling if anyone from Network Rail is looking this far down ;)

Updated on September 18, 2022

Comments

  • user134706
    user134706 almost 2 years

    I'm running CentOS 5.7 x86 on my Vostro 1700 laptop which has an Intel Pro Wireless WiFi NIC (Intel Pro Wireless 3945 [iwl3945]).

    I'm a bit confused about how my Wireless connection (wlan0) is being managed and where the configuration is being stored.

    I initially configured wlan0 via Gnome's Wireless Device Configuration application (System -> Network):

    enter image description here

    I configured a static IP address if 172.16.3.22 and so on:

    enter image description here

    I then configured the Wireless Settings to set my SSID etc:

    enter image description here

    Having done that I then restarted the interface with:

    ifdown wlan0
    ifup wlan0
    

    So far so good and ifconfig reported that the interface was up.

    However when I tried to ping anything on my network the ping failed. It was then I noticed that the Wireless Configuration page didn't ask me about the Wireless security type I was running (WPA2-PSK) - the only options were None, Open system (open) or Shared key (restricted) so it seemed that I wasn't authenticating to my WiFi AP.

    I then found another network configuration tool called "Network Connections" under System -> Preferences -> More Preferences. Using this tool I had to add a new connection and it allowed me to configure my Wireless NIC and specify the security type:

    enter image description here

    I also configured a different IP address of 172.16.3.23 mostly out of curiosity to see if this GUI was configuring the same settings as the previous dialogues and saving these values in /etc/sysconfig/network-scripts/ifcfg-wlan0. However this seems to be a completely different configuration system from what I'm familiar with because ifcfg-wlan0 appears not to be used to save the above config.

    To cut a long story short I also had a Google around and discovered that I also needed to start the NetworkManager daemon which adds an icon to Gnome to allow me to enable and disable Networking, Wireless and permits me to choose which AP to connect to etc.

    So I'm now somewhat confused as to how my WiFi network is actually configured and where these settings are really stored.

    I also notice that when I quit Gnome and drop back to console mode my wireless connection is disconnected wlan0 loses its IP address and appears to be no longer connected.

    Whilst I'm very happy I can connect to my WiFi network (by starting Gnome), I'm not happy that I don't understand what's happening under the bonnet.

    Can someone explain what is happening with all these different settings?

    Also how do I start my wireless connection before starting Gnome?

  • Amitav Pajni
    Amitav Pajni almost 12 years
    These directions apply well enough to Debian based systems, but are completely useless for CentOS.
  • aculich
    aculich over 11 years
    Suggesting that people manually edit /etc/network/interfaces by hand for their wifi is not very helpful since it is fraught with peril, not to mention being cumbersome since you have to manually change it every time you move to a new SSID or if you want it to be dynamic you have to set up your supplicant by yourself which is not the simplest thing to get right. Just use NetworkManager and click "Available to all users" and the problem is solved.
  • slm
    slm about 10 years
    This question is about CentOS, this answer is worthless since none of the files are the same for configuring the network b/w CentOS & Debian.