之前我们设定网络都用 nm-connection-editor 中进行手动添加,此片博客则告诉大家如何用nmcli 命令的方式设定网络。
大前提:
要先打开systemctl status NetworkManager 设备信息
一.查看设备信息:
nmcli device status
二.查看eth0 网卡信息:
nmcli device show eth0
三.启动eth0网卡
nmcli device connect eth0
四.关闭eth0网卡,断开
nmcli device disconnect eth0
地址由静态的172.25.254.129 消失
关闭网卡之后,nm-connection-editor 中无显示:
五.创建动态地址
nmcli connection add typeethernet non-name westos ifname eth0 autoconnect yes
扫描二维码关注公众号,回复:
4200418 查看本文章