1.nat
2. only host
auto lo
iface lo inet loopback
auto enp0s3
iface enp0s3 inet dhcp
auto enp0s8
iface enp0s8 inet static
address 192.168.56.12
netmask 255.255.255.0
#不要gateway ,用nat 走外网上网
centos 区分大小写
/etc/sysconfig/network-scripts/ifcfg-enp0s8
DEVICE=enp0s8
BOOTPROTO=none
ONBOOT=yes
PREFIX=24
IPADDR=192.168.56.20
ifdown enp0s8 && ifup enp0s8