Subject: Re: carp(4) & vlan(4) (was Re: Transitioning to 802.11q VLANs on a network using a NetBSD box with multiple physical interfaces)
To: Charlie Allom <charlie@rubberduck.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-net
Date: 06/09/2007 16:38:46
On Sat, Jun 09, 2007 at 02:06:33PM +0100, Charlie Allom wrote:
> On Sat, Jun 09, 2007 at 01:56:37AM -0500, David Young wrote:
> > 
> > ifconfig vlan4 create
> > ifconfig vlan5 create
> > ifconfig bridge0 create
> > 
> > ifconfig vlan4 vlan 4 vlanif fxp1
> > ifconfig vlan5 vlan 4 vlanif fxp2
> > 
> > ifconfig vlan4 inet 192.168.4.1 netmask 0xffffff00
> > 
> 
> just to keep the vlan thread going,but skew it in my direction, now
> that i see some experts :)
> 
> how should I configure carp interfaces that belong on vlans? ie. where
> should i add the inet address?
> 
> % ifconfig wm3 up
> % ifconfig wm3 x.x.x.x netmask 0xffffffe0
> % ifconfig carp2 create
> % ifconfig carp2 vhid 201 carpdev wm3 x.x.x.y netmask 0xffffffe0
> % ifconfig vlan200 create
> % ifconfig vlan200 vlan 200 vlanif carp200
> % ifconfig vlan200 inet x.x.x.z netmask 0xffffffe0

I'm not sure you can put vlans on carps - carps are not normal ethernet
interfaces.
But you can have carp on vlan; this is what I use and it works

> 
> so far - wasting x.x.x.x on wm3, x.x.x.y on carp2, and y.y.y.* on the
> n+1 failover carp hosts...
> 
> am i wrong? Can I leave the carpN IPs out?

No, because it's the IP which is used in real. But you can use a private IP 
for the underlying ethernet interfaces and vlans (this is also what I do
to not waste public IP addresses)

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--