host-only模式
1、主机设置网络共享
2、虚拟机网络设置
[root@localhost ~]# cd /etc/sysconfig/network-scripts/[root@localhost network-scripts]# lsifcfg-enp0s3 ifdown-ppp ifup-ib ifup-Teamifcfg-lo ifdown-routes ifup-ippp ifup-TeamPortifdown ifdown-sit ifup-ipv6 ifup-tunnelifdown-bnep ifdown-Team ifup-isdn ifup-wirelessifdown-eth ifdown-TeamPort ifup-plip init.ipv6-globalifdown-ib ifdown-tunnel ifup-plusb network-functionsifdown-ippp ifup ifup-post network-functions-ipv6ifdown-ipv6 ifup-aliases ifup-pppifdown-isdn ifup-bnep ifup-routesifdown-post ifup-eth ifup-sit[root@localhost network-scripts]# cat ifcfg-enp0s3 TYPE=EthernetBOOTPROTO=noneDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noNAME=enp0s3UUID=e5148472-bd96-4da0-97ca-3040fb54a102DEVICE=enp0s3ONBOOT=yesIPADDR=192.168.137.105PREFIX=32GATEWAY=192.168.137.1DNS1=192.168.9.19IPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_PRIVACY=no
3、
service network restart
4、关闭防火墙
chkconfig iptables off
service iptables status
5、connect automatically
开启