一、设定ip(nmcli 命令)
-
首先执行systemctl status NetworkManager命令查看服务是否开启,该命令需要在服务开启才可以执行。
-
nmcli device命令:
nmcli device show 查看详细信息
nmcli device status 查看设备状态
nmcli device disconnect eth0 关闭eth0设备
nmcli device connect eth0 开启eth0设备
nmcli device show eth0 显示eth0详细信息
nmcli device status eth0 显示eth0的设备状态
-
nmcli connection 命令
nmcli connection show 显示所有网络连接
nmcli connection delete eth0 删除eth0 的网络连接
nmcli connection show
nmcli connection add type ethernet con-name eth0 ifname eth0 新建eth0网络连接
nmcli connection show