文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>VirtualBox桥接方式

VirtualBox桥接方式

时间:2007-05-15  来源:hongjiang

1、首先要下载几个软件包
sudo apt-get install uml-utilities bridge-utils

2、新建名为tap.sh的文件,将以下内容复制到其中

sudo tunctl -t tap0 -u hongjiang                      #建立一个tap设备, 名字为tap0 所有者为hongjiang
sudo brctl addbr br0                                  #创建一个网桥
sudo ifconfig eth0 0.0.0.0 promisc                    #使eth0进入promiscuous模式
sudo brctl addif br0 eth0                             #将eth0加入br0
#sudo ifconfig br0 192.168.1.12 up                    #固定IP方式
#sudo route del default
#sudo route add default gw 192.168.1.149 dev br0      
sudo ifconfig br0 up                                  #DHCP方式
sudo dhclient br0
sudo brctl addif br0 tap0                             #将tap0加入br0
sudo ifconfig tap0 up                                 #激活tap0
sudo chmod a+rw /dev/net/tun

3、设置权限
chmod u+x tap.sh

4、拷贝tap.sh到/home/hongjiang/.VritualBox

5、加入启动项
sudo gedit /etc/rc.local
将 /home/hongjiang/.VirtualBox/tap.sh加入到 exit 0 之前

6、在VirtualBox的VM Setting的network标签中,选择"Host interface",并在下面的Interface中填上tap0

7、重启或手动运行 tap.sh

最后要注意将宿主机与虚拟机设置在同一网段,否则无法通信。

参考文章:
http://www.linuxdiyf.com/bbs/viewthread.php?tid=44386
http://hi.baidu.com/benben/blog/item/9a3a4b362fff3fdca3cc2be1.html
http://virtualbox.org/wiki/Automatic_Bridge_Ubuntu
相关阅读 更多 +
排行榜 更多 +
拉力竞速2

拉力竞速2

体育竞技 下载
文字乱舞水浒

文字乱舞水浒

角色扮演 下载
蓝图公考

蓝图公考

学习教育 下载