网络工具
查看接口表
netstat -i
Kernel Interface table
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
br-774b7 1500 4 0 0 0 4 0 0 0 BMU
br-b862c 1500 4923530 0 0 0 7183807 0 0 0 BMRU
br-da011 1500 64977274 0 0 0 69630761 0 0 0 BMRU
docker0 1500 21735567 0 0 0 42604103 0 0 0 BMRU
ens192 1500 271099665 0 1688 0 230410104 0 0 0 BMRU
lo 65536 45954311 0 0 0 45954311 0 0 0 LRU
tun0 1500 12195288 0 0 0 17625345 0 18745 0 MOPRU
veth053d 1500 17265 0 0 0 15687 0 0 0 BMRU
veth3064 1500 14258104 0 0 0 11737730 0 0 0 BMRU
veth6101 1500 101678 0 0 0 100146 0 0 0 BMRU
veth6b42 1500 224127 0 0 0 442841 0 0 0 BMRU
veth719d 1500 12578201 0 0 0 24700846 0 0 0 BMRU
veth9634 1500 5359419 0 0 0 9985099 0 0 0 BMRU
veth96c0 1500 59343712 0 0 0 63301700 0 0 0 BMRU
sudo ifconfig
br-774b76b46142: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.21.0.1 netmask 255.255.0.0 broadcast 172.21.255.255
ether 02:42:05:5b:5f:17 txqueuelen 0 (Ethernet)
RX packets 4 bytes 224 (224.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 430 (430.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-b862c865cf21: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255
ether 02:42:bb:5c:3b:73 txqueuelen 0 (Ethernet)
RX packets 4923846 bytes 791737192 (755.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7184265 bytes 1223306426 (1.1 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-da01119a1af0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.20.0.1 netmask 255.255.0.0 broadcast 172.20.255.255
ether 02:42:54:2c:52:4f txqueuelen 0 (Ethernet)
RX packets 64985636 bytes 75500339843 (70.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 69639888 bytes 74419789810 (69.3 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:dd:70:ec:35 txqueuelen 0 (Ethernet)
RX packets 21737017 bytes 1333712084 (1.2 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 42606938 bytes 6922022067 (6.4 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.111 netmask 255.255.255.0 broadcast 192.168.1.255
ether 00:50:56:aa:9c:b9 txqueuelen 1000 (Ethernet)
RX packets 271117458 bytes 143191307939 (133.3 GiB)
RX errors 0 dropped 1688 overruns 0 frame 0
TX packets 230425325 bytes 133872654754 (124.6 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 45956510 bytes 8025669401 (7.4 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 45956510 bytes 8025669401 (7.4 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 192.168.255.1 netmask 255.255.255.255 destination 192.168.255.2
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 12195288 bytes 2414058764 (2.2 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17625345 bytes 18031744355 (16.7 GiB)
TX errors 0 dropped 18745 overruns 0 carrier 0 collisions 0
veth053d082: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether a6:7d:3b:7a:a8:2c txqueuelen 0 (Ethernet)
RX packets 17265 bytes 3561993 (3.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15688 bytes 3599580 (3.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth3064aa5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 76:a6:4d:e6:87:f0 txqueuelen 0 (Ethernet)
RX packets 14259158 bytes 3631191257 (3.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11738581 bytes 3209074686 (2.9 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth61016dc: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether fa:10:42:b3:90:bb txqueuelen 0 (Ethernet)
RX packets 101678 bytes 72346824 (68.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 100146 bytes 10932480 (10.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth6b42532: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether ca:c4:0d:11:1c:1c txqueuelen 0 (Ethernet)
RX packets 224127 bytes 16225430 (15.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 442841 bytes 76546942 (73.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth719df73: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 0a:e8:c9:48:72:6c txqueuelen 0 (Ethernet)
RX packets 12579651 bytes 909893850 (867.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 24703681 bytes 3892088947 (3.6 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth9634e8a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 6a:e2:9f:77:d7:86 txqueuelen 0 (Ethernet)
RX packets 5359812 bytes 2149311232 (2.0 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9985837 bytes 2884764390 (2.6 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth96c0f59: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 92:9c:5c:72:1c:bb txqueuelen 0 (Ethernet)
RX packets 59352074 bytes 69785863213 (64.9 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 63310827 bytes 67982895759 (63.3 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
sudo ip -s link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
RX: bytes packets errors dropped missed mcast
8025681965 45956723 0 0 0 0
TX: bytes packets errors dropped carrier collsns
8025681965 45956723 0 0 0 0
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:50:56:aa:9c:b9 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped missed mcast
143191531060 271118567 0 1688 0 0
TX: bytes packets errors dropped carrier collsns
133872803305 230426392 0 0 0 0
altname enp11s0
4: br-774b76b46142: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
link/ether 02:42:05:5b:5f:17 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped missed mcast
224 4 0 0 0 0
TX: bytes packets errors dropped carrier collsns
430 4 0 0 0 0
5: br-b862c865cf21: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
link/ether 02:42:bb:5c:3b:73 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped missed mcast
791743058 4923880 0 0 0 0
TX: bytes packets errors dropped carrier collsns
1223315055 7184315 0 0 0 0
6: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
link/ether 02:42:dd:70:ec:35 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped missed mcast
1333722079 21737190 0 0 0 0
TX: bytes packets errors dropped carrier collsns
6922074950 42607275 0 0 0 0
10: veth6b42532@if9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-b862c865cf21 state UP mode DEFAULT group default
link/ether ca:c4:0d:11:1c:1c brd ff:ff:ff:ff:ff:ff link-netnsid 0
RX: bytes packets errors dropped missed mcast
16225430 224127 0 0 0 0
TX: bytes packets errors dropped carrier collsns
76546942 442841 0 0 0 0
12: veth61016dc@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default
link/ether fa:10:42:b3:90:bb brd ff:ff:ff:ff:ff:ff link-netnsid 6
RX: bytes packets errors dropped missed mcast
72346824 101678 0 0 0 0
TX: bytes packets errors dropped carrier collsns
10932480 100146 0 0 0 0
16: veth9634e8a@if15: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-b862c865cf21 state UP mode DEFAULT group default
link/ether 6a:e2:9f:77:d7:86 brd ff:ff:ff:ff:ff:ff link-netnsid 1
RX: bytes packets errors dropped missed mcast
2149328541 5359854 0 0 0 0
TX: bytes packets errors dropped carrier collsns
2884787666 9985916 0 0 0 0
27: veth3064aa5@if26: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-b862c865cf21 state UP mode DEFAULT group default
link/ether 76:a6:4d:e6:87:f0 brd ff:ff:ff:ff:ff:ff link-netnsid 3
RX: bytes packets errors dropped missed mcast
3631220875 14259271 0 0 0 0
TX: bytes packets errors dropped carrier collsns
3209100624 11738673 0 0 0 0
45: br-da01119a1af0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
link/ether 02:42:54:2c:52:4f brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped missed mcast
75500377222 64985897 0 0 0 501
TX: bytes packets errors dropped carrier collsns
74419831692 69640130 0 0 0 0
93: veth053d082@if92: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-da01119a1af0 state UP mode DEFAULT group default
link/ether a6:7d:3b:7a:a8:2c brd ff:ff:ff:ff:ff:ff link-netnsid 4
RX: bytes packets errors dropped missed mcast
3561993 17265 0 0 0 0
TX: bytes packets errors dropped carrier collsns
3599580 15688 0 0 0 0
95: veth96c0f59@if94: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-da01119a1af0 state UP mode DEFAULT group default
link/ether 92:9c:5c:72:1c:bb brd ff:ff:ff:ff:ff:ff link-netnsid 7
RX: bytes packets errors dropped missed mcast
69785904246 59352335 0 0 0 0
TX: bytes packets errors dropped carrier collsns
67982937641 63311069 0 0 0 0
103: veth719df73@if102: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default
link/ether 0a:e8:c9:48:72:6c brd ff:ff:ff:ff:ff:ff link-netnsid 2
RX: bytes packets errors dropped missed mcast
909906267 12579824 0 0 0 0
TX: bytes packets errors dropped carrier collsns
3892141830 24704018 0 0 0 0
108: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 100
link/none
RX: bytes packets errors dropped missed mcast
2414058764 12195288 0 0 0 0
TX: bytes packets errors dropped carrier collsns
18031744355 17625345 0 18745 0 0
查看网卡的一些情况
网络接口的 ring buffer
sudo ethtool -g ens192
Ring parameters for ens192:
Pre-set maximums:
RX: 4096
RX Mini: 2048
RX Jumbo: 4096
TX: 4096
Current hardware settings:
RX: 1024
RX Mini: 128
RX Jumbo: 256
TX: 512
网络接口的开关
sudo ethtool -k ens192
Features for ens192:
rx-checksumming: on
tx-checksumming: on
tx-checksum-ipv4: off [fixed]
tx-checksum-ip-generic: on
tx-checksum-ipv6: off [fixed]
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: off [fixed]
tx-tcp-mangleid-segmentation: off
tx-tcp6-segmentation: on
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off
rx-vlan-offload: on
tx-vlan-offload: on
ntuple-filters: off [fixed]
receive-hashing: on
highdma: on
rx-vlan-filter: on [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: off [fixed]
tx-gre-csum-segmentation: off [fixed]
tx-ipxip4-segmentation: off [fixed]
tx-ipxip6-segmentation: off [fixed]
tx-udp_tnl-segmentation: on
tx-udp_tnl-csum-segmentation: on
tx-gso-partial: off [fixed]
tx-tunnel-remcsum-segmentation: off [fixed]
tx-sctp-segmentation: off [fixed]
tx-esp-segmentation: off [fixed]
tx-udp-segmentation: off [fixed]
tx-gso-list: off [fixed]
fcoe-mtu: off [fixed]
tx-nocache-copy: off
loopback: off [fixed]
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]
l2-fwd-offload: off [fixed]
hw-tc-offload: off [fixed]
esp-hw-offload: off [fixed]
esp-tx-csum-hw-offload: off [fixed]
rx-udp_tunnel-port-offload: off [fixed]
tls-hw-tx-offload: off [fixed]
tls-hw-rx-offload: off [fixed]
rx-gro-hw: off [fixed]
tls-hw-record: off [fixed]
rx-gro-list: off
macsec-hw-offload: off [fixed]
网络接口上的各个 RX, TX 队列统计数据
sudo ethtool -S ens192 | grep err
pkts tx err: 0
hdr err: 0
pkts tx err: 0
hdr err: 0
pkts tx err: 0
hdr err: 0
pkts tx err: 0
hdr err: 0
pkts rx err: 0
err: 0
pkts rx err: 0
err: 0
pkts rx err: 0
err: 0
pkts rx err: 0
err: 0
查看错误统计
sudo netstat -s | grep error
0 packet receive errors
0 receive buffer errors
0 send buffer errors