Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [Solved] How do I configure CentOS 6 to auto-connect to my WPA2 Wi-Fi network?
New Posts  All Forums:Forum Nav:

[Solved] How do I configure CentOS 6 to auto-connect to my WPA2 Wi-Fi network?

post #1 of 15
Thread Starter 
Okay, been bashing my head against the wall for two weeks on this one. I've been googling a ton and found a dozen different guides and hit a bunch of (very hostile) Linux forums but I can't get a configuration that works.

Background:
I have a Mini-ITX Atom D525 system with an Intel Centrino 6200 half-height WLAN card that I intend to use as a dedicated TeamSpeak 3 server (and DynDNS updater as well). I have CentOS 6 installed and intend to run it wireless so it doesn't have to be in my desk area.

My LAN runs on the 192.168.128.0 subnet and I want the CentOS system to have a static IP address of 192.168.128.64. We have a WPA2-protected Wi-Fi network running on the 2.4 GHz band that I want this system to auto-connect to on boot.

Here are some guides I tried to follow, but I can't get them working on this system:
Here are the system specs:
  • Intel Atom D525 dual-core with HyperThreading at 1.8 GHz (Intel D525MW motherboard)
  • Intel Centrino 6200N half-height mini-PCI Express WLAN card
  • 4 GB DDR3 SODIMM (2 x 2 GB) at 800 MHz
  • 160 GB 2.5" Samsung hard disk
  • Habey 600s case with ~100-watt Pico-PSU
  • 64-bit CentOS 6 with KDE

Here's the strange thing, I can ping the wi-fi card from my desktop (using ping -t 192.168.128.64 in windows) and the ping only succeeds if the server is plugged into our wired network. ifconfig -a confirms that 192.168.128.64 is the wlan0 interface, but as soon as I unplug the Ethernet cord the ping quits working. (FYI eth0 is auto-assigned via DHCP, currently it's 192.168.128.105 which I can also ping but only if the wire is plugged in.) The server can only get on the Internet over wired, and I can't access the TeamSpeak server unless it's plugged in wired.

At one point everything worked just fine over wi-fi, even automatically connecting, but I shutdown the system remotely via SSH to move it and when I brought it back up I couldn't get anything working again.

Can anybody here walk me through getting this thing on our network, starting from the beginning if need be?

I'm almost a complete Linux newb so don't be surprised if I don't know stuff. I know a few commands and have modified a bunch of scripts without really understanding what any of it does. If I've messed up too bad I have no issue with formatting the drive and re-installing CentOS (or another distribution). I'm not putting Windows on because Windows almost costs as much as the system.

I'd appreciate and +REP any help.
Edited by mott555 - 8/20/11 at 9:22pm
post #2 of 15
You are using KDE right? Just set GDM/KDM (whichever you use. I know this is possible in GDM) to log in on boot and use NetworkManager to automatically connect to the WPA2 network. This would be the easiest way to do this, just get networkmanager, the applet, and run nm-applet upon boot. Then just configure it graphically.

