Centos – Wireless networking with CentOS

centosnetworkingwifi

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?

Best Answer

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
Related Question