虛擬機器軟體 - VirtualBox Bridge 模式 For Ubuntu

版主: DarkSkyline

虛擬機器軟體 - VirtualBox Bridge 模式 For Ubuntu

文章DarkSkyline » 週四 11月 1日, 2007年 6:22 pm

這種方式的優點是:外部主機可以直接訪問guest系統

步驟如下: (以下命令均用root用戶執行)
1. 安裝uml-utilities和bridge-utils和,這兩個工具分別含有tunctl和brctl命令

apt-get install uml-utilities bridge-utils

2. 生成一個新的TAP接口

tunctl -t tap1 -u <username>

這里<username>是你想用bridge聯網方式啟動VirtualBox的那個用戶的用戶名
比如我的是: tunctl -t tap1 -u ypxing

3. 生成一個叫做br0的bridge

brctl addbr br0

4. 把你的真實網卡設成promiscuous模式,使得它能夠接收發送到別的MAC地址的幀

ifconfig eth0 0.0.0.0 promisc

5. 把你的真實網卡加到bridge br0的一端

brctl addif br0 eth0

6. 把你的真實網卡的配置設置到br0上, 比如我的eth0的ip地址是192.168.168.60

ifconfig br0 192.168.168.60

如果你的是通過DHCP配置的,則執行dhclient br0即可

7. 把上面生成的TAP接口加到 bridge br0的另一端

brctl addif br0 tap1

8. 激活TAP

ifconfig tap1 up

9. 設置/dev/net/tun的讀寫權限

chmod 0666 /dev/net/tun

經過以上幾步之后,在你的guest系統啟動之前,將它的Network的Adapter0設成
HostInterface,然后Interface Name那一欄天上tap1
啟動guest系統,在該系統中,將你的ip地址設成跟Host系統的eth0在一個局域網就可以了

資料來源:
http://blog.chinaunix.net/u1/35100/showart_288321.html
http://www.ublink.org
Tel:04-22605121
E-Mail:eric@ublink.org
Skype:ublink-eric
LineID:0937720133
頭像
DarkSkyline
Site Admin
 
文章: 1860
註冊時間: 週五 12月 8日, 2006年 11:41 am
來自: 台中
送出感謝: 0 次
擁有感謝: 2

回到 Windows 應用軟體

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 32 位訪客