Solved BRIDGE interfaces MAC address range

Hello all,

i have a challenge with the generated mac address on the bridge interface.

I am building a host wich serves as base for a number of jails so i am creating a VNET network config, becasue i had to compile the kernel vor VNET support i thought to be wise and created a OVF of the VM after i had compiled and installed a VNET supported kernel and tested the base bridge configuration.

So i shutdown the VM created the OVF and deployed that to 3 other hosts, well.... there started my problem.

After having lots of SSH disconnects, slow logins, hangs and broken Pipe messages i finaly found out that the bridge interface MAC address is only generated _once_ so i now have 4 hosts with the same bridge mac adres (currently 2 hosts running) i can change the mac after boot manually but not using rc.conf

i have now change the cloned_interfaces from "bridge0 bridge1" to "bridge2 bridge3" and at least it works, as long i do not use those on any of the other hosts.

Is the any one that can tell me how i can have the host generate new bridge mac address range.

Thanks,
Richard
 
Thanks for the suggestion, only as mentioned, i can set it manually, using rc.conf i was unsuccessfull.

i have used :

Code:
ifconfig_bridge1="inet 1.2.3.4 mask 255.255.255.0 addm vmx0 up ether de:ad:be:af"

All the cloned systems are using the same mac range 00:00:df:db:c9:??

So i would like to have the system regenerate this mac address range because if someone forgets that the selected ranges are the same between the 4 machines we are back at my problem.

Richard
 
Code:
     The if_bridge interface randomly chooses a link (MAC) address in the
     range reserved for locally administered addresses when it is created.
     This address is guaranteed to be unique only across all if_bridge
     interfaces on the local machine.  Thus you can theoretically have two
     bridges on the different machines with the same link addresses.  The
     address can be changed by assigning the desired link address using
     ifconfig(8).
From bridge(4).
 
Hi SirDice,

Yes i Also saw that in man pages, but also managing the MAC address brings in user error, all the machines are on the same L2 segment so if one forgets to set the mac address on a machine i have bad network connection again, not easly knowing which machine is the cause.

I am a little further now, the on line 670 of if_bridge it say's its using the hostid to randomly create an MAC range.
SVNweb if_bridge

I am trying to re-create this hostid because this is also no longer unique, unfortunately i have been unsuccessfull.

i tried deleting the /etc/hostid and setting the sysctl kern.hostuuid to empty string but after reboot its back and the same.

Sorry if i'm being a bit stubborn, i do appreciate everyone's help.

Richard
 
I found it...

i missed one line in /etc/rc.d/hostid :
Code:
kenv -q smbios.system.uuid

And with that knowledge i found that i was trying to change the hostid on the original server, not on one of the clones, so switching to one of the clones removing /etc/hostid and rebooting created a new hostid and this created a new MAC address range for all bridges created on this machine.

The moral of this is, delete the /etc/hostid before you create a Clone of OVF of the VM ;-)

Thanks for all suggestions.

Regards,
Richard
 
Back
Top