nmcli connection add con-name home type ethernet ifname eth1 autoconnect yes ip4 10.1.252.60/24 gw4 10.1.0.254

  con add – 添加新的连接
  con-name – 连接名
  type – 设备类型
  ifname – 接口名
  autoconnect no - 禁止开机自动启动

由于命令过长,要善于使用TAB键补全,命令完成后,会在/etc/sysconfig/network-scripts/下生成一个配置文件,但是并未生效。如:

[root@CentOS 7 ~]# nmcli connection up home

参考文档:http://blog.51cto.com/groot/1847482

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2021-09-28
  • 2021-11-22
  • 2021-11-23
猜你喜欢
  • 2021-12-19
  • 2022-03-03
  • 2021-12-23
  • 2022-12-23
  • 2021-04-30
  • 2021-12-21
  • 2021-12-06
相关资源
相似解决方案