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


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-LINKTP-WN550G, 54M速率,支持IEEE 802.11 b/g协议.

另外列一下madwifi可用的tp-link无线网卡型号: TL-WN551GTL-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

  1. network={
  2.    ssid="my_ssid"
  3.    #psk="abce1234"
  4.    psk=xxxxxxxxxxxxxxxxxxxxx
  5. }

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

  1. ctrl_interface=/var/run/wpa_supplicant
  2. ctrl_interface_group=0
  3. ap_scan=1

  4. network={
  5.    ssid="my_ssid"
  6.    pairwise=CCMP TKIP
  7.    group=CCMP TKIP WEP104 WEP40
  8.    proto=WPA
  9.    key_mgmt=WPA-PSK
  10.    priority=5
  11.    psk=xxxxxxxxxxxxxxxxxxxx
  12. }

手工启动:

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
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
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值