|
大家好,
我现在用一个d-link dwl-1000AP, 只支持40bit wep, 而现在我的一个linux 2.6.8.1 嵌入式系统上用一块 d-link dwl-122 802.11b usb 网卡. 在/sbin/hotplug 下的脚本如下:
#
# The name of the wireless network to which we connect.
#
__SSID=linksys
#
# The 128-bit WEP encryption key to be used for the 802.11b network.
#
__KEY=12:34:56:78:90:ab:cd:ef:12:34:56:78:90
#
# The network type is ENCRYPTED for an encrypted 802.11b network and anything
# else for an unencrypted 802.11b network.
#
__TYPE=ENCRYPTED
#
# See what caused the hotplug event.
#
case ${1} in
#
# A USB device has been added or removed.
#
usb)
#
# See if this is a D-Link DWL-122 wireless dongle.
#
if [ ${PRODUCT} = 2001/3700/132 ]
then
#
# See if the dongle was added or removed.
#
case ${ACTION} in
#
# The dongle was added, so install the drivers for it.
#
add)
modprobe prism2_usb
;;
#
# The dongle was removed, so remove the drivers for it.
#
remove)
rmmod prism2_usb
rmmod p80211
;;
esac
fi
;;
#
# A wireless network has been added or removed.
#
wlan)
#
# See if the wireless network was added or removed.
#
case ${ACTION} in
#
# The wireless network was added.
#
register)
#
# See if an encrypted or unencrypted wireless network is in
# use.
#
if [ "x${__TYPE}" = "xENCRYPTED" ]
then
#
# Configure the wireless network with encryption.
#
wlanctl-ng ${INTERFACE} lnxreq_ifstate ifstate=enable
wlanctl-ng ${INTERFACE} dot11req_mibset \
mibattribute=dot11WEPDefaultKey0=${__KEY}
wlanctl-ng ${INTERFACE} dot11req_mibset \
mibattribute=dot11WEPDefaultKeyID=0
wlanctl-ng ${INTERFACE} dot11req_mibset \
mibattribute=dot11ExcludeUnencrypted=true
wlanctl-ng ${INTERFACE} dot11req_mibset \
mibattribute=p2CnfShortPreamble=long
wlanctl-ng ${INTERFACE} lnxreq_autojoin ssid=${__SSID} \
authtype=opensystem
else
#
# Configure the wireless network without encryption.
#
wlanctl-ng ${INTERFACE} lnxreq_ifstate ifstate=enable
wlanctl-ng ${INTERFACE} dot11req_mibset \
mibattribute=p2CnfShortPreamble=long
wlanctl-ng ${INTERFACE} lnxreq_autojoin ssid=${__SSID} \
authtype=opensystem
fi
#
# Use DHCP to obtain an IP address for this wireless adapter.
#
udhcpc -i ${INTERFACE}
;;
#
# The wireless network was removed.
#
remove)
#
# Find and kill the DHCP client for this interface.
#
PID=`ps | grep udhcpc | grep ${INTERFACE}`
kill ${PID}
;;
esac
;;
esac
我试着把__KEY改成12:34:56:68:90,系统启动后, 不能由dhcp 得到ip.
在windows 下用相同的key, 则可以.
怎么来修改脚本呢? |
|