LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1228|回复: 5

有没有办法把WEP密匙储存在/etc/network/interfaces里?(已解决)

[复制链接]
发表于 2005-8-11 09:40:34 | 显示全部楼层 |阅读模式
该用什么表达式?
发表于 2005-8-11 13:44:44 | 显示全部楼层
iface wlan0 inet dhcp
    pre-up modprobe ndiswrapper;
    pre-up sleep 1;
    pre-up iwconfig wlan0 key s:abcde
    pre-up iwconfig wlan0 essid "myhome"
    #pre-up iwconfig wlan0 essid "CTC"
    pre-up iwconfig wlan0 commit
    pre-up sleep 1;
回复 支持 反对

使用道具 举报

发表于 2005-8-11 15:21:53 | 显示全部楼层
Debian的方式如下

10.6.3 Configuring a Wi-Fi interface

The wireless-tools package includes a hook script /etc/network/if-pre-up.d/wireless-tools which makes it possible to configure Wi-Fi (802.11a/b/g) hardware before the interface is brought up. Configuration is done using the iwconfig program; see iwconfig(8). For each possible command parameter of iwconfig you can include an option in /etc/network/interfaces named like that parameter with a "wireless-" prefix. For example, to set the ESSID of eth0 to myessid and the encryption key to 123456789e prior to bringing eth0 up using DHCP, edit /etc/network/interfaces so that it includes a stanza like this:

     iface eth0 inet dhcp
             wireless-essid myessid
             wireless-key 123456789e

Note that you should not use this method of setting the ESSID and key if you are running waproamd for this interface. By the time ifup is run waproamd has already set the ESSID and key. See Triggering network configuration – waproamd, Section 10.10.4.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-11 16:14:24 | 显示全部楼层
再问一句,这个key是ASC II码还是16进制的?有没有规定?
我在路由里设的是ASC II的
回复 支持 反对

使用道具 举报

发表于 2005-8-11 17:18:10 | 显示全部楼层
1234这样的当然是16进制,ASCII形式写成s:xxxx。man iwconfig
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-12 09:56:02 | 显示全部楼层
解决了,多谢各位
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表