歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux服務器 >> Ubuntu Linux下Virtualbox橋接網絡配置

Ubuntu Linux下Virtualbox橋接網絡配置

日期:2017/3/2 16:48:57   编辑:Linux服務器

1 安裝必須軟件

sudo apt-get install uml-utilities bridge-utils

2 添加本人帳戶到軟件組

sudo gpasswd -a bruce uml-net

3 修改interface文件內容如下

sudo vi /etc/network/interfaces

auto lo

iface lo inet loopback

auto tap0

iface tap0 inet manual

up ifconfig $IFACE 0.0.0.0 up

down ifconfig $IFACE down

tunctl_user bruce

auto tap1

iface tap1 inet manual

up ifconfig $IFACE 0.0.0.0 up

down ifconfig $IFACE down

tunctl_user bruce

auto tap2

iface tap2 inet manual

up ifconfig $IFACE 0.0.0.0 up

down ifconfig $IFACE down

tunctl_user bruce

auto br0

iface br0 inet static

address 192.168.1.188

netmask 255.255.255.0

broadcast 192.168.1.255

gateway 192.168.1.1

bridge_maxwait 0

bridge_ports all tap0 tap1 tap2

auto eth0

allow-hotplug eth0

iface eth0 inet manual

up ifconfig eth0 0.0.0.0 promisc up

4 重啟機器配置生效!

以上配置是因為我的網絡環境是靜態IP的環境,所以虛擬機的IP全都是靜態IP,如果網絡環境中有DHCP服務器配置可以簡化一下,不過我是用虛擬機做實驗的,喜歡IP是固定的,所以配置如上

Copyright © Linux教程網 All Rights Reserved