1 hostnamectl set-hostname wangshuyi
2 vi /etc/hostname
3 vi /etc/resolv.conf
4 vi /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet 类型是以太网
BOOTPROTO=static 是否自动获取IP(none、static、dhcp)IPADDR=192.168.1.155 IP地址GATEWAY=192.168.1.1 网关DNS1=114.114.114.114 DNSDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=enp0s3UUID=9d4cf280-377d-41b7-ac42-5e62c03d2328 唯一设备名称DEVICE=enp0s3 网卡设备名称ONBOOT=yes 是否随网络服务启动