linux网卡驱动_new
- 格式:pdf
- 大小:153.11 KB
- 文档页数:13
Linux操作系统怎么安装无线网卡驱动Linux操作系统怎么安装无线网卡驱动现在很多人都喜欢用无线上网,无线上网就需要无线网卡,而无线网卡就需要安装无线网卡驱动。
那么Linux操作系统怎么安装无线网卡驱动呢?下面跟着店铺一起去了解下吧。
Linux操作系统怎么安装无线网卡驱动安装方法及步骤:一、准备工作1、安装kernel的源码,在Redhat下是kernel-source.rpm包。
//我使用是FC8的内核,未再进行升级。
2、到/projects/ndiswrapper下载最新的ndiswrapper包,我的版本是ndiswrapper-1.52.tar.gz3、准备好网卡在Winxp下的驱动程序。
驱动程序最好是最新的,指定给XP用的。
我用到的是D-Link的一款PCI无线网卡(dwl-g520),其驱动程序是ar5211.sys、ar52119x.sys和net5211.inf。
二、安装及配置1、安装(1)解压:tar -zxvf ndiswrapper-1.52.tar.gz(2)进入ndiswrapper-1.52:cd ndiswrapper-1.52(3)编译:make//在此操作之前必需先把编译环境搭建好,即:安装好开发环境。
(4)安装:make install //如果不采取默认的安装路径,则可以用.configure --prefix="/etc/local"来指定安装目录。
//此目录是自建。
(5)查看安装后的版本ndiswrapper -v | grep //此处似乎不对。
如安装成功则显示version: 1.51(6)获取该无线网卡的WindowsXP驱动,我取了ar5211.sys、ar52119x.sys和net5211.inf。
(7)进入该驱动所在目录:cd /home/tsm/dwl_g520(8)安装无线网卡驱动:ndiswrapper -i net5211.inf(9)查看驱动是否安装:ndiswrapper -l//如:显示net5211(驱动名称) : driver installed(10)写入配置文件:ndiswrapper -mndiswrapper -mandiswrapper -mi(11)启动后模块自动加载:modprobe ndiswrapper2、配置(1)然后配置wpa_supplicant.conf文件:vi /etc/wpa_supplicant/wpa_supplicant.confctrl_interface=/var/run/wpa_supplicantctrl_interface_group=wheelnetwork={ssid="any"key_mgmt=NONE}(2)配置wpa_supplicant文件:vi /etc/sysconfig/wpa_supplicant将该文件内容设置为:# wlan0 and wifi0# INTERFACES="-iwlan0 -iwifi0"INTERFACES="-iwlan0"# ndiswrapper and prism# DRIVERS="-Dndiswrapper -Dprism"DRIVERS="-Dndiswrapper"(3)iwlist scanning 扫描一下你的AP //此处未成功,未知原因待查。
2011年研发二部工作周报月报作者:***时间:2012-6-13目录一、整理漏扫系统的结构 (1)1、整理NetScan目录中的程序。
(1)2、整理proftpd目录中内容(插件的检测信息)。
(4)3、整理proxyd目录中的安管(安管平台)。
(8)二、熟悉Nessus的工作原理 (8)1、Nessus扫描引擎的工作原理.... 错误!未定义书签。
三、整理运行的整个流程............... 错误!未定义书签。
1、通过客户端下发策略,上传到服务器上。
错误!未定义书签。
2、服务端:接收客户端下发的策略。
错误!未定义书签。
3、服务端进行身份的认证........ 错误!未定义书签。
一、整理漏扫系统的结构网卡是Linux服务器中最重要网络设备。
据统计,Linux网络故障有35%在物理层、25%在数据链路层、10%在网络层、10%在传输层、10%在对话、7%在表示层、3%在应用层。
由此可以看出,网络故障通常发生在网络七层模型的下三层,即物理层、链路层和网络层。
对应于实际网络也就是使用的网络线缆、网卡、交换机、路由器等设备故障。
Linux的网络实现是模仿FreeBSD的,它支持FreeBSD 的带有扩展的Sockets(套接字)和TCP/IP协议。
它支持两个主机间的网络连接和Sockets通讯模型,实现了两种类型的Sockets:BSD Sockets和INET Sockets。
它为不同的通信模型和服务质量提供了两种传输协议,即不可靠的、基于消息的UDP传输协议和可靠的、基于流的传输协议TCP,并且都是在IP网络协议上实现的。
INET sockets 是在以上两个协议及IP协议之上实现的。
由于交换机、路由器通常独立于Linux或者其他操作系统。
网卡设置故障是造成Linux 服务器故障最主要原因。
可能因为硬件的质量或性能、磨损老化、人为误操作、不正确的网络设置、管理问题、Linux软件的BUG、系统受到黑客攻击和Linux病毒等原因造成。
Linux下查看网卡驱动和版本信息查看网卡生产厂商和信号查看基本信息:lspci查看详细信息:lspci -vvv # 3个小写的v查看网卡信息:lspci | grep Ethernet查看网卡驱动查看网卡驱动信息:lspci -vvv # 找到网卡设备的详细信息,包括网卡驱动# lsmod 列出加载的所有驱动,包括网卡驱动查看网卡驱动版本查看模块信息:modifo<module name> # 其中包含version信息或# ethtool-i <device name>RHEL 6.3中的网卡驱动版本:# modinfo igbfilename: /lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/net/igb/igb.ko version: 3.2.10-klicense: GPLdescription: Intel(R) Gigabit Ethernet Network Driver# modinfo e1000efilename: /lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/net/e1000e/e1000e.ko version: 1.9.5-klicense: GPLdescription: Intel(R) PRO/1000 Network Driverauthor: Intel Corporation,<linux.nics@># modinfo e1000filename: /lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/net/e1000/e1000.ko version: 8.0.35-NAPIlicense: GPLdescription: Intel(R) PRO/1000 Network Driver# modinfo ixgbefilename: /lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/net/ixgbe/ixgbe.ko version: 3.6.7-klicense: GPLdescription: Intel(R) 10 Gigabit PCI Express NetworkDriver# modinfo r8169filename: /lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/net/r8169.ko version: 2.3LK-NAPIlicense: GPLdescription: RealTek RTL-8169 Gigabit Ethernet driver查看网络接口队列数查看网卡接口的中断信息:#cat /proc/interrupts | grep eth0或# ethtool-S eth0查看网卡驱动源码的版本号解压Intel网卡驱动源码,打开解压缩目录下的*.spec文件查看驱动的版本。
linux安装网卡驱动教程在Linux系统中,网卡驱动是一个必需的组件,它允许计算机与网络相连,进行数据的传输和通信。
虽然大多数Linux发行版会自动安装一些常用的网卡驱动,但某些特殊型号的网卡可能需要手动安装对应的驱动程序。
下面是一个详细的Linux安装网卡驱动的教程,帮助你完成这个过程。
1. 首先,你需要确定你的网卡型号和型号。
可以通过以下命令获取:```lspci | grep Ethernet```这将列出系统中所有的以太网适配器,包括网卡的型号和型号。
2. 一旦你确定了网卡的型号和型号,你可以在厂商的官方网站或者第三方驱动程序网站上查找和下载对应的驱动程序。
确保选择与你的Linux发行版和内核版本兼容的驱动程序。
3. 下载驱动程序后,将其保存在你的计算机上的一个可访问的位置,比如家目录。
4. 打开终端,在命令行中输入以下命令以进入驱动程序所在目录:```cd ~/下载```这里假设你将驱动程序保存在`~/下载`目录下。
如果你将其保存在其他目录,请将命令中的路径替换为实际位置。
5. 解压驱动程序文件。
这可以通过以下命令完成:```tar zxvf 驱动程序文件名.tar.gz```这里的`驱动程序文件名`应该是你下载的驱动程序文件的实际名称。
6. 进入驱动程序文件夹。
这可以通过以下命令完成:```cd 驱动程序文件夹名```这里的`驱动程序文件夹名`是解压后的驱动程序文件夹的实际名称。
7. 阅读驱动程序的安装说明文档。
通常情况下,驱动程序的文件夹中都会包含一个README文件或者INSTALL文件,其中提供了安装驱动程序所需的具体步骤和说明。
8. 一般来说,安装驱动程序的第一步是编译驱动程序的源代码。
在终端中输入以下命令以编译驱动程序:```make```这将根据驱动程序的源代码编译出可执行的二进制文件。
9. 安装编译好的驱动程序。
在终端中输入以下命令以安装驱动程序:```sudo make install```这需要管理员权限,所以你可能需要输入管理员密码。
换了linux系统后发现无线不能使用,很是苦恼,于是在网上找到各位大神的做法,终于成功安装。
下面给大家介绍一下。
本例以安装Fedora 14无线网卡驱动为例。
参考文章/Linux/2011-05/35366.htm。
首先在/support/802.11/linux_sta.php 上下载32位的驱动,下载完成之后进入到下载的文件夹下#cd ~/Downloads按照readme的做法,新建一个文件夹,并且将该压缩文件移动到新建的文件夹当中#mkdri hybrid_wl#mv hybrid-portsrc-x86_32-v5.60.48.36.tar.gz hybrid_wl/进入文件夹,进行解压,#cd hybrid_wl/#tar -zxvf hybrid-portsrc-x86_32-v5.60.48.36.tar.gz由于自述文件当中的做法是指定解压目录,因此为了保险,再把这个压缩文件移动到上一级目录#mv hybrid-portsrc-x86_32-v5.60.48.36.tar.gz ../根据自述文件的说法(The cards with the following PCI Device IDs are supported with this driver.),查看支持的版本# lspci -n | grep 14e40c:00.0 0280: 14e4:4315 (rev 01)BRCM PCI PCI DellProduct Name Vendor ID Device ID Product ID------------- ---------- --------- -----------4311 2.4 Ghz 0x14e4 0x4311 Dell 13904311 Dualband 0x14e4 0x4312 Dell 14904311 5 Ghz 0x14e4 0x43134312 2.4 Ghz 0x14e4 0x4315 Dell 13954313 2.4 Ghz 0x14e4 0x4727 Dell 15014321 Dualband 0x14e4 0x4328 Dell 15054321 Dualband 0x14e4 0x4328 Dell 15004321 2.4 Ghz 0x14e4 0x43294321 5 Ghz 0x14e4 0x432a4322 Dualband 0x14e4 0x432b Dell 15104322 2.4 Ghz 0x14e4 0x432c4322 5 Ghz 0x14e4 0x432d43224 Dualband 0x14e4 0x4353 Dell 152043225 2.4 Ghz 0x14e4 0x4357发现确实是支持Dell这款无线网卡的4312 2.4 Ghz 0x14e4 0x4315 Dell 1395接下来就是对驱动进行编译了,在hybrid_wl目录下执行以下命令#make clean#make**注意,如果出现以下这样的error,则是因为内核源码的问题,1:查看自己是否安装了kernel-devel-2.6……包,如果没有装包先把包装上试试2:装完这个包还不行的话就需要你自己更新一下内核源码,编译更新的内核[root@ChinaUnix hybrid-wl]# make cleanKBUILD_NOPEDANTIC=1 make -C/lib/modules/`uname -r`/build M=`pwd` cleanmake: *** /lib/modules/2.6.35.6-45.fc14.i686/build: No such file or driectory. Stop.make: *** [clean] Error2[root@ChinaUnix hybrid-wl]# makeKBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`make: *** /lib/modules/2.6.35.6-45.fc14.i686/build: No suchfile or driectory. Stop.make: *** [all] Error 2完成之后,可以在目录下看到wl.ko 文件,如果以前安装过驱动的话,那么还需要对安装过的驱动进行清理。
1.1下载驱动程序一、首先弄清楚当前使用的是什么版本的Linux,如:Redhat9.0、Freda core5等。
Linux用的是什么版本的内核,可以用uname –a得知内核版本号。
二、使用的是什么接口类型的无线网卡,常见的接口类型有PCI (台式机)、Cardbus/PCMCIA(笔记本)、USB(台式机、笔记本)等。
三、无线网卡使用的是哪一种类型的芯片,判断方法如下,到相关网站下载与其相对应的驱动程序。
常用的无线网卡驱动及其支持的芯片类型和接口类型如下表1所示。
PCMCIA卡:将无线网卡插入笔记本电脑中,用命令lspci可以看到芯片类型,如:Realtek Semiconductor Co.. Ltd, RTL8180L802.11b MAC (rev 20)其中RTL8180L即为网卡芯片类型,用参数v可以看到更详细的信息。
USB卡:用命令lsusb可以看到芯片类型(fc5没有此命令)。
通过其它方法查找。
驱动程序芯片类型接口类型官方网站下载页Linux-wlan-ng Prism2/2.5/3 Cardbus/PCI/USB /download.shtml Madwifi Atheros系列Cardbus/PCI /islsm ISL38XX USB/PCI http://jbnote.free.fr/prism54usb/index.html表1:网卡驱动程序有关信息1.2驱动程序的安装每款驱动的安装方法各不相同,阅读INSTALL文档,获得驱动程序的具体安装方法及系统内核要求。
阅读驱动程序附带的README文档,获得有关此驱动的详细信息,如驱动所支持的网络模式、接口类型、所包含的模块的功能及无线网卡的配置等。
下面是安装网卡驱动程序的一般步骤:编译网卡驱动程序#make安装驱动程序模块#make install加载模块#modprobe 主模块名安装好驱动后插入无线网卡,命令iwconfig可以查看驱动是否加载成功,如果出现新的设备名,则说明驱动已经装上并且能够识别出无线网卡。
linux查看⽹卡驱动信息⽅法⼀:1:ethtool -i ethx如:linux:/mnt # ethtool -i eth1driver: e1000eversion: 1.0.2-k2firmware-version: 1.9-0bus-info: 0000:0b:00.0linux:/mnt # ethtool -i eth16driver: igbversion: 2.1.0-k2firmware-version: 1.4-1bus-info: 0000:0a:00.0linux:/mnt #2:使⽤ modinfo igb 查看驱动信息linux:~ # modinfo igbfilename: /lib/modules/2.6.32.12-0.7-default/kernel/drivers/net/igb/igb.koversion: 5.2.5license: GPLdescription: Intel(R) Gigabit Ethernet Network Driverauthor: Intel Corporation, <e1000-devel@>srcversion: 0E80ABCD0117D822FE8B271alias: pci:v00008086d000010D6sv*sd*bc*sc*i*alias: pci:v00008086d000010A9sv*sd*bc*sc*i*alias: pci:v00008086d000010A7sv*sd*bc*sc*i*alias: pci:v00008086d000010E8sv*sd*bc*sc*i*alias: pci:v00008086d00001526sv*sd*bc*sc*i*alias: pci:v00008086d0000150Dsv*sd*bc*sc*i*alias: pci:v00008086d000010E7sv*sd*bc*sc*i*alias: pci:v00008086d000010E6sv*sd*bc*sc*i*alias: pci:v00008086d00001518sv*sd*bc*sc*i*alias: pci:v00008086d0000150Asv*sd*bc*sc*i*alias: pci:v00008086d000010C9sv*sd*bc*sc*i*alias: pci:v00008086d00000440sv*sd*bc*sc*i*alias: pci:v00008086d0000043Csv*sd*bc*sc*i*alias: pci:v00008086d0000043Asv*sd*bc*sc*i*alias: pci:v00008086d00000438sv*sd*bc*sc*i*alias: pci:v00008086d00001516sv*sd*bc*sc*i*alias: pci:v00008086d00001511sv*sd*bc*sc*i*alias: pci:v00008086d00001510sv*sd*bc*sc*i*alias: pci:v00008086d00001527sv*sd*bc*sc*i*alias: pci:v00008086d0000150Fsv*sd*bc*sc*i*alias: pci:v00008086d0000150Esv*sd*bc*sc*i*alias: pci:v00008086d00001524sv*sd*bc*sc*i*alias: pci:v00008086d00001523sv*sd*bc*sc*i*alias: pci:v00008086d00001522sv*sd*bc*sc*i*alias: pci:v00008086d00001521sv*sd*bc*sc*i*alias: pci:v00008086d00001539sv*sd*bc*sc*i*alias: pci:v00008086d0000157Csv*sd*bc*sc*i*alias: pci:v00008086d0000157Bsv*sd*bc*sc*i*alias: pci:v00008086d00001538sv*sd*bc*sc*i*alias: pci:v00008086d00001537sv*sd*bc*sc*i*alias: pci:v00008086d00001536sv*sd*bc*sc*i*alias: pci:v00008086d00001533sv*sd*bc*sc*i*alias: pci:v00008086d00001F45sv*sd*bc*sc*i*alias: pci:v00008086d00001F41sv*sd*bc*sc*i*alias: pci:v00008086d00001F40sv*sd*bc*sc*i*depends: hwmon,dcasupported: externalvermagic: 2.6.32.12-0.7-default SMP mod_unload modversionsparm: InterruptThrottleRate:Maximum interrupts per second, per vector, (max 100000), default 3=adaptive (array of int) parm: IntMode:Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default 2 (array of int)parm: Node:set the starting node to allocate memory on, default -1 (array of int)parm: LLIPort:Low Latency Interrupt TCP Port (0-65535), default 0=off (array of int)parm: LLIPush:Low Latency Interrupt on TCP Push flag (0,1), default 0=off (array of int)parm: LLISize:Low Latency Interrupt on Packet Size (0-1500), default 0=off (array of int)parm: RSS:Number of Receive-Side Scaling Descriptor Queues (0-8), default 1, 0=number of cpus (array of int)parm: VMDQ:Number of Virtual Machine Device Queues: 0-1 = disable, 2-8 enable, default 0 (array of int)parm: max_vfs:Number of Virtual Functions: 0 = disable, 1-7 enable, default 0 (array of int)parm: MDD:Malicious Driver Detection (0/1), default 1 = enabled. Only available when max_vfs is greater than 0 (array of int) parm: QueuePairs:Enable Tx/Rx queue pairs for interrupt handling (0,1), default 1=on (array of int)parm: EEE:Enable/disable on parts that support the feature (array of int)parm: DMAC:Disable or set latency for DMA Coalescing ((0=off, 1000-10000(msec), 250, 500 (usec)) (array of int)parm: LRO:Large Receive Offload (0,1), default 0=off (array of int)parm: enable_debug:Set to 1 to enable debug tracing into the syslog (uint)parm: debug:Debug level (0=none, ..., 16=all) (int)linux:~ #⽅法⼆:1:dmesg | grep ethx如:linux:~ # dmesg | grep eth17[ 30.351872] igb 0000:0a:00.1: eth17: (PCIe:2.5Gb/s:Width x4) 00:0b:ab:52:fb:b3[ 30.351952] igb 0000:0a:00.1: eth17: PBA No: ffffff-0ff[429171.548763] device eth17 entered promiscuous mode[429173.116530] igb: eth17 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX [429173.118867] ADDRCONF(NETDEV_UP): eth17: link is not ready[429173.121176] ADDRCONF(NETDEV_CHANGE): eth17: link becomes ready [429183.236266] eth17: no IPv6 routers present[1641503.272376] igb 0000:0a:00.1: eth17: (PCIe:2.5Gb/s:Width x4) 00:0b:ab:52:fb:b3 [1641503.272460] igb 0000:0a:00.1: eth17: PBA No: ffffff-0ff[1641598.356110] device eth17 entered promiscuous mode[1641598.369229] igb: eth17 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX [1641598.372636] ADDRCONF(NETDEV_UP): eth17: link is not ready [1641598.374978] ADDRCONF(NETDEV_CHANGE): eth17: link becomes ready [1641608.564181] eth17: no IPv6 routers present[1701779.787471] igb 0000:0a:00.1: eth17: (PCIe:2.5GT/s:Width x4)[1701779.787473] igb 0000:0a:00.1: eth17: MAC: 00:0b:ab:52:fb:b3[1701779.787555] igb 0000:0a:00.1: eth17: PBA No: FFFFFF-0FF[1702124.805650] device eth17 entered promiscuous mode[1702141.839131] ADDRCONF(NETDEV_UP): eth17: link is not ready [1702144.057474] igb: eth17 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None [1702144.059425] ADDRCONF(NETDEV_CHANGE): eth17: link becomes ready [1702154.705520] eth17: no IPv6 routers present[1712008.630151] igb 0000:0a:00.1: eth17: (PCIe:2.5GT/s:Width x4)[1712008.630153] igb 0000:0a:00.1: eth17: MAC: 00:0b:ab:52:fb:b3[1712008.630235] igb 0000:0a:00.1: eth17: PBA No: FFFFFF-0FF[1712100.136186] device eth17 entered promiscuous mode[1712101.873823] ADDRCONF(NETDEV_UP): eth17: link is not ready [1712104.159209] igb: eth17 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None [1712104.161548] ADDRCONF(NETDEV_CHANGE): eth17: link becomes ready [1712114.854722] eth17: no IPv6 routers presentlinux:~ #2:使⽤ modinfo igb 查看驱动信息(结果同⽅法⼀中的)。
linux下安装编译网卡驱动的方法你还在为不知道linux下安装编译网卡驱动的方法而不知所措么?下面来是小编为大家收集的linux下安装编译网卡驱动的方法,欢迎大家阅读:linux下安装编译网卡驱动的方法安装linux操作系统后发现没有网卡驱动,表现为system → Administration → Network下Hardware列表为空。
以下为安装编译网卡驱动的过程,本人是菜鸟,以下是我从网上找的资料进行整理,并实际操作的过程,仅供借鉴。
一.检测linux系统内核版本和网卡类型,相关命令如下:uname -r 查看linux内核版本(uname -a 可显示所有信息)lsmod 设备加载情况ls /usr/share/hwdata 查看硬件设备lspci 查看pci网卡设备ethernet controller 厂商和型号,modprobe **** ****为网卡型号,例如modprobe RTL8101E ,如果出错,说明模块不存在,该型号不识别我在这一步时查找不到网卡型号,无奈只能由同时采购的其他相同型号预装win7的电脑下查看网卡型号,是个笨办法,嘿嘿……找到网卡型号后就到驱动之家下载了相应网卡的linux驱动,这些需要根据自己的实际情况下载,不多说了,重点是后面。
二.下载网卡驱动Intel_e1000e-1.9.5.zip 为我下载的所需的网卡驱动,这个在linux下需自己编译.三.安装网卡驱动1.检测编译需要用到内核的源代码包和编译程序gcc。
所以如果没有的话,要先装。
[root@localhost ~]# rpm -qa|grep kernelkernel-xen-2.6.18-8.el5kernel-xen-devel-2.6.18-8.el5kernel-headers-2.6.18-8.el5[root@localhost ~]# rpm -qa|grep gccgcc-c++-4.1.1-52.el5libgcc-4.1.1-52.el5gcc-4.1.1-52.el5gcc-gfortran-4.1.1-52.el5如果缺少kernel-xen-devel-2.6.18-8.el5,可以去安装光盘的/Server/目录下,找到kernel-xen-devel-2.6.18-8.el5.i686.rpm 文件安装。
linux网卡驱动安装方法1、查找网卡芯片,确立网卡型号,并确立linux内核版本,到对应的网卡官网下载驱动。
2、安装步骤(这里以RTL8110为例)1)cd到网卡驱动所在文件夹,解压:# tar vjxf r8168-8.aaa.bb.tar.bz2//关于解压命令查看《Linux下软件包的解压方式大全》2)进入文件夹:# cd r8168-8.aaa.bb3)安装(需安装kernel-source,否则会失败):# make clean modules (as root or with sudo)# make install# depmod -a# insmod ./src/r8168.ko (or r8168.o in linux kernel 2.4.x)4)通过以下指令查看驱动是否已经启动.# lsmod | grep r8168# ifconfig -a如果能看到类似“ethX”的结果输出, 说明已成功驱动网卡.5)配置并激活ethX.# ifconfig ethX up,where X=0,1,2,...3、附realtek RTL8168B驱动readme文档:<Linux device driver for Realtek Ethernet controllers>This is the Linux device driver released for RealTek RTL8168B/8111Band RTL8168C/8111C, Gigabit Ethernet controllers with PCI-Expressinterface.<Requirements>- Kernel source tree (supported Linux kernel 2.6.x and 2.4.x)- For linux kernel 2.4.x, this driver supports 2.4.20 and latter.- Compiler/binutils for kernel compilation<Quick install with proper kernel settings>Unpack the tarball :# tar vjxf r8168-8.aaa.bb.tar.bz2Change to the directory:# cd r8168-8.aaa.bbIf you are running the target kernel, then you should be able to do :# make clean modules (as root or with sudo)# make install# depmod -a# insmod ./src/r8168.ko (or r8168.o in linux kernel 2.4.x)You can check whether the driver is loaded by using following commands.# lsmod | grep r8168# ifconfig -aIf there is a device name, ethX, shown on the monitor, the linuxdriver is loaded. Then, you can use the following command to activate the ethX.# ifconfig ethX up,where X=0,1,2,...<Set the network related information>1. Set manuallya. Set the IP address of your machine.# ifconfig ethX "the IP address of your machine"b. Set the IP address of DNS.Insert the following configuration in /etc/resolv.conf.nameserver "the IP address of DNS"c. Set the IP address of gateway.# route add default gw "the IP address of gateway"2. Set by doing configurations in /etc/sysconfig/network-scripts/ifcfg-ethX for Redhat and Fedora, or /etc/sysconfig/network/ifcfg-ethX for SuSE. There are two examples to set network configurations.a. Fix IP address:DEVICE=eth0BOOTPROTO=staticONBOOT=yesTYPE=ethernetNETMASK=255.255.255.0IPADDR=192.168.1.1GA TEWAY=192.168.1.254BROADCAST=192.168.1.255b. DHCP:DEVICE=eth0BOOTPROTO=dhcpONBOOT=yes<Modify the MAC address>There are two ways to modify the MAC address of the NIC.1. Use ifconfig:# ifconfig ethX hw ether YY:YY:YY:YY:YY:YY,where X is the device number assigned by Linux kernel, andYY:YY:YY:YY:YY:YY is the MAC address assigned by the user.2. Use ip:# ip link set ethX address YY:YY:YY:YY:YY:YY,where X is the device number assigned by Linux kernel, andYY:YY:YY:YY:YY:YY is the MAC address assigned by the user.<Force Link Status>1. Force the link status when insert the driver.If the user is in the path ~/r8168, the link status can be forcedto one of the 5 modes as following command.# insmod ./src/r8168.ko speed=SPEED_MODE duplex=DUPLEX_MODE autoneg=NWAY_OPTION,whereSPEED_MODE = 1000 for 1000Mbps= 100 for 100Mbps= 10 for 10MbpsDUPLEX_MODE = 0 for half-duplex= 1 for full-duplexNW AY_OPTION = 0 for auto-negotiation off (true force)= 1 for auto-negotiation on (nway force)For example:# insmod ./src/r8168.ko speed=100 duplex=0 autoneg=1will force PHY to operate in 100Mpbs Half-duplex(nway force).2. Force the link status by using ethtool.a. Insert the driver first.b. Make sure that ethtool exists in /sbin.c. Force the link status as the following command.# ethtool -s ethX speed SPEED_MODE duplex DUPLEX_MODE autoneg NWAY_OPTION,whereSPEED_MODE = 1000 for 1000Mbps= 100 for 100Mbps= 10 for 10MbpsDUPLEX_MODE = half for half-duplex= full for full-duplexNW AY_OPTION = off for auto-negotiation off (true force)= on for auto-negotiation on (nway force)For example:# ethtool -s eth0 speed 100 duplex full autoneg on本文出自:中国E动网[]中国领先互联网接入服务提供商!11年品质保障!-- 中国E动网[]。