From owner-freebsd-net@FreeBSD.ORG Sat May 9 02:16:30 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8D2A106566C for ; Sat, 9 May 2009 02:16:30 +0000 (UTC) (envelope-from will@firepipe.net) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.31]) by mx1.freebsd.org (Postfix) with ESMTP id 7FCC38FC0A for ; Sat, 9 May 2009 02:16:30 +0000 (UTC) (envelope-from will@firepipe.net) Received: by yw-out-2324.google.com with SMTP id 9so1051488ywe.13 for ; Fri, 08 May 2009 19:16:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.204.16 with SMTP id b16mr1105685ybg.335.1241835388608; Fri, 08 May 2009 19:16:28 -0700 (PDT) In-Reply-To: <11212.220.233.42.226.1241834944.squirrel@secure.ip6.com.au> References: <11159.220.233.42.226.1241834088.squirrel@secure.ip6.com.au> <11212.220.233.42.226.1241834944.squirrel@secure.ip6.com.au> Date: Fri, 8 May 2009 22:16:28 -0400 Message-ID: <2aada3410905081916k51f75499ve867cc4be316cdcf@mail.gmail.com> From: Will Andrews To: Sam Wan Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org Subject: Re: CARP on FreeBSD 7,2 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2009 02:16:31 -0000 On Fri, May 8, 2009 at 10:09 PM, Sam Wan 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=3D"test.ip6.com.au" >> ifconfig_fxp0=3D"inet 192.168.1.248 =A0netmask 255.255.255.0" >> sshd_enable=3D"YES" >> >> pf_enable=3D"YES" >> pf_rules=3D"/etc/pf.anti-spam.conf" >> pf_flags=3D"" >> pflog_enable=3D"YES" >> pflog_logfile=3D"/var/log/pflog" >> pflog_program=3D"/sbin/pflogd" >> pflog_flags=3D"" >> pfsync_enable=3D"NO" >> pfsync_syncdev=3D"" >> pfsync_ifconfig=3D"" >> >> cloned_interfaces=3D"carp1" >> ifconfig_carp1=3D"up 24.214.165.129/25 vhid 2 pass privatepassword" >> >> >> test:~ # ifconfig >> fxp0: flags=3D8843 metric 0 mtu = 1500 >> =A0 =A0 =A0 =A0 options=3D8 >> =A0 =A0 =A0 =A0 ether 00:13:20:65:ad:bd >> =A0 =A0 =A0 =A0 inet 192.168.1.248 netmask 0xffffff00 broadcast 192.168.= 1.255 >> =A0 =A0 =A0 =A0 media: Ethernet autoselect (100baseTX ) >> =A0 =A0 =A0 =A0 status: active >> plip0: flags=3D108810 metric 0= mtu >> 1500 >> lo0: flags=3D8049 metric 0 mtu 16384 >> =A0 =A0 =A0 =A0 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 >> =A0 =A0 =A0 =A0 inet6 ::1 prefixlen 128 >> =A0 =A0 =A0 =A0 inet 127.0.0.1 netmask 0xff000000 >> pflog0: flags=3D141 metric 0 mtu 33204 >> pfsync0: flags=3D0<> metric 0 mtu 1460 >> =A0 =A0 =A0 =A0 syncpeer: 224.0.0.240 maxupd: 128 >> carp1: flags=3D9 metric 0 mtu 1500 >> =A0 =A0 =A0 =A0 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.