kern/102607: [if_bridge] don't generate random L2 address

Stefan Bethke stb at lassitu.de
Tue Aug 29 21:56:34 UTC 2006


Am 28.08.2006 um 18:19 schrieb Andrew Thompson:

> Pass over to freebsd-net for discussion on the best way to handle  
> this.
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=102607

 From the PR:
>         1. change kernel code or  to generate static IP address
> 	for bridge interface from attached member interfaces.
> 	     or
> 	2. use startup scripts to generate random number and
> 	   store it somewhere in /var.
>              or
> 	3. Make system complain/warning if you set bridge0 to broadcast
> 	   address.
> 	     or
>         4. Document in if_bridge(4) that L2 address is random and  
> document
> 	   correct format of ethernet addresses.
>
> 	Problem with 1. is that address will change if you add or swap NICs
> 	in bridge, but it is still less likely to change than using random
> 	numbers now.

First, the actual behavior and it's implications should be documented  
in if_bridge(4), specifically the random assignment of a locally  
administered address. (Cf. net/if_bridge.c:bridge_clone_create())

If the user wants a different (fixed) address on the bridge, I think  
it's acceptable to configure this in rc.conf along with the member  
interfaces. (Already implemented: ifconfig_bridge0="create ether  
01:23:45:67:89:ab...")

In general, ifconfig should at least warn if you try to assign an  
invalid MAC address to an interface.  It probably wouldn't hurt to  
add a section about ethernet addresses to the ifconfig man page,  
explaining valid choices for LAAs. (I'll try to put together  
something over the weekend.)


My 0,02 EUR,
Stefan

-- 
Stefan Bethke <stb at lassitu.de>   Fon +49 170 346 0140




More information about the freebsd-net mailing list