linux网卡驱动安装方法.doc

上传人:桔**** 文档编号:560326696 上传时间:2023-07-02 格式:DOC 页数:4 大小:23.50KB
返回 下载 相关 举报
linux网卡驱动安装方法.doc_第1页
第1页 / 共4页
linux网卡驱动安装方法.doc_第2页
第2页 / 共4页
linux网卡驱动安装方法.doc_第3页
第3页 / 共4页
linux网卡驱动安装方法.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《linux网卡驱动安装方法.doc》由会员分享,可在线阅读,更多相关《linux网卡驱动安装方法.doc(4页珍藏版)》请在金锄头文库上搜索。

1、linux网卡驱动安装方法1、查找网卡芯片,确立网卡型号,并确立linux内核版本,到对应的网卡官网下载驱动。 2、安装步骤(这里以RTL8110为例) 1)cd到网卡驱动所在文件夹,解压 : # tar vjxf r8168-8.aaa.bb.tar.bz2 /关于解压命令查看Linux下软件包的解压方式大全 2)进入文件夹: # cd r8168-8.aaa.bb 3)安装(需安装kernel-source,否则会失败) : # make clean modules (as root or with sudo) # make install # depmod -a # insmod ./s

2、rc/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文档: This is the Linux device driver released for RealTek RTL8168B/8111B and RTL8168C/8111C

3、, Gigabit Ethernet controllers with PCI-Express interface. - 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 Unpack the tarball : # tar vjxf r8168-8.aaa.bb.tar.bz2 Change to the d

4、irectory: # cd r8168-8.aaa.bb If 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

5、. # lsmod | grep r8168 # ifconfig -a If there is a device name, ethX, shown on the monitor, the linux driver is loaded. Then, you can use the following command to activate the ethX. # ifconfig ethX up ,where X=0,1,2,. 1. Set manually a. Set the IP address of your machine. # ifconfig ethX the IP addr

6、ess 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 f

7、or Redhat and Fedora, or /etc/sysconfig/network /ifcfg-ethX for SuSE. There are two examples to set network configurations. a. Fix IP address: DEVICE=eth0 BOOTPROTO=static ONBOOT=yes TYPE=ethernet NETMASK=255.255.255.0 IPADDR=192.168.1.1 GATEWAY=192.168.1.254 BROADCAST=192.168.1.255 b. DHCP: DEVICE=

8、eth0 BOOTPROTO=dhcp ONBOOT=yes 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, and YY:YY:YY:YY:YY:YY is the MAC address assigned by the user. 2. Use ip: # ip link set ethX add

9、ress YY:YY:YY:YY:YY:YY ,where X is the device number assigned by Linux kernel, and YY:YY:YY:YY:YY:YY is the MAC address assigned by the user. 1. Force the link status when insert the driver. If the user is in the path /r8168, the link status can be forced to one of the 5 modes as following command.

10、# insmod ./src/r8168.ko speed=SPEED_MODE duplex=DUPLEX_MODE autoneg=NWAY_OPTION ,where SPEED_MODE = 1000 for 1000Mbps = 100 for 100Mbps = 10 for 10Mbps DUPLEX_MODE = 0 for half-duplex = 1 for full-duplex NWAY_OPTION = 0 for auto-negotiation off (true force) = 1 for auto-negotiation on (nway force) F

11、or example: # insmod ./src/r8168.ko speed=100 duplex=0 autoneg=1 will 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. # ethtoo

12、l -s ethX speed SPEED_MODE duplex DUPLEX_MODE autoneg NWAY_OPTION ,where SPEED_MODE = 1000 for 1000Mbps = 100 for 100Mbps = 10 for 10Mbps DUPLEX_MODE = half for half-duplex = full for full-duplex NWAY_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动网EDONG.COM中国领先互联网接入服务提供商!11年品质保障!- 中国E动网EDONG.COM

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号