Jamyy's Weblog

Ubuntu、Fedora 手動設定無線網路連線

by Jamyy on 五月.15, 2009, under Linux

Ubuntu、Fedora 手動設定無線網路連線

  • 停用 NetworkManager
  • 設定 WEP、WPA-PSK、WPA2-PSK 加密連線

環境: Ubuntu 8.10、Fedora 9

Ubuntu Fedora
停用
NM
sysv-rc-conf --level 2 \
NetworkManager off

sysv-rc-conf --level 2 \
networking on

/etc/init.d/NetworkManager stop
/etc/init.d/networking start

chkconfig NetworkManager off
chkconfig network on

#for WPA/WPA2 encryption
sed -i -e 's/23 88/09 88/' /etc/init.d/wpa_supplicant
chkconfig wpa_supplicant on
/etc/init.d/wpa_supplicant start

/etc/init.d/NetworkManager stop
/etc/init.d/network start

WEP vi /etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
wireless-essid SSIDname
wireless-key KEYinHEX
or
wireless-key s:KEYinASCII

vi /etc/sysconfig/network-scripts/ifcfg-wlan0

DEVICE=wlan0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=wireless
MODE=managed
ESSID=SSIDname
KEY=KEYinHEX
or
KEY=s:KEYinASCII

WPA-
PSK
vi /etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-ssid SSIDname
wpa-ap-scan 1
wpa-proto WPA
wpa-pairwise TKIP
wpa-group TKIP
wpa-key-mgmt WPA-PSK
wpa-psk KEYinHEX*

*. 可使用 wpa_passphrase SSIDname Key 取得編碼過的 Key

vi /etc/sysconfig/wpa_supplicant

INTERFACES="-iwlan0"
DRIVERS="-Dwext"

wpa_passphrase SSID Key >> /etc/wpa_supplicant/wpa_supplicant.conf

vi /etc/wpa_supplicant/wpa_supplicant.conf

network={
ssid="SSIDname"
scan_ssid=1
pairwise=CCMP TKIP
group=CCMP TKIP
key_mgmt=WPA-PSK
#psk="KEYinASCII"
psk="KEYinHEX"
}

vi /etc/sysconfig/network-scripts/ifcfg-wlan0

DEVICE=wlan0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=wireless
MODE=managed

WPA2-
PSK
vi /etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-ssid SSIDname
wpa-ap-scan 1
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk KEYinHEX*

*. 可使用 wpa_passphrase SSIDname Key 取得編碼過的 Key

完成
設定
/etc/init.d/networking restart /etc/init.d/wpa_supplicant restart
/etc/init.d/network restart

Ref:



: