View previous topic :: View next topic |
Author |
Message |
thesnowman Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 08 May 2003 Posts: 365 Location: Sydney, Australia
|
Posted: Mon Jul 04, 2005 6:04 am Post subject: Network bridge without any interfaces. How? [solved] |
|
|
I'm trying to create a bridge without any interfaces using baselayout-1.11.12-r4. I've checked out the documentation here and it has an example that shows how to get it working with two interfaces (eth0 and eth1). I simply want the bridge interface created without any network interfaces as these are added dynamically. This is what the relevant part of /etc/conf.d/net looks like: Code: | brctl_pan0=( "setfd 0" "stp off" )
config_pan0=( "10.0.0.1/24" ) |
I've symlinked /etc/init.d/net.pan0 to /etc/init.d/net.lo and set RC_VERBOSE="yes" in /etc/conf.d/rc. I tried setting NET_DEBUG=1 in /etc/conf.d/net but this generated too much info that I couldn't really understand. When I try and start my bridge I get this: Code: | * Starting pan0
* Loading networking modules for pan0
* modules: iptunnel ifconfig bridge dhcpcd apipa
* ifconfig provides interface
* dhcpcd provides dhcp
* Bringing up pan0
* 10.0.0.1/24
* pan0 does not exist [ !! ] |
brctl and ifconfig confirm that the pan0 device was not created.
I know that it is possible to create the bridge without any interfaces because I can do it like so: Code: | # /sbin/brctl addbr pan0
# /sbin/brctl setfd pan0 0
# /sbin/brctl stp pan0 off
# /sbin/ifconfig pan0 10.0.0.1 up | and I then have a pan0 network interface with the correct IP address.
I've tried adding a preup function to /etc/conf.d/net to manually create the bridge. I commented out the brctl_pan0 line so only the config line remains and I create the bridge in preup like so: Code: |
preup() {
if [ "${IFACE}" == "pan0" ]; then
/sbin/brctl addbr pan0
/sbin/brctl setfd pan0 0
/sbin/brctl stp pan0 off
fi
return 0
} | This works fine until I want to stop the bridge and I then get an "xargs: unmatched single quote" error: Code: | supergroove ~ # /etc/init.d/net.pan0 stop
* Stopping pan0
* Loading networking modules for pan0
* modules: iptunnel ifconfig iproute2 bridge dhcpcd apipa
* Bringing down pan0
* Destroying bridge pan0 ...
xargs: unmatched single quote [ ok ] | The bridge is destroyed successfully however. It looks like there are some smarts in the net.lo script because it knows it's a bridge device that it's dealing with. I think the xargs "error" is probably because it's expecting some interface names that it needs to delete from the bridge before it can be stopped.
So, does anyone know if this is possible using the current baselayout? I'd appreciate any help. It doesn't matter if I can't get it working perfectly, but I am a perfectionist and would prefer to do everything the Gentoo way .
A bit of background if you're interested... I've setup a Bluetooth Network Access Point to share my Internet connection with my PDA. I used the information from here and here to get it working. A bridge device called pan0 is created and given an address of 10.0.0.1 (my address ranges are the opposite of those in the article). I'm using shorewall to forward all pan0 packets to eth0 using SNAT. Whenever a bluetooth device connects to the NAP a bnepX interface is created and the /etc/bluetooth/pan/dev-up script adds this interface to the bridge. I've been using my own scripts to get this working so far.
Last edited by thesnowman on Mon Jul 04, 2005 9:51 am; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
UberLord Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/16007251014200867ea775c.gif)
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Mon Jul 04, 2005 8:06 am Post subject: Re: Network bridge without any interfaces. How? |
|
|
thesnowman wrote: | So, does anyone know if this is possible using the current baselayout? |
No, it's not possible.
However, it is possible when baselayout-1.12.0-alpha3 hits portage - hopefully soon
You'll also be able to dynamically add interfaces to your bridge as well ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
thesnowman Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 08 May 2003 Posts: 365 Location: Sydney, Australia
|
Posted: Mon Jul 04, 2005 9:52 am Post subject: |
|
|
Thanks UberLord, I thought that was the case.
Need someone to help test baselayout-1.12.0-alpha3? Is your overlay publicly available? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
UberLord Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/16007251014200867ea775c.gif)
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Mon Jul 04, 2005 10:36 am Post subject: |
|
|
thesnowman wrote: | Is your overlay publicly available? |
Not as such. I'd have todo a svn snapshot for it to work in an overlay - something I don't really like doing.
However, as I'm in a nice mood, I've posted the new bridging module for testing - http://dev.gentoo.org/~uberlord
I've added a compat function to it so it should work with stable baselayout - but I've not actually tested it there.
Provided you have brctl_<bridgename>=( ... ) options then the bridge gets created regardless of if you have defined any ports
This will add eth0 to bridge br0 when eth0 starts
bridge_add_eth0="br0" |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mheyse n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 05 Aug 2004 Posts: 6
|
Posted: Sat Dec 31, 2005 2:40 pm Post subject: |
|
|
Quote: | This will add eth0 to bridge br0 when eth0 starts
bridge_add_eth0="br0" |
Does this actually work now? I'm using baselayout-1.12.0_pre12 and my /etc/conf.d/net looks like
Code: | brctl_br0=("setfd 0" "stp off")
bridge_add_eth0="br0"
bridge_add_bnep0="br0"
config_br0=("192.168.2.100/24")
config_eth0=("null")
config_bnep0=("null") |
Now I start eth0:
Code: | linux conf.d # brctl show
bridge name bridge id STP enabled interfaces
linux conf.d # /etc/init.d/net.eth0 start
* Starting eth0
* Creating bridge br0 ... [ ok ]
* Bringing up eth0 [ ok ]
linux conf.d # brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 no |
As you can see the bridge gets created but no interface is added to it. Am I missing something?
Also, is /etc/conf.d/bridge and /etc/init.d/bridge now obsolete?
Thanks,
Michael |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
UberLord Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/16007251014200867ea775c.gif)
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mheyse n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 05 Aug 2004 Posts: 6
|
Posted: Mon Jan 02, 2006 12:33 pm Post subject: |
|
|
Quote: | I've posted a patch that fixes the issue. |
Works great, thanks! I guess it will be in the next baselayout? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
UberLord Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/16007251014200867ea775c.gif)
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|