CentOS7命令添加和修改网卡IP地址和NDS

2018-12-21 09:11:59 6005


#nmcli connection add type ethernet autoconnect yes con-name eht0 ifname eth0 ip4 192.168.99.2 gw4 192.168.99.1  #添加IP地址和网关
#nmcli connection modify eth0 ipv4.dns 8.8.8.8       #添加DNS
#systemctl restart network        #重新启动网络

修改IP地址、网关和DNS


# nmcli connection modify eth0  ipv4.addresses 192.168.0.11/24
# nmcli connection modify eth0 ipv4.method manual
#nmcli connection modify eth0 ipv4.dns 9.9.9.9
#systemctl restart network


提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: