linux下ethtool的使用

2022-09-23 03:02:10 字數 3752 閱讀 9532

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:

108lo 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

foreth0:

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:

0transceiver: 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

foreth0:

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:

0transceiver: 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

ethtool使用記錄

網絡卡出現很詭異的問題,把電腦連到一些交換機上是工作的,連到另外一些就不行。。。交換機上的link燈還時不時的閃一下,看起來像是在嘗試連線。...

Linux下seq的使用

seq print a sequence of numbers root gechong man seq 主要有一下三個引數 f 用來格式化...

Linux下VI的使用

vi使用手冊 vi是unix上最常用的文字編輯工具,作為unix軟體測試人員,有必要熟練掌握它。 進入vi的命令 vi filename 開...