網絡卡引數查詢及設定工具ethtool

2021-07-26 04:46:06 字數 4902 閱讀 4671

ethtool是用來查詢和設定網絡卡驅動&硬體資訊的工具,功能很強大!linux一般都會預設安裝,在進行網路除錯和網路效能分析時非常有用。提供統計資訊查詢、ring buffer設定、協議解除安裝設定、網絡卡測試等等……

自己在進行ddos攻擊模擬、分析和測試中經常使用!

以網絡卡p5p2為例

[root@globus03 20160924]# ethtool -g p5p2

ring parameters for p5p2:

pre-set maximums:

rx:4078

rx mini: 0

rx jumbo: 0

tx:4078

current hardware settings:

rx:2014

rx mini: 0

rx jumbo: 0

tx:4078

[root@globus03 20160924]# ethtool -g p5p2 rx 4078

[root@globus03 20160924]# ethtool -g p5p2

ring parameters for p5p2:

pre-set maximums:

rx:4078

rx mini: 0

rx jumbo: 0

tx:4078

current hardware settings:

rx:4078

rx mini: 0

rx jumbo: 0

tx:4078

[root@globus03

20160924]# ethtool -i p5p2

driver: bnx2x

version: 1.710

.51-0

firmware-version: ffv7.12

.19 bc 7.12

.5 phy 1.45

bus-info: 0000:06:00.1

supports-statistics: yes

supports-test: yes

supports-eeprom-access: yes

supports-register-dump: yes

supports-priv-flags: yes

[root@globus03 20160924]# ethtool p5p2

settings for p5p2:

supported ports: [ tp ]

supported link modes: 100baset/half 100baset/full

1000baset/full

10000baset/full

supported pause frame use: symmetric receive-only

supports auto-negotiation: yes

advertised link modes: 100baset/half 100baset/full

1000baset/full

10000baset/full

advertised pause frame use: symmetric receive-only

advertised auto-negotiation: yes

link partner advertised link modes: 100baset/half 100baset/full

1000baset/half 1000baset/full

10000baset/full

link partner advertised pause frame use: no

link partner advertised auto-negotiation: yes

speed: 10000mb/s

duplex: full

port: twisted pair

phyad: 17

transceiver: internal

auto-negotiation: on

mdi-x: unknown

supports wake-on: g

wake-on: d

current message level: 0x00000000 (0)

link detected: yes

[root@globus03 ~]# ethtool -t p5p2 online

the test result is pass

the test extra info:

register_test

(offline) 0

memory_test

(offline) 0

int_loopback_test

(offline) 0

ext_loopback_test

(offline) 0

nvram_test

(online) 0

interrupt_test

(online) 0

link_test

(online) 0

[root@globus03 ~]# ethtool -s em2 | grep -i error

rx_fcs_errors: 0

rx_align_errors: 0

rx_frame_too_long_errors: 0

rx_in_length_errors: 0

rx_out_length_errors: 0

tx_mac_errors: 0

tx_carrier_sense_errors: 0

tx_errors: 0

[root@globus03 ~]# ethtool -s em2 | grep -i rx

rx_octets:

0rx_fragments:

0rx_ucast_packets:

0rx_mcast_packets:

0rx_bcast_packets:

0rx_fcs_errors:

0…………

offload 是將本來該作業系統進行的一些資料報處理(如分片、重組等)放到網絡卡硬體中去做,降低系統 cpu 消耗的同時,提高處理的效能。

[root@globus03 ~]# ethtool -k p5p2

features for

p5p2:

rx-checksumming: on

tx-checksumming: on

tx-checksum-ipv4: on

tx-checksum-ip-generic: off [fixed]

tx-checksum-ipv6: on

tx-checksum-fcoe-crc: off [fixed]

tx-checksum-sctp: off [fixed]

scatter-gather: on

tx-scatter-gather: on

tx-scatter-gather-fraglist: off [fixed]

tcp-segmentation-offload: on

tx-tcp-segmentation: on

tx-tcp-ecn-segmentation: on

tx-tcp6-segmentation: on

udp-fragmentation-offload: off [fixed]

generic-segmentation-offload: on

generic-receive-offload: on

large-receive-offload: off

rx-vlan-offload: on [fixed]

tx-vlan-offload: on

ntuple-filters: off [fixed]

receive-hashing: on

highdma: on [fixed]

rx-vlan-filter: off [fixed]

vlan-challenged: off [fixed]

tx-lockless: off [fixed]

netns-local: off [fixed]

tx-gso-robust: off [fixed]

tx-fcoe-segmentation: off [fixed]

tx-gre-segmentation: on

tx-ipip-segmentation: on

tx-sit-segmentation: on

tx-udp_tnl-segmentation: on

tx-mpls-segmentation: off [fixed]

fcoe-mtu: off [fixed]

tx-nocache-copy: off

loopback: off

rx-fcs: off [fixed]

rx-all: off [fixed]

tx-vlan-stag-hw-insert: off [fixed]

rx-vlan-stag-hw-parse: off [fixed]

rx-vlan-stag-filter: off [fixed]

busy-poll: on [fixed]

linux下如何檢視設定網絡卡速度 ethtool

使用核心自帶的工具ethtool可以檢視和設定網絡卡的網速 ethtool ethx 查詢ethx網口基本設定 ethtool h 顯示ethtool的命令幫助 help ethtool i ethx 查詢ethx網口的相關資訊 ethtool d ethx 查詢ethx網口註冊性資訊 ethtoo...

centos 中設定網絡卡等相關引數

centos啟動和禁用網絡卡命令 ifup ifdown linux命令 實時地手動修改一些網路介面引數,可以利用ifconfig來實現,如果是要直接以配置檔案,在 etc sysconfig network scripts裡面的ifcfg ethx等檔案的設定引數來啟動的話,那就得要通過ifdow...

ethtool 網絡卡配置檢視及修改工具

命令描述 ethtool 是用於查詢及設定網絡卡引數的命令。使用概要 ethtool ethx 查詢ethx網口基本設定,其中 x 是對應網絡卡的編號,如eth0 eth1等等 ethtool h 顯示ethtool的命令幫助 help ethtool i ethx 查詢ethx網口的相關資訊 et...