您的位置:首页 > 其它

Debian添加源(source.list)及无线网卡配置(wireless tools)

2008-12-23 16:30 531 查看
debian 提供了一个工具,可以帮你测出那个站点在你那里连上去最快(通过 ping 和比较 hop 的次数)。

名字是 netselect

安装

apt-get install netselect

安装后

$ netselect [网站名] ... [网站名]

会显示出速度最快的一个,具体请参看 netselect 的 man pages

网站在这里找:debian 的全球 mirror 列表

http://www.debian.org/mirror/list

这个软件包还包括了一个 netselect-apt,

这个运行后,会在当前目录产生一个叫 sources.list 的文件(给 apt 用的)。

$ netselect-apt

... 由于这个是检测每一个 debian 网站,用的时间会很长 ...

然后会生成这个文件 sources.list

$ ls sources.list

sources.list

$

然后把这个文件移到 /etc/apt/ 下 (要以 root 来做)

$su

Password:

#whoami

root

为了安全,先把文件 chown 成 root 的 (其他用户就改不了)

#chown root:root sources.list

最好在移过去前先把原来的备份

#mv /etc/apt/sources.list /etc/apt/sources.list~

好了,然后移过去

#mv sources.list /etc/apt

最后登出 root

#exit

------------------------------------------------------------------------------------------------------
[Debian]无线网卡配置
------------------------------------------------------------------------------------------------------

当前linux内核自带的无线网卡驱动不多,主要是笔记本电脑使用的
”Intersil Prism“芯片(著名的“ Intel Pro/Wireless
2100”)。另外还有”Atheros”芯片似乎是比较多linuxer使用。那么国内接PCI插槽的网卡,有哪些是可以被我使用的呢?搜索后发现,TP-LINK的无线网卡,我发现它是使用Atheros芯片,这样的话,就可以使用 http://madwifi.org 站点上的驱动程序(madwifi是一个开源项目,专门用于Atheros芯片无线局域网网卡的Linux驱动程序)。

TP-LINK的TP-WN550G,
54M速率,支持IEEE 802.11 b/g协议.

另外列一下madwifi可用的tp-link无线网卡型号: TL-WN551G,TL-WN650G(150-180元左右),TL-WN651G

开始安装

安装硬件就不用说了,操作系统还是在debian下,因为debian实在是太方便了:

1、grep CONFIG_NET_RADIO /boot/config-`uname -r`看内核是否支持无线。

CONFIG_NET_RADIO=y

2、lspci看是否找到硬件,没有lspci命令的话需安装pciutils包。

3、安装madwifi相关的包:

aptitude search madwifi

i madwifi-doc - documentation for the Multiband Atheros Driver for WiFi

i madwifi-source - source for the Multiband Atheros Driver for WiFi

i madwifi-tools - tools for the Multiband Atheros Driver for WiFi

将三个包都安装了。

其中madwifi-source包安装后会在/usr/src/目录中产生madwifi.tar.bz2文件,解压后的目 录名为"modules",

cd /usr/src/modules/madwifi

make

make install

后完成modwifi的安装。

debian的话,先安装linux-header:

aptitude install linux-headers-2.6.18-3-686

否则可能会出现下面的错误:

/bin/sh: line 0: cd: /lib/modules/2.6.18-3-686/build: no such file or dir Makefile.inc:69:

*** /lib/modules/2.6.18-3-686/build is missing, please set KERNELPATH. stop.

之后重启系统或者用modprobe ath_pci来加载模块。

如果成功,则使用"ifconfig"会看到新的网卡,网卡名是“ath0”。

安装软件

aptitude install wireless-tools

这个package包括iwconfig、iwlist等有用的工具。

我的ap使用的加密协议是比较简单的WPA-PSK,该协议xsupplicant不能使用,所以改为使用wpasupplicant 来进行配置。

aptitude install wpasupplicant

使用

iwlist ath0 scanning

命令可以查看当前能找到的接入点。

WPA配置

使用wpa_passphrase命令产生PSK:

用法:wpa_passphrase <ssid> [passphrase]

比如:wpa_passphrase my_ssid abcd1234

network={
ssid="my_ssid"
#psk="abce1234"
psk=xxxxxxxxxxxxxxxxxxxxx
}

完整的配置文件/etc/wpa_supplicant.conf:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1

network={
ssid="my_ssid"
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
proto=WPA
key_mgmt=WPA-PSK
priority=5
psk=xxxxxxxxxxxxxxxxxxxx
}

手工启动:

wpa_supplicant -D madwifi -i ath0 -c /etc/wpa_supplicant.conf

使用命令

iwconfig ath0

可以查看,Access Poin是否连接成功了。如果是使用dncp的话,使用dhclient ath0来自动获取IP,如果使用静态的IP的话,直接使用ifconfig配置IP。

不过,有时候有些AP和无线网卡芯片不太兼容的话,有可能用不了WPA协议进行连接。比如我的笔记本就是这样,所以也可以使用WEP协议进行连接,安全性方面,我想使用128位的加密以及隐藏接入点,应该是没太大的问题的。

使用WEP协议的话,除了在AP上面要配置好之外,在debian上面只需要使用“iwconfig”命令,就可以进行实现连接,也可以写成一个启动脚本,在开机的时候自动进行链接。

Primary Debian mirror sites[/b]

CountrySiteArchitectures
Australiaftp.au.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Austriaftp.at.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Belgiumftp.be.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Brazilftp.br.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Bulgariaftp.bg.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Canadaftp.ca.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Chileftp.cl.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Croatiaftp.hr.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Czech Republicftp.cz.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Denmarkftp.dk.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Estoniaftp.ee.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Finlandftp.fi.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Franceftp.fr.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Franceftp2.fr.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Germanyftp.de.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Germanyftp2.de.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Great Britainftp.uk.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Greeceftp.gr.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Hong Kongftp.hk.debian.org/debian/alpha amd64 arm armel i386 ia64 powerpc sparc
Hungaryftp.hu.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Icelandftp.is.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Irelandftp.ie.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Italyftp.it.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Japanftp.jp.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Japanftp2.jp.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Koreaftp.kr.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Mexicoftp.mx.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Netherlandsftp.nl.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
New Zealandftp.nz.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Norwayftp.no.debian.org/debian/amd64 i386 ia64 powerpc sparc
Polandftp.pl.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Portugalftp.pt.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Romaniaftp.ro.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Russiaftp.ru.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Slovakiaftp.sk.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Sloveniaftp.si.debian.org/debian/alpha amd64 i386 ia64 powerpc sparc
Spainftp.es.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Swedenftp.se.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Switzerlandftp.ch.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Taiwanftp.tw.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Turkeyftp.tr.debian.org/debian/alpha amd64 arm hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
Ukraineftp.ua.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
United Statesftp.us.debian.org/debian/alpha amd64 arm armel hppa hurd-i386 i386 ia64 mips mipsel powerpc s390 sparc
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: