一、配置网络模式为桥接模式
1.点击“编辑”->“虚拟网络编辑器”
2.配置NAT
3.配置DHCP
二、进入centos系统设置网络
[root@localhost network-scripts]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# ls
ifcfg-eth0 ifdown-bnep ifdown-ippp ifdown-post ifdown-sit ifup-aliases ifup-ib ifup-isdn ifup-post ifup-sit init.ipv6-global network-functions-ipv6
ifcfg-lo ifdown-eth ifdown-ipv6 ifdown-ppp ifdown-tunnel ifup-bnep ifup-ippp ifup-plip ifup-ppp ifup-tunnel net.hotplug
ifdown ifdown-ib ifdown-isdn ifdown-routes ifup ifup-eth ifup-ipv6 ifup-plusb ifup-routes ifup-wireless network-functions
[root@localhost network-scripts]# vim ifcfg-eth0
三、设置静态IP
1.将ONBOOT=no 设置为ONBOOT=yes -- 设置为开机自启动
2.将BOOTPROTO=dhcp 设置为BOOTPROTO=static --设置为静态协议
3.设置
IPADDR=192.168.238.131 -- 设置IP地址,根据最上面图中起始IP地址来实现的
NETMASK=255.255.255.0 -- 设置网卡地址
GATEWAY=192.168.238.2 -- 设置网关地址