centos7网络修改命令
时间:2017-02-19 23:27 来源:linux.it.net.cn 作者:IT
1.修改主机名命令#hostnamectl set-hostname localhostname
2.修改配置文件/etc/hostname
3.图形方式修改IP地址命令#nm-connection-editor
4.直接命令修改
#nmcli connection modify eth0 ipv4.addresses "192.168.100.20/24"
#nmcli connection modify eth0 ipv4.gateway "192.168.100.1"
#nmcli connection modify eth0 ipv4.dns1 "8.8.8.8"
5.配置文件修改#vim /etc/sysconfig/networking-scripts/ifcfg-eth0在文件后添加
IPADDR=192.168.163.128
PREFIX=24
GATEWAY=192.168.163.1 (责任编辑:IT)
1.修改主机名命令#hostnamectl set-hostname localhostname 2.修改配置文件/etc/hostname 3.图形方式修改IP地址命令#nm-connection-editor 4.直接命令修改 #nmcli connection modify eth0 ipv4.addresses "192.168.100.20/24" #nmcli connection modify eth0 ipv4.gateway "192.168.100.1" #nmcli connection modify eth0 ipv4.dns1 "8.8.8.8" 5.配置文件修改#vim /etc/sysconfig/networking-scripts/ifcfg-eth0在文件后添加 IPADDR=192.168.163.128 PREFIX=24 GATEWAY=192.168.163.1 (责任编辑:IT) |