COMMAND LINE KUNG FU

Lệnh hiển thị thông tin cổng mạng trên Linux

388
author Huỳnh Đình Hiếu - 2022-08-04 12:56:18 (GMT+7)

Hiển thị thông tin cổng mạng (interface), tương tự như lệnh ifconfig.

bash (non-root)
netstat -ie
Kết quả
Kernel Interface table
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        inet6 fe80::42:ceff:febb:f263  prefixlen 64  scopeid 0x20<link>
        ether 02:42:ce:bb:f2:63  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7  bytes 746 (746.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 61.14.233.29  netmask 255.255.255.0  broadcast 61.14.233.255
        inet6 fe80::f816:3eff:fe85:e80  prefixlen 64  scopeid 0x20<link>
        inet6 2401:c440:0:1255:f816:3eff:fe85:e80  prefixlen 64  scopeid 0x0<global>
        ether fa:16:3e:85:0e:80  txqueuelen 1000  (Ethernet)
        RX packets 15408194  bytes 957403836 (957.4 MB)
        RX errors 0  dropped 34  overruns 0  frame 0
        TX packets 229188  bytes 100494157 (100.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.123.11.171  netmask 255.255.0.0  broadcast 10.123.255.255
        inet6 fe80::f816:3eff:fec6:52d3  prefixlen 64  scopeid 0x20<link>
        ether fa:16:3e:c6:52:d3  txqueuelen 1000  (Ethernet)
        RX packets 3516134  bytes 270268536 (270.2 MB)
        RX errors 0  dropped 41  overruns 0  frame 0
        TX packets 13510  bytes 955644 (955.6 KB)
        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
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 30188  bytes 3130563 (3.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 30188  bytes 3130563 (3.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth6e0e212: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::f481:2ff:fe24:43fb  prefixlen 64  scopeid 0x20<link>
        ether f6:81:02:24:43:fb  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 128  bytes 9136 (9.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Chú thích tham số lệnh netstat:

  • i: Hiển thị bảng interface

  • e: Hiển thị thêm các thông thông tin khác.


Bạn có làm được theo hướng dẫn này không?

Lệnh liên quan

Object Storage

Chuẩn S3, không giới hạn băng thông

Object Storage
Thông tin tác giả
Bình luận

Tính năng đang được phát triển

Đang tải bình luận
Liên hệ chúng tôi