修改IP,如下所示:
[root@cent1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=829f4223-e6c5-4892-a027-88cde79693cc
DEVICE=eno16777736
ONBOOT=yes
IPADDR=192.168.162.2
GATEWAY=192.168.162.1
NETMASK=255.255.255.0
主机名:
[root@localhost ~]# hostnamectl set-hostname cent1
网页名称:Linux7修改主机IP及主机名
文章URL:
http://cqcxhl.cn/article/gioddh.html