RHEL9 网络配置


开关interface和profile

  1. 获取网络状态

    1
    2
    3
    4
    nmcli connection
    NAME UUID TYPE DEVICE
    Profile 2 21906cd8-c04d-45fd-9b7f-e6e85c43f891 ethernet enP21p1s0f1np1
    enP21s17f1np1 f9ed821f-f3db-46ea-90fd-13dd74dc5587 ethernet --
  2. ifdown profile

    1
    2
    [root@localhost ~]# ifdown "Profile 2"
    Connection 'Profile 2' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7)
  3. link down interface

    1
    [root@localhost ~]# ip link set enP21p1s0f1np1 down
  4. link up interface

    1
    [root@localhost ~]# ip link set enP21p1s0f1np1 up
  5. ifup interface

    1
    2
    [root@localhost ~]# ifup "Profile 2"
    Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/8)