为什么ubuntu10.10 每次开机都要手动启动无线?

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
回复
newtou
帖子: 1
注册时间: 2011-02-26 22:05

为什么ubuntu10.10 每次开机都要手动启动无线?

#1

帖子 newtou »

为什么ubuntu10.10 每次开机都要手动启动无线?
每次开机进入ubuntu,我都要到面板的 网络管理 右键,启用无线。
请问怎样才可以做到自动连接无线网络?

编辑连接 里面的“自动连接”已经勾选,无线网卡 是 Broadcom 的,附加驱动已经安装。
头像
ChenFengyuan
帖子: 770
注册时间: 2008-03-23 0:39

Re: 为什么ubuntu10.10 每次开机都要手动启动无线?

#2

帖子 ChenFengyuan »

我用的是wpa_supplicant,不过需要配置一下
弄了个脚本wpa_supplicant+dhcpcd
wpa_supplicant.conf

代码: 全选

# See /usr/doc/wpa_supplicant-0.6.10/wpa_supplicant.conf.sample
# for many more options that you can use in this file.

# This line enables the use of wpa_cli which is used by rc.wireless
# if possible (to check for successful association)
ctrl_interface=/var/run/wpa_supplicant
# By default, only root (group 0) may use wpa_cli
ctrl_interface_group=0
# eapol_version=1
# ap_scan=1
# fast_reauth=1
#country=US

# WPA protected network, supply your own ESSID and WPAPSK here:
# network={
#   scan_ssid=0
#   ssid="your_essid_here"
#   proto=WPA RSN
#   key_mgmt=WPA-PSK
#   pairwise=CCMP TKIP
#   group=CCMP TKIP WEP104 WEP40
#   psk=your_64_char_psk_here
#   priority=10
# }
network={
  # scan_ssid=0
  ssid="TP-LINK2010"
#  proto=WPA2
  key_mgmt=WPA-PSK
  pairwise=TKIP
  group=TKIP
  psk=oaeueouaouoeue
#psk的话运行wpa_passphrase your-ssid
#然后输入密码即可。
#然后就会返回了

  priority=10
}

# Plaintext connection (no WPA, no IEEE 802.1X),
# nice for hotel/airport types of WiFi network.
# network={
#   key_mgmt=NONE
#   priority=0
# }
# network={
#         ssid="2010test"
#         mode=1
#         frequency=2412
#         proto=WPA
#         key_mgmt=WPA-NONE
#         pairwise=NONE
#         group=TKIP
# 	#psk="1234567890"
#         psk="9e05efa7615d1b32a6e11484ac32eebe567ce42fe2d8fe311768b5cb0c261a9"
# 	priority=0
# }

我的启动脚本,debian的

代码: 全选

$ cat /etc/init.d/wifi 
#!/bin/sh
### BEGIN INIT INFO
# Provides:          wifi
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start wifi
# Description:       wifi
### END INIT INFO
wifi_start(){
    wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf 2 > /dev/null > /dev/null &
    dhcpcd -R wlan0
}
wifi_stop(){
    killall wpa_supplicant
    dhcpcd -x wlan0
}
case "$1" in
    start)
        wifi_start
        ;;
    stop)
        wifi_stop
        ;;
    restart|force-reload)
        wifi_stop
        wifi_start
        ;;
    *)
        echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0

:em11 happy hacking
回复