VirtualBox - NAT虚拟机访问外网 + Host-Only物理主机虚拟机互访

clip_image001

 

clip_image002

 

clip_image003

 

clip_image004

 

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-System_eth0

# 未手动设定HOST-ONLY静态IP时的默认值

#TYPE=Ethernet

#BOOTPROTO=dhcp

#DEFROUTE=yes

#IPV4_FAILURE_FATAL=yes

#IPV6INIT=no

#NAME="System eth0"

#UUID=18dd9b77-2642-4ae3-8457-2fcc24ca0e67

#ONBOOT=yes

#PEERDNS=yes

#PEERROUTES=yes

#LAST_CONNECT=1521725066

 

# 手动设定HOST-ONLY静态IP

DEVICE=eth2

HWADDR=08:00:27:E9:93:C5   #通过此MAC地址判断网卡的网络连接类型

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

IPADDR=192.168.12.10

NETMASK=255.255.255.0

GATEWAY=192.168.12.2

clip_image005

 

clip_image006

 

clip_image007

 

clip_image008

posted @ 2018-03-22 22:12  全威儒  阅读(687)  评论(0编辑  收藏  举报