当前位置:  首页  >  服务器技术  >  Linux/unix  >  Linux入门

在linux环境使用WPA加密上网以wpa-pskTKIP加密方式位例

在linux环境使用WPA加密上网以wpa-pskTKIP加密方式位例--Linux通用技术-Linux技术与应用信息,下面是详情阅读。
首先是安装网卡驱动,如果是atheros 的可以用 madwifi 包 可在http://madwifi.org/下载

编译时可能会用到相应的软件包 如linux-headers-'uname -r' , build-essential ,gcc 的软件包。

如果无法上网可以用安装光盘将之添加上,只要将光驱加入源即可

apt-cdrom add

apt-get install linux-headers-* build-essential gcc

linux wpa上网需要安装wpa_supplicant软件包(ubuntu).

可以在http://security.ubuntu.com/ubuntu/pool/main/w/wpasupplicant/ 的目录下在相应的软件包。

设置 WPA 验证资料

wpa_passphrase SSID WPA_Key > /etc/wpa_supplicant/fonera.conf

wpa_supplicant -BDwext -i ath0 -c/etc/wpa_supplicant/fonera.conf



vi /etc/wpa_supplicant.conf

network={

ssid="SSID"
key_mgmt=WPA-PSK
proto=WPA
pairwise=TKIP
group=TKIP
psk="WPA_Key"

}

wpa_supplicant -BDwext -i ath0 -c /etc/wpa_supplicant.conf

获取 IP

dhclient eth1

route add default gw IP_of_AP

如果觉得每次启动都要运行 wpa_supplicant -BDwext -ieth1 -c/etc/wpa_supplicant.conf 命令比较麻烦可以添加后续步骤

Starting All This Stuff Automatically
Your users probably don't want to enter all these commands every time they want to connect to your network. So, if you're feeling benevolent, you can set everything up to start at boot. On Debian, Ubuntu, and the vast herds of other Debian-based distributions, edit /etc/network/interfaces:

auto eth1
iface eth1 inet dhcp
up wpa_supplicant -i ath0 -c/etc/wpa_supplicant.conf -BDwext
down killall wpa_supplicant

-B forks the wpa_supplicant into the background, and -w tells it to do nothing unless the interface is up.

On Fedora and Red Hat, et al, configure your wireless card in the usual manner in /etc/sysconfig/network-scripts/ifcg-eth1, or whatever file belongs to the wireless interface, using the real interface name and MAC address:

DEVICE=eth1
BOOTPROTO=dhcp
HWADDR=11:22:33:44:55:66
ONBOOT=yes
TYPE=Ethernet

Then add these lines to the end of /etc/sysconfig/network-scripts/ifup-wireless, again using your own interface name:

wpa_supplicant -i ath0 -c/etc/wpa_supplicant.conf -BDwext
killall wpa_supplicant

These are simple setups that don't manage multiple locations or do any fancy hotplug management, but they work fine for single locations. We'll cover roaming, multiple profiles, and hotplug interfaces in future installments.
吐了个 "CAO" !
扫码关注 PHP1 官方微信号
PHP1.CN | 中国最专业的PHP中文社区 | 凯发国际娱乐 | 凯发国际娱乐下载 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | PHP问答
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved PHP1.CN 第一PHP社区 版权所有