Centos 6.2安装完成之后,赶紧运行lspci,来查看硬件信息,结果很让人失望:
[root@localhost ~]# lspci
-bash: lspci: command not found
接下来运行:
[root@localhost ~]# yum -y install pciutils
发现无法上网,再运行:
[root@localhost ~]# ifconfig
lo Link encap:Local 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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
竟然没有eth0/eth1的信息,很郁闷。
从网上下载pciutils-2.2.0.tar.gz,然后通过U盘安装,之后发现lspci终于可以用了。
[root@localhost ~]# lspci
00:00.0 Host bridge: Intel Corporation Unknown device 29c0 (rev 10)
00:02.0 VGA compatible controller: Intel Corporation Unknown device 29c2 (rev 10)
00:1b.0 Class 0403: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) Serial ATA Storage Controllers cc=IDE (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. Unknown device 8136 (rev 02)
03:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
然后查看系统内核是否包含了网卡的驱动信息。
[root@localhost ~]# cd /lib/modules/2.6.32-220.el6.i686/kernel/drivers/net/
[root@localhost net]# ls
3c509.ko bnx2.ko e100.ko jme.ko pcmcia r6040.ko sundance.ko virtio_net.ko
3c59x.ko bnx2x enic macvlan.ko pcnet32.ko r8169.ko sungem.ko vmxnet3
8139cp.ko bonding epic100.ko macvtap.ko phy s2io.ko sungem_phy.ko vxge
8139too.ko can ethoc.ko mdio.ko ppp_async.ko sc92031.ko sunhme.ko wan
8390.ko cassini.ko ewrk3.ko mii.ko ppp_deflate.ko sfc tehuti.ko wimax
8390p.ko chelsio fealnx.ko mlx4 ppp_generic.ko sis190.ko tg3.ko wireless
acenic.ko cnic.ko forcedeth.ko myri10ge ppp_mppe.ko sis900.ko tlan.ko xen-netfront.ko
amd8111e.ko cxgb3 ifb.ko natsemi.ko pppoe.ko skge.ko tulip
atl1c cxgb4 igb ne2k-pci.ko pppol2tp.ko sky2.ko tun.ko
atl1e dl2k.ko igbvf ne.ko pppox.ko slhc.ko typhoon.ko
atlx dnet.ko ipg.ko netconsole.ko ppp_synctty.ko slip.ko usb
b44.ko dummy.ko ixgb netxen qla3xxx.ko smc-ultra.ko veth.ko
benet e1000 ixgbe niu.ko qlcnic smsc9420.ko via-rhine.ko
bna e1000e ixgbevf ns83820.ko qlge starfire.ko via-velocity.ko
重新加载一下网卡驱动:
[root@localhost net]# insmod 8139too.ko
[root@localhost net]# insmod 8139cp.ko
[root@localhost net]# ethtool -i eth1
driver: 8139too
version: 0.9.28
firmware-version:
bus-info: 0000:03:07.0
再次运行:
[root@localhost net]# service network restart
[root@localhost net]# ifconfig
lo Link encap:Local 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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
再次郁闷!
直接用命令配置IP:
[root@localhost net]# ifconfig eth1 192.168.1.123
[root@localhost net]# ifconfig
eth1 Link encap:Ethernet HWaddr 4C:00:10:42:10:3B
inet addr:192.168.1.123 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::4e00:10ff:fe42:103b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:518 errors:0 dropped:0 overruns:0 frame:0
TX packets:315 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:46693 (45.5 KiB) TX bytes:47572 (46.4 KiB)
Interrupt:23 Base address:0x4c00
lo Link encap:Local 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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
测试一下是否正常:
[root@localhost ~]# ping 192.168.1.212
PING 192.168.1.212 (192.168.1.212) 56(84) bytes of data.
64 bytes from 192.168.1.212: icmp_seq=1 ttl=64 time=2.41 ms
64 bytes from 192.168.1.212: icmp_seq=2 ttl=64 time=0.633 ms
64 bytes from 192.168.1.212: icmp_seq=3 ttl=64 time=0.633 ms
64 bytes from 192.168.1.212: icmp_seq=4 ttl=64 time=0.674 ms
OK,成功了!
转载于:https://blog.51cto.com/hyrieshu/1157002