Re: [gentoo-user] Networking bridging

2008-02-21 Thread Daniel da Veiga
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%��

[gentoo-user] Networking bridging

2008-02-20 Thread Chris Brennan
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" )

-- 
#
# NOTICE: The contents of this e-mail and any attachments to it may   
 #
# contain privileged and confidential information from XaeroLimit   
 #
# Industries or its affiliates. This information is only for the
viewing #
# or use of the intended recipient. If you are not the intended
recipient, #
# you are hereby notified that any disclosure, copying, distribution
or use #
# of, or the taking of any action in reliance upon, the information   
 #
# contained in this e-mail, or any of the attachments to this e-mail,
#
# is strictly prohibited. If you have received this e-mail in error,
#
# please immediately notify the sender by replying to this message and
#
# delete it from your system. #
#

-- 
gentoo-user@lists.gentoo.org mailing list