1、设置virtualBox为桥接模式
[img]http://dl2.iteye.com/upload/attachment/0126/5085/b873a507-4183-3525-9647-a25cb0b8fb5e.png[/img]
2、桥接模式使得宿主机和虚拟机在同一个网段内工作
[img]http://dl2.iteye.com/upload/attachment/0126/5087/e386c65b-54ac-3ecb-b4cf-0a497b6cb657.png[/img]
并做如下参数调整
[img]http://dl2.iteye.com/upload/attachment/0126/5089/5326d4f4-b6cc-36a6-b0a0-e75a10153415.png[/img]
3、设置DNS服务器
通过如下命令设置dns服务器:vi /etc/resolv.conf
[img]http://dl2.iteye.com/upload/attachment/0126/5091/e27cf490-b136-3008-ac1c-f1912e0db86f.png[/img]
4、关闭虚拟机防火墙
service iptables stop
5、重启网络服务
service network restart
6、虚拟机即可ping通宿主机
[img]http://dl2.iteye.com/upload/attachment/0126/5095/67f9bf70-8a09-3bb5-a634-059b90bd6b3b.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0126/5085/b873a507-4183-3525-9647-a25cb0b8fb5e.png[/img]
2、桥接模式使得宿主机和虚拟机在同一个网段内工作
[img]http://dl2.iteye.com/upload/attachment/0126/5087/e386c65b-54ac-3ecb-b4cf-0a497b6cb657.png[/img]
并做如下参数调整
[img]http://dl2.iteye.com/upload/attachment/0126/5089/5326d4f4-b6cc-36a6-b0a0-e75a10153415.png[/img]
3、设置DNS服务器
通过如下命令设置dns服务器:vi /etc/resolv.conf
[img]http://dl2.iteye.com/upload/attachment/0126/5091/e27cf490-b136-3008-ac1c-f1912e0db86f.png[/img]
4、关闭虚拟机防火墙
service iptables stop
5、重启网络服务
service network restart
6、虚拟机即可ping通宿主机
[img]http://dl2.iteye.com/upload/attachment/0126/5095/67f9bf70-8a09-3bb5-a634-059b90bd6b3b.png[/img]