BuddyPress bbPress

Linux系统中的nmcli网络管理命令

标签:,
  • 616  1#6469
    飞仔
    参与者
    楼主

    记录使用 nmcli 网络管理命令

    以及遇到的坑

回复 2
    • 2#6470
      飞仔
      参与者
      楼主

      不能混淆的两个概念
      不能混淆的两个命令

      # 连接指定网卡设备下的网络连接(特别注意区别于 nmcli connection up )
      nmcli device connect $_dev_name
      # 断开指定网卡设备下的网络连接
      nmcli device disconnect $_dev_name
      # 连接指定的网络连接(特别注意区别于 nmcli device connect )
      nmcli connection up $_if_name
      # 断开指定的网络连接
      nmcli connection down $_if_name

      首先 device
      注意区别 nmcli device connectnmcli connection up
      首先搞清楚 nmcli device connect <设备接口名称>
      具体常用命令 nmcli device connect ens33
      其中的接口 ens33 ,在这个接口上,我们可以创建多个网络连接,即 connection
      例如在接口 ens33 这个接口上创建:互联网1,互联网2,….

      然后 connection
      注意区别 nmcli connection upnmcli device connect
      首先搞清楚 nmcli connection up <连接名称 | uuid | ...>
      具体常用命令:nmcli connection up 互联网1nmcli connection up uuid-xxx-xxx-xxx-xxx
      connection 是确定的唯一的这个连接

    • 3#6545
      飞仔
      参与者
      楼主

      银河麒麟桌面操作系统 V10
      nmcli -g name,uuid,active connection 获得 active 值永远是 no 的奇葩问题

      解决方法:
      nmcli -g name,uuid,active,state connection

回复 2
  • 哎呀,回复话题必需登录。