On Thu, May 20, 2010 at 07:02:23PM +0200, Axel Rau wrote:
> >>Now the question: Can I put a trunk on top of a carp?
> >
> >you put carp on top of the trunk of course.
> OK.
> Can I have a trunk connected to 2 different switches then?
>
yes, i did this many times using trunk in failover mode. this is
actually the main reason why i implemented failover mode: for l2
redundancy. i even normally use it in combination with VLANs.
to explain it using your artwork:
+---+ +------+
| | +-----+ | |
----+fw1+--------+ sw1 +-------+ |
carp0| +--+ +-+-+-+ em0| |
| | | | | |
+-+-+ | +----+ | |
| | | |Server|
+-+-+ +--|------+ | fbsd |
| | | | | |
| +-----+ +-+-+-+ | |
----+fw2+--------+ sw2 +-------+ |
carp0| | +-----+ em1| |
+---+ +------+
let's assume that fw1 and fw2 are connected with em1 and em2, em1 is
connected to sw1 and em2 is connected to sw2 on each fw. fbsd server
sits in vlan2, the uplink is in vlan1 connected to the same switches
(you might also have other physical switches for the uplink, which is
also fairly common, which would just require to move vlan1 to another
trunk or physical iface).
the switches don't need any special configuration, no trunks on the
switch and no stacking or similar. they just need to be in the same
VLANs, so a simple interlink between them is all you need. failover
mode means that the trunk only uses one active link at a time (the
first trunkport you add and so on) as long as the link is up. this is
works nicely with any kind of switches, is safe to use and doesn't
cause any loops, address conflicts etc.. i use procurve switches
(now: hp networking e-series), but there is no need for distributed
trunking or tricks like this with failover mode.
fw1# ifconfig em0 up
fw1# ifconfig em1 up
fw1# ifconfig trunk0 trunkport em0 trunkport em1 trunkproto failover up
fw1# ifconfig vlan1 vlandev trunk0 descr UPLINK 10.1.1.2/24
fw1# ifconfig vlan2 vlandev trunk0 descr SERVERLAN 10.1.2.2/24
fw1# ifconfig carp1 vhid 1 carpdev vlan1 10.1.1.1/24
fw1# ifconfig carp2 vhid 2 carpdev vlan2 10.1.2.1/24
fw2# ifconfig em0 up
fw2# ifconfig em1 up
fw2# ifconfig trunk0 trunkport em0 trunkport em1 trunkproto failover up
fw2# ifconfig vlan1 vlandev trunk0 descr UPLINK 10.1.1.3/24
fw2# ifconfig vlan2 vlandev trunk0 descr SERVERLAN 10.1.2.3/24
fw2# ifconfig carp1 vhid 1 carpdev vlan1 advskew 100 10.1.1.1/24
fw2# ifconfig carp2 vhid 2 carpdev vlan2 advskew 100 10.1.2.1/24
and you can also move the pfsync traffic over the same trunk:
fw1# ifconfig vlan240 vlandev trunk0 192.168.240.2/24 up
fw1# ifconfig pfsync0 syncdev vlan240 up
fw2# ifconfig vlan240 vlandev trunk0 192.168.240.3/24 up
fw2# ifconfig pfsync0 syncdev vlan240 up
reyk