当前位置:文档之家› linux网卡驱动的配置

linux网卡驱动的配置

RedHat5.1下安装Realtek8168网卡驱动1.先识别机器上的网卡型号:[root@localhost kernel]#kudzu --probe --class=network2、使用命令查看kernel包是否都装全了,具体如下:[root@localhost kernel]# rpm -qa | grep kernel如果装全了,会显示如下几个包:kernel-xen-devel-2.6.18-8.el5kernel-devel-2.6.18-8.el5kernel-2.6.18-8.el5kernel-xen-2.6.18-8.el5kernel-headers-2.6.18-8.el5如果没有装全,就在redhat enterprise Linux 5.0第一个ISO的Server文件目录下可以找到对应的包,拷贝到某一具体目录下,进入目录后,用如下命令就可以进行安装:[root@localhost kernel]# rpm -ivhkernel-devel-2.6.18-8.el5.x86_64.rpm注意:如果不装全这些包,在网卡编译时就会报错说找不到src目录文件。

用如下命令查看GCC是否安装,通常都装上的,还是检查一下比较好。

[root@localhost 2.6.18-8.el5]# whereis -b gccgcc : /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc3、将r8168-8.aaa.bb.tar.bz2解压出来变成r8168-8.aaa.bb文件夹形式,拷到U盘在redhat下挂载U盘:插入U盘[root@localhost kernel]#mount /dev/sdb1 /mnt/usb4.将r8168-8.aaa.bb文件夹拷都本地,如/home目录下首先将u盘中的驱动程序包拷贝到/home目录下[root@localhost media]# cp r8168-8\[1\].011.00.tar.bz2 /home/ [root@localhost media]# cd /home/[root@localhost home]# lsr8168-8[1].011.00.tar.bz25.其次解压驱动程序包[root@localhost home]# tar -vjxf r8168-8\[1\].011.00.tar.bz2r8168-8.011.00/r8168-8.011.00/src/r8168-8.011.00/src/r8168_n.cr8168-8.011.00/src/Makefiler8168-8.011.00/src/r8168_asf.hr8168-8.011.00/src/r8168.hr8168-8.011.00/src/r8168_asf.cr8168-8.011.00/src/Makefile_linux24xr8168-8.011.00/Makefiler8168-8.011.00/readme[root@localhost home]# lsr8168-8.011.00 r8168-8[1].011.00.tar.bz2[root@localhost home]# cd r8168-8[root@localhost r8168-8.011.00]# lsMakefile readme src6.[root@localhost r8168-8.011.00]# make clean modulesmake -C src/ cleanmake[1]: Entering directory `/home/r8168-8.011.00/src'rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers *.ordermake[1]: Leaving directory `/home/r8168-8.011.00/src'make -C src/ modulesmake[1]: Entering directory `/home/r8168-8.011.00/src'make -C /lib/modules/2.6.18-53.el5xen/build SUBDIRS=/home/r8168-8.011.00/src modulesmake[2]: Entering directory `/usr/src/kernels/2.6.18-53.el5-xen-i686'CC [M] /home/r8168-8.011.00/src/r8168_n.o/home/r8168-8.011.00/src/r8168_n.c: 在函数‘rtl8168_tx_clear’中:/home/r8168-8.011.00/src/r8168_n.c:4154: 警告:未使用的变量‘dev’CC [M] /home/r8168-8.011.00/src/r8168_asf.oLD [M] /home/r8168-8.011.00/src/r8168.oBuilding modules, stage 2.MODPOSTCC /home/r8168-8.011.00/src/r8168.mod.oLD [M] /home/r8168-8.011.00/src/r8168.komake[2]: Leaving directory `/usr/src/kernels/2.6.18-53.el5-xen-i686'strip --strip-debug r8168.komake[1]: Leaving directory `/home/r8168-8.011.00/src'7.[root@localhost r8168-8.011.00]# make installmake -C src/ installmake[1]: Entering directory `/home/r8168-8.011.00/src'install -m 744 -c r8168.ko /lib/modules/2.6.18-53.el5xen/kernel/drivers/net/ make[1]: Leaving directory `/home/r8168-8.011.00/src'[root@localhost r8168-8.011.00]# depmod –a[root@localhost r8168-8.011.00]# modprobe r8168[root@localhost r8168-8.011.00]# lsmod | grep r8168r8168 44564 0[root@localhost r8168-8.011.00]# ifconfig -aeth0 Link encap:Ethernet HWaddr 00:24:81:F2:99:75BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)Interrupt:17 Base address:0xc000lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:16436 Metric:1RX packets:1195 errors:0 dropped:0 overruns:0 frame:0TX packets:1195 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:1904847 (1.8 MiB) TX bytes:1904847 (1.8 MiB)sit0 Link encap:IPv6-in-IPv4NOARP MTU:1480 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)veth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)veth1 Link encap:Ethernet HWaddr 00:00:00:00:00:00BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)veth2 Link encap:Ethernet HWaddr 00:00:00:00:00:00BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)veth3 Link encap:Ethernet HWaddr 00:00:00:00:00:00BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)vif0.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FFBROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)vif0.1 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FFBROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)vif0.2 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FFBROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)vif0.3 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FFBROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0inet6 addr: fe80::200:ff:fe00:0/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:46 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 b) TX bytes:8446 (8.2 KiB)xenbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00inet6 addr: fe80::200:ff:fe00:0/64 Scope:LinkUP BROADCAST RUNNING NOARP MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)8.[root@localhost r8168-8.011.00]# ifconfig eth0 up[root@localhost r8168-8.011.00]# ifconfig eth0eth0 Link encap:Ethernet HWaddr 00:24:81:F2:99:75inet6 addr: fe80::224:81ff:fef2:9975/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:438 errors:0 dropped:0 overruns:0 frame:0TX packets:16 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:36745 (35.8 KiB) TX bytes:4518 (4.4 KiB)Interrupt:17 Base address:0xc0009.配置ip地址[root@localhost r8168-8.011.00]# ifconfig eth0 "10.10.112.1"10.配置网关[root@localhost r8168-8.011.00]# route add default gw "10.10.112.254"然后单击菜单栏的系统下面的“管理”下的“网络“界面,在此界面里面配置下DNS,然后单击保存,即可。

相关主题