Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Feb 2011 23:10:06 +0100
From:      Stefan Bethke <stb@lassitu.de>
To:        Zhihao Yuan <lichray@gmail.com>
Cc:        FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: How to bind a static ether address to bridge?
Message-ID:  <D412D00B-C386-4898-8FBE-AA3DE9A60BC1@lassitu.de>
In-Reply-To: <AANLkTi=P6pbiPHWpeoj9Os%2Bfi76Hk7DFOyYaSN3BY=_J@mail.gmail.com>
References:  <AANLkTi=P6pbiPHWpeoj9Os%2Bfi76Hk7DFOyYaSN3BY=_J@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Am 25.02.2011 um 07:56 schrieb Zhihao Yuan:

> My server is behind a DHCP-enabled router, and it has two network
> interfaces, wlan0 and bge0. I want to use them together, so I bind
> them, plus tap0 to bridge0. But bridge has a random MAC address for
> each time it was created, which makes me hard to reserve an IP for it
> (since I need to forward some ports to this server). So I set
> net.link.bridge.inherit_mac=3D1, which makes bridge0 to use bge0's MAC
> address, always. But this causes another problem: the packets sent to
> bridge0 is also sent to bge0, -- the packets are duplicated! The
> kernel have to drop half of them. So how can I bind a distinct MAC
> address to a bridge?

This is in my router's rc.conf:
ifconfig_bridge0=3D"ether 02:00:00:00:00:01 addm tap0 addm vlan1"
ifconfig_bridge0_alias0=3D"inet 192.168.0.1/24"

vlan1 is on em0; neither as an address assigned.

And if you want to put IPv6 on there, you also have to add a link-local =
address to make rtadvd happy, something like:
ipv6_network_interfaces=3D"bridge0 gif0"
ipv6_ifconfig_bridge0=3D"fe80::21c:c0ff:fe7d:8c50%bridge0"
ipv6_ifconfig_bridge0_alias0=3D"2001:470:1f0b:xxxx::1 prefixlen 64"


--=20
Stefan Bethke <stb@lassitu.de>   Fon +49 151 14070811






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D412D00B-C386-4898-8FBE-AA3DE9A60BC1>