用终端连接网络

eas*_*asl 5 command-line networking wifi

我家里有一个 ESSID 为dlink_home10位数字 (0123456789) 64-bit WEP加密的Open Authentication Type的路由器。

我想用 bash 命令通过终端连接到它,我试过了

ifconfig wlan0 up
iwconfig wlan0 essid dlink_home key s:0123456789
dhclient wlan0
Run Code Online (Sandbox Code Playgroud)

使用 s: 前缀时会出现以下错误:

无线请求“设置编码”错误(8B2A):设备 wlan0 上的 SET 失败;无效的论点。

没有它,它不起作用,因为 s: 前缀用于指定字符串键而不是十六进制键。

我运行的操作系统是Red Hat Enterprise Linux 6

slm*_*slm 5

1.正确的命令形式

尝试将您的 iwconfig 行更改为:

$ iwconfig wlan0 essid dlink_home key s:0123456789
Run Code Online (Sandbox Code Playgroud)

2. wpa_supplicant

如果上述命令是正确的并且您仍然收到错误消息,请确保您安装了 wpa_supplicant 包。

$ yum install wpa_supplicant
Run Code Online (Sandbox Code Playgroud)

3. 网络管理员

在处理无线设备时,我会通过 iwconfig 使用 NetworkManager。要在运行级别 3 中使用 NetworkManager 通过命令行连接,您可以使用以下命令:

 $ nmcli dev wifi connect <name> password <password>
Run Code Online (Sandbox Code Playgroud)

参考