1.点击“编辑”,查看虚拟网络编辑器
2.因为需要管理员权限,点击“更改设置”
3.点击VMnet8那一栏,配置子网ip与子网掩码,进行NAT模式设置
4.配置网关IP,点击“确定”
5.配置DHCP,设置起始IP地址与结束IP地址,起始设置为172.16.50.3,因为172.16.50.2被网关占用了,结束地址可以设置为172.16.50.254
6.最后点击“确定”,启动虚拟机,进行用户登录,查看ip
[root@hrbu31 ~]# ifconfig
7.修改IP地址(改:ONBOOT=yes,BOOTPROTO=static;添加:IPADDR=172.16.50.31;GATEWAY=172.16.50.2;DNS1=8.8.8.8)
[root@hrbu31 ~]# cd /etc/sysconfig/network-scripts/
[root@hrbu31 network-scripts]# vi ifcfg-eth0
8.重启网关(如果报错,reboot,重启虚拟机)
[root@hrbu31 network-scripts]# service network restart
9.修改主机名,根据自己需要设置,如果后续需要集群,就把要集群的机器添加进来,最后保存退出
[root@hrbu31 network-scripts]# vi /etc/hosts
10.关闭防火墙,关闭防火墙开机启动,关闭SELINUX
[root@hrbu31 network-scripts]# service iptables stop //关闭防火墙
[root@hrbu31 network-scripts]# chkconfig iptables off //关闭防火墙开机启动
[root@hrbu31 network-scripts]# chkconfig iptables --list //查看防火墙开机启动状态
[root@hrbu31 network-scripts]# vi /etc/selinux/config
11.设置SELINUX处于关闭状态(disabled),最后reboot重启虚拟机