LinuxSir.cn,穿越时空的Linuxsir!

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

在fedora core 4使用Atheros芯片无线网卡

[复制链接]
发表于 2006-3-29 19:44:06 | 显示全部楼层 |阅读模式
[注]:转贴请注明来自[url]www.linuxsir.cn并给出原始URL。
[color="Blue"]在fedora core 4使用TP-LINK650G等PCI_CARDBUS无线网卡

我把自己设置的经验共享出来,希望可以做个参考。
      本文档合适网卡列表可以在http://madwifi.org/wiki/Compatibility找得到,3com/linksys/netgear都有网卡合适,并不只是TP-LINK网卡。
      最新的源代码无线驱动可以在http://snapshots.madwifi.org/上下载得到,一般名称为madwifi-ng-current.tar.gz。它支持2.4和2.6两种内核,应该是所有linux都可以安装(我以前也试过debian系统,一样的安装步骤)。
     要求安装有sharutils软件包,这一软件包FC4系统安装光盘中有,这一工具软件会包括uudecode工具,这编译过程中需要它。
     我这里以安装TL-WN650G为例来做个说明,510G和610G的安装也是一样的,它们的MAC芯片都为ar5212。
     插上网卡后,可以通过下面的命令来查看无线网卡的主芯片(确切地说应该是核心处理器,因为不同网卡对于芯片型号来说可能是不一样,但在linux下所认到的核心处理器型号却有可能是一样的)信息。
[root@localhost ~]# lspci -v
01:02.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)
        Subsystem: Atheros Communications, Inc.: Unknown device 1051
        Flags: bus master, medium devsel, latency 168, IRQ 10
        Memory at e1000000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [44] Power Management version 2
    首先进入madwifi-ng-current.tar.gz所在的目录,通过下面的命令来解压缩:
[root@localhost ~]# tar xzvf madwifi-ng-current.tar.gz
       然后进入解压缩之后的源代码目录:
[root@localhost ~]# cd madwifi-ng-r1486-20060329/
    建议您先阅读里面的README和INSTALL文件来获取更多的帮助信息(我就是通过这些信息来成功安装的),比如您如果想配置WPA,还得仔细阅读这些信息来寻求帮助,我们这里就不看了。
       通过下面的命令来编译驱动程序:
[root@localhost src]# make
    编译成功结束后,可以通过下面的指令来加载网卡模块:
[root@localhost madwifi-ng-r1486-20060329]# modprobe ath_pci
       如果没有错误提示,恭喜了,你已经成功安装了650G网卡。
       下面是我ifconfig命令的输出:
[root@localhost madwifi-ng-r1486-20060329]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0F:EA:5F:F4:28
          inet addr:222.77.77.250  Bcast:222.77.77.255  Mask:255.255.255.0
          inet6 addr: fe80::20f:eaff:fe5f:f428/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:114 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:14367 (14.0 KiB)  TX bytes:2183 (2.1 KiB)
          Interrupt:11 Base address:0xc400
lo        Link encapocal Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1968 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1968 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2274956 (2.1 MiB)  TX bytes:2274956 (2.1 MiB)
       奇怪了,怎么还没有看到我的无线网卡呢?别急,只是网卡没有起用而已,通过下面的输出您就清楚了:
[root@localhost madwifi-ng-r1486-20060329]# ifconfig ath0
ath0      Link encap:Ethernet  HWaddr 00:14:78:75D:4B
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:200
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:10 Memory:d01a0000-d01b0000
       Atheros无线网卡一般安装好的网卡名称就是ath0,现在看到了吧,单纯的ifconfig命令只能看到已经激活的网卡,我们的无线网卡ath0还没有激活,所以刚才没有看到。
       通过下面命令来激活网卡:
[root@localhost madwifi-ng-r1486-20060329]# ifconfig ath0 up
[root@localhost madwifi-ng-r1486-20060329]# ifconfig
ath0      Link encap:Ethernet  HWaddr 00:14:78:75D:4B
          inet6 addr: fe80::214:78ff:fe75:dd4b/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:142 dropped:0 overruns:0 frame:142
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:200
          RX bytes:0 (0.0 b)  TX bytes:140 (140.0 b)
          Interrupt:10 Memory:d01a0000-d01b0000
