ethtool查看网卡以及修改网卡配置

更新时间:2023-06-06 16:24:10 阅读: 评论:0

ethtool查看⽹卡以及修改⽹卡配置
ethtool 命令详解
命令描述:
ethtool 是⽤于查询及设置⽹卡参数的命令。
使⽤概要:
ethtool ethx      //查询ethx⽹⼝基本设置,其中 x 是对应⽹卡的编号,如eth0、eth1等等
ethtool –h        //显⽰ethtool的命令帮助(help)
ethtool –i ethX    //查询ethX⽹⼝的相关信息
ethtool –d ethX    //查询ethX⽹⼝注册性信息
ethtool –r ethX    //重置ethX⽹⼝到⾃适应模式
ethtool –S ethX    //查询ethX⽹⼝收发包统计
ethtool -p  ethx    //查看对应的⽹卡灯闪烁
ethtool –s ethX [speed 10|100|1000] [duplex half|full]  [autoneg on|off]        //设置⽹⼝速率10/100/1000M、设置⽹⼝半/全双⼯、设置⽹⼝是否⾃协商
1)[root@linux /]# ethtool eth1          //查看⽹卡1信息
Settings for eth1:
Supported ports: [ TP ]
Supported link modes:  10baT/Half 10baT/Full
100baT/Half 100baT/Full
1000baT/Full
Supports auto-negotiation: Yes
Advertid link modes: 10baT/Half 10baT/Full
100baT/Half 100baT/Full
1000baT/Full
win是哪个键
Advertid auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
铃兰PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: umbg
Wake-on: d
Link detected: yes品牌服饰
2)[root@linux /]# ethtool -i eth1          //查看⽹卡型号等
driver: e1000
version: 5.0.43-k1
家风作文600字firmware-version: N/A
bus-info: 06:08.1
3)[root@linux /]# ethtool -S eth1          //查看数据率等
NIC statistics:
rx_packets: 58068300
tx_packets: 87124083
rx_bytes: 1589713008
tx_bytes: 2165825901
rx_errors: 0
tx_errors: 0
rx_dropped: 0
tx_dropped: 0
multicast: 0
collisions: 0
rx_length_errors: 0
rx_over_errors: 0
野鸡做法rx_crc_errors: 0
rx_frame_errors: 0
rx_fifo_errors: 0
rx_misd_errors: 0
tx_aborted_errors: 0
tx_carrier_errors: 0
tx_fifo_errors: 0
tx_heartbeat_errors: 0
tx_window_errors: 0
//强制修改⽹卡速率,配置成百兆⽹卡,autoneg off是⼀定要⽤,如果是on的话就是⾃适应配置,⾃动根据机器等进⾏配置。
4)[root@linux /]# ethtool -s eth1 autoneg off speed 100 duplex full
相关参考:
1)[root@linux /]# which ethtool        //查询 ethtool 存放的路径
/sbin/ethtool
内存占用2)[root@linux /]# rpm -qf /sbin/ethtool        //查询 ethtool 的版本信息
家乡的春天作文
ethtool-1.6-5
3)将 ethtool 设置永久保存在⽹络设备的⽅法
解决⽅法⼀:
ethtool 设置可通过 /etc/sysconfig/network-scripts/ifcfg-ethX ⽂件保存,从⽽在设备下次启动时激活选项。
例如:ethtool -s eth0 speed 100 duplex full autoneg off
此指令将eth0设备设置为全双⼯⾃适应,速度为100Mbs。若要eth0启动时设置这些参数, 修改⽂件/etc/sysconfig/network-scripts/ifcfg-eth0,添加如下⼀⾏:
人民的作用ETHTOOL_OPTS="speed 100 duplex full autoneg off"
解决⽅法⼆:
将ethtool设置写⼊/etc/rc.d/rc.local之中。

本文发布于:2023-06-06 16:24:10,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1006174.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:设置   查看   查询   命令   修改   参数
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图