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