LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1483|回复: 13

vbox网桥设置

[复制链接]
发表于 2007-8-20 16:57:06 | 显示全部楼层 |阅读模式
按照http://gentoo-wiki.com/HOWTO:_VirtualBox设置:
  1. #vbox网桥设置
  2. #http://zh.gentoo-wiki.com/index.php?title=HOWTO_VirtualBox&redirect=no
  3. #the interface is really replaced by br0 for outgoing, so if you had dhcp here, you'll use dhcp in br0
  4. config_eth0=( "null" )

  5. #this specifies that interface vbox0 will be a tap interface and use the tunctl command to generate itself
  6. tuntap_vbox0="tap"

  7. #ALL interfaces part of a bridge should be null, otherwise oddities may occur.
  8. config_vbox0=( "null")

  9. # you can specify an owner of the interface if you want to run virtual box as a non root user
  10. #tunctl_vbox0="-u adm"

  11. #If you'd prefer a dynamic ip address for the machine, use
  12. #config_br0=( "dhcp" )
  13. config_br0=("192.168.2.10/24 brd 192.168.2.255" )
  14. routes_br0=("default via 192.168.2.1")
  15. #this specifies the briding information
  16. bridge_br0="eth0 vbox0"
  17. depend_br0() {
  18.         need net.eth0
  19.         need net.vbox0
  20. }
  21. brctl_br0=( "setfd 0")
复制代码

net.eth0 net.vbox0启动都没有问题。
start net.br0时,错误:
  1. network interface br0 does not exist
  2. Please verify hardware or kernel module (driver)
复制代码


当我把net.eth0的设置改为原来的
  1. config_eth0=("192.168.2.2/24 brd 192.168.2.255" )
  2. routes_eth0=("default via 192.168.2.1")
复制代码


net.br0可以启动,但是主机无法访问网络。
 楼主| 发表于 2007-8-20 17:06:56 | 显示全部楼层
当我正确启动一次net.br0之后就可以了。

另外,我的主机的IP如何设置?不用设置?已经设置?

对网桥的看来还是不明白的。
回复 支持 反对

使用道具 举报

发表于 2007-8-20 17:32:37 | 显示全部楼层
兄弟看过安装手册中的说明了吗?网桥需要内核的支持(802.1d),在网络设置中。
http://www.gentoo.org/doc/zh_cn/ ... mp;chap=3#doc_chap7
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-20 18:41:30 | 显示全部楼层
内核已经设置了。
我又试验了,一下。

restart eth0 vbox0 br0就好了?似乎是模块没有加载?
回复 支持 反对

使用道具 举报

发表于 2007-8-20 18:47:10 | 显示全部楼层
哈哈,这篇是我译的,要在内核的network上设置记得在ipv6的设置附近,最好从新做一遍,删删掉。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-20 18:51:23 | 显示全部楼层
先用着,等下回再次重启的时候对比一下lsmod。

谢谢2位。
我正是找到了jjj311的译贴才又找原贴看的。
回复 支持 反对

使用道具 举报

发表于 2007-8-20 20:18:53 | 显示全部楼层
config_eth0=( "dhcp" )
dhcp_eth0="nodns nontp nonis"

config_eth1=("null")

config_tap11=("null")
tuntap_tap11="tap"
tunctl_tap11="-u william"

config_br0=( "192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255" )
bridge_br0="eth1 tap11"
brctl_br0=( "stp off" )

depend_br0() {
   need net.eth1 net.tap11
}

我的配置:
eth0 外网
eth1 内网,做 bridge
tap11 是给 vbox 用的。
br0 就是 内网bridge 了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-20 20:34:20 | 显示全部楼层
当我

  1. # /etc/init.d/net.eth0 restart && /etc/init.d/net.vbox0 restart && /etc/init.d/net.br0 restart
复制代码

多来几次就行了。

楼上:
我只有一个网卡呀。 你的内外网啥意思?你的内网的eth1也是虚拟的一块网卡?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-20 21:17:24 | 显示全部楼层
我试验了,老晨说的不行呢
  1. # /etc/init.d/net.eth2 restart && /etc/init.d/net.vbox0 restart && /etc/init.d/net.br0 restart
  2. * Service net.eth2 stopping
  3. * Service net.eth2 stopped
  4. * Service net.eth2 starting
  5. * Service net.eth2 started
  6. * Service net.vbox0 stopping
  7. * Service net.vbox0 stopped
  8. * Service net.vbox0 starting
  9. * Service net.vbox0 started
  10. * Service net.br0 starting
  11. network interface eth2 does not exist
  12. Please verify hardware or kernel module (driver)                                                                                                        [ !! ]
  13. * ERROR:  net.br0 failed to start
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-20 22:11:28 | 显示全部楼层
vbox虚拟机里的网络又歇菜了……
算了,还是NAT吧。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表