VMware Workstation 12.0.1 build-3160714
Red Hat Enterprise Linux Server release 7.0 (Maipo)
一 配置网卡
1,编辑网卡配置文件
# vim /etc/sysconfig/network-scripts/ifcfg-eno16777736
HWADDR=00:0C:29:5D:34:28
TYPE=Ethernet
BOOTPROTO=static ##dhcp:自动获取IP,static:静态IP,none:不用协议
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
NAME=eno16777736
UUID=3af1bda7-d937-4aba-bbdf-e9c7eeef0dd9
ONBOOT=yes ##启动network服务时是否启用该网卡,yes为启用
IPADDR=192.168.16.91
NETMASK=255.255.255.0
GATEWAY=192.168.16.1
DNS1=8.8.8.8
2,重启网络服务
#systemctl restart network
二 修改主机名
#vim /etc/hostname
cnblog.localdomain
三 修改hosts
#vim /etc/hosts
192.168.16.91 cnblog.localdomain cnblog
#hostname -i
192.168.16.91
四 单网卡配置双IP
1,编辑网卡配置文件
#cp /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-eno16777736:0
# vim /etc/sysconfig/network-scripts/ifcfg-eno16777736:0
DEVICE=eno16777736:0
HWADDR=00:0C:29:5D:34:28
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
NAME=eno16777736
UUID=3af1bda7-d937-4aba-bbdf-e9c7eeef0dd9
ONBOOT=yes
IPADDR=192.168.16.92
NETMASK=255.255.255.0
GATEWAY=192.168.16.1
DNS1=8.8.8.8
2,重启网络服务
#systemctl restart network