Discussion:
configuring clone interfaces before bridge at boot-time?
(too old to reply)
Steven M. Bellovin
2006-10-08 23:56:10 UTC
Permalink
For various reasons associated with Xen, I need to have a tap(4) interface
as part of a bridge. Current, my ifconfig_tap0 file says

create
192.168.42.1

(and I could probably leave out the 'create' line, judging
from /etc/rc.d/network, but that's not really important now.)

The problem is that 'tap' comes after 'bridge' in the collating sequence,
so tap0 isn't created by the time ifconfig_bridge1 -- which has

create
!brconfig $int add tap0 up

in it -- is executed. The question is what to do.

I could, I suppose, explicitly set net_interfaces in rc.conf, but that
gives up the benefits of autoconfig. I suspect that the right thing to do
is to take this section of the config loop:

if [ -n "$args" ] || [ -f /etc/ifconfig.$int ]; then
if ifconfig $int create 2>/dev/null && \
checkyesno ipfilter; then
# resync ipf(4)
ipf -y >/dev/null
fi
fi

and do it in a separate loop, before the rest of the config loop. That way,
all desired clone interfaces are created before any bridges are configured.

Comments?

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Hubert Feyrer
2006-10-08 23:57:03 UTC
Permalink
Post by Steven M. Bellovin
as part of a bridge. Current, my ifconfig_tap0 file says
create
192.168.42.1
...
Post by Steven M. Bellovin
so tap0 isn't created by the time ifconfig_bridge1 -- which has
create
!brconfig $int add tap0 up
Comments?
Just an idea:

ifconfig_bridge0:
create

ifconfig_tap0:
create
192.168.42.1
!brconfig bridge0 add $int up

... or for the real overkill, add PROVIDE & REQUIRE keywords & pass the
whole thing to rcorder(8). 8-)


- Hubert

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Steven M. Bellovin
2006-10-09 00:19:57 UTC
Permalink
Post by Steven M. Bellovin
Post by Steven M. Bellovin
as part of a bridge. Current, my ifconfig_tap0 file says
create
192.168.42.1
...
Post by Steven M. Bellovin
so tap0 isn't created by the time ifconfig_bridge1 -- which has
create
!brconfig $int add tap0 up
Comments?
create
create
192.168.42.1
!brconfig bridge0 add $int up
That's a good idea for now, and I'll install that for now. But I wonder
if that's the right general solution.
Post by Steven M. Bellovin
... or for the real overkill, add PROVIDE & REQUIRE keywords & pass the
whole thing to rcorder(8). 8-)
I'm glad there was a smiley after that one...


--Steven M. Bellovin, http://www.cs.columbia.edu/~smb

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Allen Briggs
2006-10-09 03:14:25 UTC
Permalink
[...] I suspect that the right thing to do
if [ -n "$args" ] || [ -f /etc/ifconfig.$int ]; then
if ifconfig $int create 2>/dev/null && \
checkyesno ipfilter; then
# resync ipf(4)
ipf -y >/dev/null
fi
fi
and do it in a separate loop, before the rest of the config loop. That way,
all desired clone interfaces are created before any bridges are configured.
This seems like the right thing to do.

Something like (untested):

Index: network
===================================================================
RCS file: /cvsroot/src/etc/rc.d/network,v
retrieving revision 1.50
diff -p -u -r1.50 network
--- network 24 Nov 2005 17:28:45 -0000 1.50
+++ network 9 Oct 2006 03:13:15 -0000
@@ -200,6 +200,9 @@ network_start()
ipf -y >/dev/null
fi
fi
+ done
+ for int in $tmp; do
+ eval args=\$ifconfig_$int
if [ -n "$args" ]; then
echo -n " $int"
ifconfig $int $args

Seems like it would do the right thing.

-allen
--
Allen Briggs | http://www.ninthwonder.com/~briggs/ | ***@ninthwonder.com

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...