码迷,mamicode.com
首页 > 系统相关 > 详细

linux下ethtool的使用

时间:2020-08-14 23:18:38      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:int   自动   eth0   speed   drop   mtu   collision   ifup   auto   

1、使用ifconfig查看当前网卡

/ # ifconfig
bridge0   Link encap:Ethernet  HWaddr 4A:B3:0C:01:C1:8B  
          inet addr:172.31.234.26  Bcast:172.31.234.27  Mask:255.255.255.252
          inet6 addr: fe80::48b3:cff:fefe:be88/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2752 errors:0 dropped:0 overruns:0 frame:0
          TX packets:745 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:192468 (187.9 KiB)  TX bytes:47651 (46.5 KiB)

eth0      Link encap:Ethernet  HWaddr 00:80:48:BA:D1:30  
          inet addr:169.254.4.1  Bcast:169.254.4.255  Mask:255.255.255.0
          inet6 addr: fe80::280:48ff:feba:d130/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4867 errors:5 dropped:9 overruns:0 frame:2
          TX packets:715 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:490146 (478.6 KiB)  TX bytes:58813 (57.4 KiB)
          Interrupt:108 

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:65536  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:400 (400.0 B)  TX bytes:400 (400.0 B)

2、使用ethtool eth0查看网卡信息

/ # ethtool eth0
Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                         100baseT/Half 100baseT/Full 
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: external
    Auto-negotiation: on
    Supports Wake-on: pg
    Wake-on: p
    Current message level: 0x00007fff (32767)
                   drv probe link timer ifdown ifup rx_err tx_err tx_queued intr tx_done rx_status pktdata hw wol
    Link detected: yes

3、修改网卡配置

ethtool -s eth0 speed 10 duplex full autoneg off

将网卡eth0对应的物理端口设置为速率10Mbps,全双工工作模式,关闭自动协商。

4、查看网卡信息,配置成功

/ # ethtool eth0
Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Full 
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: No
    Speed: 10Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: external
    Auto-negotiation: off
    Supports Wake-on: pg
    Wake-on: p
    Current message level: 0x00007fff (32767)
                   drv probe link timer ifdown ifup rx_err tx_err tx_queued intr tx_done rx_status pktdata hw wol
    Link detected: yes

 

linux下ethtool的使用

标签:int   自动   eth0   speed   drop   mtu   collision   ifup   auto   

原文地址:https://www.cnblogs.com/wmate/p/13500690.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!