eth0      Link encap:Ethernet  HWaddr 00:0F:EA:5F:F4:28
          inet addr:222.77.77.250  Bcast:222.77.77.255  Mask:255.255.255.0
          inet6 addr: fe80::20f:eaff:fe5f:f428/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:145 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:17560 (17.1 KiB)  TX bytes:2183 (2.1 KiB)
          Interrupt:11 Base address:0xc400
lo        Link encapocal Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1968 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1968 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2274956 (2.1 MiB)  TX bytes:2274956 (2.1 MiB)
       呵呵,现在已经看到网卡已经激活了。
       我们现在来连接TP-LINK641G路由器,它的SSID为TP-LINK:
[root@localhost madwifi-ng-r1486-20060329]# iwconfig ath0 essid TP-LINK
       因为641G具有DHCP功能,我们可以通过下面的命令来自动获取IP地址:
       [root@localhost madwifi-ng-r1486-20060329]# dhclient ath0
[root@localhost madwifi-ng-r1486-20060329]# ifconfig ath0
ath0      Link encap:Ethernet  HWaddr 00:14:78:75D:4B
          inet addr:192.168.1.100  Bcast:255.255.255.255  Mask:255.255.255.0
          inet6 addr: fe80::214:78ff:fe75:dd4b/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:278 dropped:0 overruns:0 frame:278
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:200
          RX bytes:1222 (1.1 KiB)  TX bytes:1220 (1.1 KiB)
          Interrupt:10 Memory:d01a0000-d01b0000
       已经看到获取到IP地址为192.168.1.100,无线网卡已经可以正常工作了。下面演示一下当无线路由器设置了WEP加密,使用密钥1加密,十六进制64bit,密钥为1234567890,使用了开放系统的认证模式(对应于共享密钥模式,如果不清楚,请先学习一下WEP加密的机制,用google搜索一下会有的)。我们在下面列出配置无线网卡的步骤:
    让网卡使用密钥1,并把密钥1的值设置为1234567890:
[root@localhost src]# iwconfig ath0 key 1 1234567890
    把认证方式设置为开放系统:
[root@localhost src]# iwconfig ath0 key open
    开启加密功能:
[root@localhost src]# iwconfig ath0 key on
       我们再来查看这一无线网卡的配置信息:
[root@localhost madwifi-ng-r1486-20060329]# ifconfig ath0
ath0      Link encap:Ethernet  HWaddr 00:14:78:75D:4B
          inet addr:192.168.1.100  Bcast:255.255.255.255  Mask:255.255.255.0
          inet6 addr: fe80::214:78ff:fe75:dd4b/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:755 errors:1441 dropped:0 overruns:0 frame:1441
          TX packets:768 errors:11 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:200
          RX bytes:261841 (255.7 KiB)  TX bytes:97502 (95.2 KiB)
          Interrupt:10 Memory:d01a0000-d01b0000
[root@localhost madwifi-ng-r1486-20060329]# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=10.9 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.12 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.89 ms
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 1.123/4.638/10.900/4.438 ms, pipe 2
       可以看到我们刚才配置的无线信息已经在上面做了反映,上面才可以看到如连接速度等其他信息。如果只是想查看加密信息,还可以使用下面的命令:
[root@localhost madwifi-ng-r1486-20060329]# iwlist ath0 key
ath0      3 key sizes : 40, 104, 128bits
          4 keys available :
                [1]: 1234-5678-90 (40 bits)
                [2]: off
                [3]: off
                [4]: off
          Current Transmit Key: [1]
          Security modepen
       好了,现在无线部分的设置已经成功。如果您想查看一下当前网络中有多少个AP(我们平常说的扫描无线网络)可用命令iwlist ath0 scanning。
       如果你使用的无线设备没有DHCP功能,那你还得通过ifconfig来手工指定一个,比如想指定为192.168.1.88,可以通过下面的命令来实现:
[root@localhost madwifi-ng-r1486-20060329]# ifconfig ath0 192.168.1.88
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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