CARP on FreeBSD 7,2

Will Andrews will at firepipe.net
Sat May 9 02:16:31 UTC 2009


On Fri, May 8, 2009 at 10:09 PM, Sam Wan <sam at ip6.com.au> wrote:
> The following command also failed:
>
> test:~ # ifconfig carp1 vhid 1 pass password 192.168.2.144/24 up
> ifconfig: ioctl (SIOCAIFADDR): Can't assign requested address
>
>>
>> Hi,
>>
>> I tried to setup CARP in FreeBSD 7.2, but seems not able to assign IP to
>> the carp interfaces.
>>
>> Here is my rc.conf file:
>>
>> hostname="test.ip6.com.au"
>> ifconfig_fxp0="inet 192.168.1.248  netmask 255.255.255.0"
>> sshd_enable="YES"
>>
>> pf_enable="YES"
>> pf_rules="/etc/pf.anti-spam.conf"
>> pf_flags=""
>> pflog_enable="YES"
>> pflog_logfile="/var/log/pflog"
>> pflog_program="/sbin/pflogd"
>> pflog_flags=""
>> pfsync_enable="NO"
>> pfsync_syncdev=""
>> pfsync_ifconfig=""
>>
>> cloned_interfaces="carp1"
>> ifconfig_carp1="up 24.214.165.129/25 vhid 2 pass privatepassword"
>>
>>
>> test:~ # ifconfig
>> fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>>         options=8<VLAN_MTU>
>>         ether 00:13:20:65:ad:bd
>>         inet 192.168.1.248 netmask 0xffffff00 broadcast 192.168.1.255
>>         media: Ethernet autoselect (100baseTX <full-duplex>)
>>         status: active
>> plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu
>> 1500
>> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
>>         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
>>         inet6 ::1 prefixlen 128
>>         inet 127.0.0.1 netmask 0xff000000
>> pflog0: flags=141<UP,RUNNING,PROMISC> metric 0 mtu 33204
>> pfsync0: flags=0<> metric 0 mtu 1460
>>         syncpeer: 224.0.0.240 maxupd: 128
>> carp1: flags=9<UP,LOOPBACK> metric 0 mtu 1500
>>         carp: INIT vhid 1 advbase 1 advskew 50
>>
>> What have I missed?

Hi,

Currently, the only way to assign an IP address for CARP is to use an
IP that is in the same subnet as the physical interface you intend to
handle its packets.  In other words, since neither 192.168.2.144/24
nor 24.215.165.129/25 are in 192.168.1.248/24, they cannot be assigned
to any CARP interface.  Eventually, this should be fixed by
introducing carpdev, which allows explicitly associating a CARP
interface with a physical interface, but it's not there yet.

Regards,
--Will.


More information about the freebsd-net mailing list