Ubuntu关于网口的信息查看

这篇比较简单,单纯为了记录。

查看端口号:

  • ifconfig
root@xjwx:~# ifconfig
eno33np0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.5.222  netmask 255.255.0.0  broadcast 172.16.255.255
        inet6 fe80::be97:e1ff:fed6:5420  prefixlen 64  scopeid 0x20<link>
        ether bc:97:e1:d6:54:20  txqueuelen 1000  (Ethernet)
        RX packets 45526  bytes 7425016 (7.4 MB)
        RX errors 0  dropped 1129  overruns 0  frame 471
        TX packets 833  bytes 135878 (135.8 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 84  bytes 7204 (7.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 84  bytes 7204 (7.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

主要看现在可以用的端口

  • ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno33np0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether bc:97:e1:d6:54:20 brd ff:ff:ff:ff:ff:ff
    inet 172.16.5.222/16 brd 172.16.255.255 scope global eno33np0
       valid_lft forever preferred_lft forever
    inet6 fe80::be97:e1ff:fed6:5420/64 scope link
       valid_lft forever preferred_lft forever
3: eno1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 70:b5:e8:d0:9d:da brd ff:ff:ff:ff:ff:ff
4: eno34np1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether bc:97:e1:d6:54:21 brd ff:ff:ff:ff:ff:ff
5: eno2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 70:b5:e8:d0:9d:db brd ff:ff:ff:ff:ff:ff

查看所有的端口基本信息

ethtool eno33np0查看更详细的一个端口的信息:

Settings for eno33np0:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseT/Full
                                10000baseT/Full
                                25000baseCR/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Full
                                10000baseT/Full
                                25000baseCR/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  Not reported
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: No
        Link partner advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Port: FIBRE
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: d
        Current message level: 0x00000000 (0)

        Link detected: yes
Last modification:December 7th, 2020 at 11:41 am