1:系统是否识别网卡
2: 安装驱动加载对应模块
使用lsmod modprobe 配合修改 /etc/modprobe.conf
[root@HC-PBX ~]# modprobe -l | grep 8139
/lib/modules/2.6.18-238.el5PAE/kernel/drivers/net/8139cp.ko
/lib/modules/2.6.18-238.el5PAE/kernel/drivers/net/8139too.ko
驱动正常安装后都会存放到 /lib/modules/<kernel_version>/kernel/drivers/net/*.ko文件
[root@nagios ~]# ethtool -i eth0
driver: b44
version: 1.01
firmware-version:
bus-info: 0000:04:07.0
[root@nagios ~]# modprobe -l | grep b44
/lib/modules/2.6.18-238.el5/kernel/drivers/net/b44.ko
3: 建立网卡配置文件
[root@HC-PBX ~]# cd /etc/sysconfig/network-scripts/
建立ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=C8:1F:66:20:82:EF
IPADDR=192.168.6.2
NETMASK=255.255.255.0
GATEWAY=192.168.6.1
ONBOOT=yes
4:启动网卡 ifconfig eth0 up
5: 路由添加 route add default gw 192.168.6.1
或者 ip route add default via 192.168.6.1 dev eth0
6:查看相关路由规则是否正常
[root@backup ~]# ip rule 默认路由表有3个;实际在使用main表
0: from all lookup 255
32766: from all lookup main
32767: from all lookup default
关于网卡出现问题等链路层判断故障 相关命令:
判断网线连接状态:
[root@backup ~]# mii-tool
eth0: negotiated 100baseTx-FD, link ok
或者
[root@backup ~]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:1f:d0:d3:65:bb brd ff:ff:ff:ff:ff:ff