输入mii-tool可以查看网线是否连接到网卡
有时驱动可能不支持会出错下列错误
可以使用ethtool查看
Link detected: yes为正常no为失败
mii-tool 的用法:
mii-tool 在更改网络设备通信协商方式的方法比较简单,用 -v 参数来查看网络接口的状态;看下面的例子;
mii-tool 更改网络接口协商的方法;
[root@localhost ~]# mii-tool --help
usage: mii-tool [-VvRrwl] [-A media,... | -F media] [interface ...]
-V, --version display version information
-v, --verbose more verbose output 注:显示网络接口的信息;
-R, --reset reset MII to poweron state 注:重设MII到开启状态;
-r, --restart restart autonegotiation 注:重启自动协商模式;
-w, --watch monitor for link status changes 注:查看网络接口连接的状态变化;
-l, --log with -w, write events to syslog 注:写入事件到系统日志;
-A, --advertise=media,... advertise only specified media 注:指令特定的网络接口;
-F, --force=media force specified media technology 注:更改网络接口协商方式;
media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
(to advertise both HD and FD) 100baseTx, 10baseT
example:
[at_Neal:root:~:]# mii-tool
eth0: negotiated 100baseTx-FD flow-control, link ok
eth1: no link
eth2: negotiated 100baseTx-FD flow-control, link ok
ifconfig ethn ip,n是代表第几个网卡,第一个从0开始,ifdown ethn是关闭网卡,ifup是开启网卡,ifconfig是设置临时ip的,重启之后就不生效了,可以在/etc/sysconfig/network-scripts/ifcfg-eth0更改,设置永久ip,另外设置网关的话可以在里面设也可以用命令,route add default gw ip来添加默认网关,设置完毕之后,可以重启下网卡,service network restart欢迎分享,转载请注明来源:内存溢出
评论列表(0条)