On Wed, Feb 20, 2008 at 11:40 PM, Chris Brennan <[EMAIL PROTECTED]> wrote:
> I am trying to set up a Bridge for Qemu to use. I followed the guide
> at
> http://gentoo-wiki.com/HOWTO:_Qemu#Using_TUN.2FTAP_interface_as_a_normal_user
> but when ever the bridge starts, I loose connectivity outside of my
> box :/ ... am I missing something
>
>
> I've includes the output of my /etc/conf.d/net file
>
>
> # This blank configuration will automatically use DHCP for any net.*
> # scripts in /etc/init.d. To create a more complete configuration,
> # please review /etc/conf.d/net.example and save your configuration
> # in /etc/conf.d/net (this file :]!).
> dns_domain=( "unworldly.org" )
> nis_domain=( "unworldly.org" )
> dns_domain_eth0=( "unworldly.org" )
> dns_search_eth0=( "unworldly.org xaerolimit.net" )
> dns_servers_eth0=( "192.168.1.1 4.2.2.1 4.2.2.2" )
>
> ##
> # LAN
> ##
> config_eth0=( "192.168.1.2 netmask 255.255.255.0 brd 192.168.1.255" )
> routes_eth0=( "default via 192.168.1.1" )
>
> ##
> # Bridge
> ##
> bridge_br0="eth0"
> config_br0=( "192.168.1.20 netmask 255.255.255.0 brd 192.168.1.255" )
> #dhcpcd_br0="-t 10"
> RC_NEED_br0="net.eth0"
> brctl_br0=( "setfd 0" "sethello 0" "stp off" )
> config_tap0=( "10.0.2.1 netmask 255.255.255.0" )
Following an old tutorial about that, I noticed that you can't have
eth0 working and bridging with different IPs. My /etc/conf.d/net:
depend_br0() {
need net.eth0
}
config_eth0=( "0.0.0.0 promisc" ) #resets eth0 so the bridge gets the real IP.
config_br0=( " netmask brd
" )
dhcpd_br0="-N"
brctl_br0=( "setfd 0" "sethello 1" "stp off" )
bridge_br0="eth0" #ads eth0 to your bridge, all traffic will go to the
physical interface
routes_br0=(
"default gw "
)
And at /etc/qemu-ifup I add the following:
#!/bin/sh
sudo /sbin/ifconfig $1 0.0.0.0 #resets tap0
sudo /sbin/brctl addif br0 tap0 #adds tap0 to the bridge
Of couse I configured sudo to do all this without asking for a
password so I could run qemu as a normal user.
With this setup, when I launch qemu, everything works (Novell, etc) as
if it really was a different computer connected physically to the
network.
Hope that helps.
--
Daniel da Veiga
Filosofia de TI: Programadores de verdade consideram o conceito "o que
você vê é o que você tem" tão ruim em editores de texto quanto em
mulheres. Não, o programador de verdade quer um editor de texto do
estilo "você pediu, você levou" - complicado, indecifrável, poderoso,
impiedoso, perigoso.
z�b�� z{h���x%��