RHEL7中修改网络配置:
systemctl status NetworkManager
可使用startx 启动图形界面, 对网络配置有两种方法:
1,添加一套配配置方案
2,修改原有配置方案
具体步骤:
-
nmcli device show
nmcli connection show
nmcli connection "system0"
nmcli connection show --active
2. 增加一套配置
nmcli connection add con-name "dhcp-eth0" type ethernet ifname eth0
nmcli connection add con-name "static-eth0" type ethernet ifname eth0 autoconnect ip4
10.10.10.1/24 gw4 10.10.10.254
nmcli conn down "system eth0"
nmcli conn up "static-eth0"
nmcli conn sh --active
nmcli conn sh "system eth0" | grep -i autoconnect
nmcli conn delete dhcp-eth0/static-eth0
3. 修改DNS
nmcli conn modify "new" ipv4.dns 172.25.254.254
hostnamectl set-hostname server1.example.com
本文转自 拾瓦兴阁 51CTO博客,原文链接:http://blog.51cto.com/ponyjia/1866405