if_bridge FreeBSD 6.0 on a Broadcom interface not working

Igor Madera Sepúlveda imadera at gmail.com
Thu Jan 12 08:39:48 PST 2006


Hi,

I suggest you to try the following, and see if it works:

1. Do not start any interface neither the bridge via the file
/etc/rc.conf ... this means, you should start your box without any
ifconfig_em0="" line in rc.conf

2. Once started, check that only lo0 interface (local one) be listed
when you make an ifconfig.  (I know it is silly to say it, but:
remember to build your custom kernel for if_bridge, preferably and to
activate it in /etc/sysctl.conf )

3. Perform the following commands:

$ ifconfig bridge0 create
$ ifconfig bridge0 addm em0 addm em1 up
$ ifconfig bridge0 stp em0 stp em1
$ ifconfig em0 up
$ ifconfig em1 up

Optional commands:

$ ifconfig bridge0 inet 192.168.50.8 netmask 255.255.255.240 broadcast
192.168.50.15
$ route add default 192.168.50.1

You may notice I assigned an IP to bridge also (that is optional, for
administratives purposes only, I mean in order to SSH my bridge box),
you may ignore that line, but do not ignore the last one, replacing
192.168.50.1 to your real gateway (unless you don't want internet
access from/to the bridge box).

4. Test if the commands created the bridge and if you have internet
access in your bridge box.  Ping everywhere you need to and conclude
the success or fail.

5. If it works, put the commands in a shell script (i.e.:
if_bridgeStart.sh), with all the lines you used.

6. Put your script in the /etc/crontab, (the system crontab) something like:

@reboot					root	sh /root/bridge/if_bridgeStart.sh

Good luck,

Igor Madera

P.S.: I had to start my bridge this way, since the rc.conf way of
creating and starting it failed everytime I tested.


More information about the freebsd-net mailing list