Centos7配置静态IP及连接xhsell
1.1.关闭防火墙(主机的防火墙也手动关掉吧)
1.查看防火墙状态
[root@ubfirst ubfirst]# systemctl status firewalld.service
2:暂时关闭防火墙
systemctl stop firewalld.service
service iptables stop
3:永久关闭防火墙
systemctl disable firewalld.service
chkconfig iptables off
4:重启防火墙
systemctl enable firewalld
service iptables restart
1.2.编辑VMware Network Adapter VMnet8
1.3.虚拟机的设置网络为NAT模式
1.4.配置虚拟机的网段
1.5.配置静态ip
centos7控制台 需要管理员权限
[root@ubfirst ubfirst]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
注意:ifcfg-ens33 为网卡名称,根据实际的来
ifcfg-ens33 文件中需要添加或修改
BOOTPROTO=static #模式
ONBOOT=yes #开机启动
IPADDR=192.168.11.101 #随意设置的IP,但是要和V8的在一个网段
NETMASK=255.255.255.0 #上图中的子网掩码
GATEWAY=192.168.11.2 #上图中的网关
DNS1=114.114.114.114 #DNS1地址
1.6.保存后重启网卡
[root@ubfirst ubfirst]# service network restart
保存后重启网卡
[root@ubfirst ubfirst]# service network restart