Another solution would be to run wicd (with wicd-kde, might have another name), and that will also automatically log into networks if run at boot (like as a daemon, I don't know how to do this in CentOS).
Ye Old Desktop
(14 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 965 @ 4.24 GHz ASUS M4A77D PNY GTX 470 7 GB DDR2 RAM 
Hard DriveHard DriveOptical DriveOS
500 GB Hitachi 250 GB Maxtor (PATA) x16 DVD/CD RW Windows 7 Professional x68 
MonitorKeyboardPowerCase
Hannspree HF255HPB Logitech G15 (2nd Gen) Corsair TX 650 V2 Antec 300 
MouseAudio
Logitech G9 Creative Audigy 2 ZS 
  hide details  
Reply
Ye Old Desktop
(14 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 965 @ 4.24 GHz ASUS M4A77D PNY GTX 470 7 GB DDR2 RAM 
Hard DriveHard DriveOptical DriveOS
500 GB Hitachi 250 GB Maxtor (PATA) x16 DVD/CD RW Windows 7 Professional x68 
MonitorKeyboardPowerCase
Hannspree HF255HPB Logitech G15 (2nd Gen) Corsair TX 650 V2 Antec 300 
MouseAudio
Logitech G9 Creative Audigy 2 ZS 
  hide details  
Reply
post #3 of 15
wireless cards doesn't show up with ifconfig try iwconfig.
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
post #4 of 15
Thread Starter 
Quote:
Originally Posted by Rothen;14645342 
You are using KDE right? Just set GDM/KDM (whichever you use. I know this is possible in GDM) to log in on boot and use NetworkManager to automatically connect to the WPA2 network. This would be the easiest way to do this, just get networkmanager, the applet, and run nm-applet upon boot. Then just configure it graphically.

Another solution would be to run wicd (with wicd-kde, might have another name), and that will also automatically log into networks if run at boot (like as a daemon, I don't know how to do this in CentOS).

How do I go about that? Sorry for being ignorant...but I'm pretty linux ignorant.
Quote:
Originally Posted by dhenzjhen;14645378 
wireless cards doesn't show up with ifconfig try iwconfig.

I typed "iwconfig" and my wlan0 interface has the correct SSID for ESSID, but under Access Point it says "Not-Associated." What exactly does that mean? Is my wlan0 broadcasting as an access point instead of joining mine?
post #5 of 15
Quote:
Originally Posted by mott555;14646946 
How do I go about that? Sorry for being ignorant...but I'm pretty linux ignorant.



I typed "iwconfig" and my wlan0 interface has the correct SSID for ESSID, but under Access Point it says "Not-Associated." What exactly does that mean? Is my wlan0 broadcasting as an access point instead of joining mine?

> that means the wlan0 can see your access point but cannot get DHCP IP. did you put the the pass key?

This is how you do it:
iwconfig wlan0 essid "ocn-net"
iwconfig wlan0 mode managed
iwconfig wlan0 key restricted or if doesnt work try iwconfig wlan0 key s:yourpasskeykeyhere
iwconfig wlan0
ifconfig wlan0 up
dhclient wlan0
ping overclock.net =)


hth
Edited by dhenzjhen - 8/19/11 at 6:49pm
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
post #6 of 15
Thread Starter 
The passkey is in my wpa_supplicant.conf file and seems to be correct. Also, I modified the /etc/sysconfig/network-scripts/ifcfg-wlan0 file to set up a static IP address.
Quote:
Originally Posted by /etc/wpa_supplicant/wpa_supplicant.conf 
ctrl)interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
ssid="My SSID"
scan_ssid=1
proto=WPA RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="My Key"
}

That's copied from my laptop which has no problem connecting to my wi-fi.
Quote:
Originally Posted by /etc/sysconfig/network-scripts/ifcfg-wlan0 
DEVICE=wlan0
USERCTL=no
IPV6INIT=no
BOOTPROTO=none
HWADDR=XX.XX.XX.XX.XX.XX
ONBOOT=yes
IPADDR=192.168.128.64
NETMASK=255.255.255.0
GATEWAY=192.168.128.1
DNS1=65.164.201.148
DNS2=76.7.255.188
TYPE=Wireless
ESSID="My SSID"
CHANNEL=6
MODE=Managed
WPA=yes

Is this stuff about right? I found a ton of variation online when looking for guides.
post #7 of 15
what's the output when you type:

#ifconfig wlan0 up
#iwconfig
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
post #8 of 15
Thread Starter 
Quote:
Originally Posted by dhenzjhen;14647154 
what's the output when you type:

#ifconfig wlan0 up
#iwconfig
Code:
lo               no wireless extensions.

eth0           no wireless extensions.

wlan0         IEEE 802.11abgn  ESSID:"My SSID"
                 Mode:Managed  Frequency:2.437 GHz  Access Point: Not-Associated
                 Tx-Power=15dBm
                 Retry  long limit:7   RTS thr:off   Fragment thr:off
                 Encryption key:off
                 Power Management:off

sit0            no wireless extensions.

Sorry for the formatting, it all lines up in the text editor.
post #9 of 15
Quote:
Originally Posted by mott555;14647184 
Code:
lo               no wireless extensions.

eth0           no wireless extensions.

wlan0         IEEE 802.11abgn  ESSID:"My SSID"
                 Mode:Managed  Frequency:2.437 GHz  Access Point: Not-Associated
                 Tx-Power=15dBm
                 Retry  long limit:7   RTS thr:off   Fragment thr:off
                 Encryption key:off
                 Power Management:off

sit0            no wireless extensions.

Sorry for the formatting, it all lines up in the text editor.



Turn on the encrytion key to get applied whenever you connect to you access point.
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
post #10 of 15
try typing manually then finalize everything soon when it's working.

later i gotta go home 7pm now here =)
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
Athena
(14 items)
 
Achilles
(9 items)
 
 
CPUMotherboardGraphicsHard Drive
[Intel] i5 2500k  [ASUS] p8p67 Evo B3 [EVGA] GTX 680 [Samsung] 1TB 
CoolingOSMonitorKeyboard
[Noctua] NH-D14 [Micro$oft] Win7 64-bit/Linux [HP] 2311x [Logitech] G510 
PowerCaseMouse
[XFX] 650W [Cooler Master] HAF X [Logitech] G400 
CPUMotherboardGraphicsRAM
990X 6.5Ghz EVGA X58 3 way SLI classified XFX GT 240/modded 8800GTS/8800GTX/5870/4980/FIR... Corsair Dominator PSC  
CoolingOSMonitorCase
F1 Extreme Dark, DICE and LN2!! XPeeeee and Win 7 Old CRT Open 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [Solved] How do I configure CentOS 6 to auto-connect to my WPA2 Wi-Fi network?