使用vmware安装centos7
1、虚拟网络编辑器设置:
2、配置ip:
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=63c539e7-70ff-4b12-9ea3-df97607d1d62
DEVICE=ens33
ONBOOT=YES
IPADDR=192.168.2.192
NETMASK=255.255.255.0
GETEWAY=192.168.2.1
DNS1=114.114.114.114
3、重启服务:service network restart
4、ping www.baidu.com测试看是否能够成功上网。
如果需要远程连接最好关闭防火墙。
1:查看防火状态
systemctl status firewalld
service iptables status
2:暂时关闭防火墙
systemctl stop firewalld
service iptables stop
3:永久关闭防火墙
systemctl disable firewalld
chkconfig iptables off
4:重启防火墙
systemctl enable firewalld
service iptables restart