From owner-freebsd-stable@freebsd.org Mon Aug 17 16:32:25 2015 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 613DE9BBBBB for ; Mon, 17 Aug 2015 16:32:25 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-ob0-x229.google.com (mail-ob0-x229.google.com [IPv6:2607:f8b0:4003:c01::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26FA6181D for ; Mon, 17 Aug 2015 16:32:25 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: by obbfr1 with SMTP id fr1so116748768obb.1 for ; Mon, 17 Aug 2015 09:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lqlYHieMMDoqkT1V604KGkzCDWQ0YJZwhX9AhoqeVno=; b=mVVUgo5LFR2OK0yzFsUIDPuDt0SkmnesjZn0QcNkvpjf8KV1z6ta8QTWZaXYTlAAMm /xr6nPJb6O6n3Pb5pDQbxsvkbz1GFHoUZfFjG88IAXNLEuITaCpzTbPqek9BtRerizep xqvgYeV+4mpxywZRKR6OM4tQAwJt+r7OnjJJRSNFPetGVBRnYCtMfGaVa//az+2QV5I7 /23rbut7Ip02A+lE5DFY18PbFPiWHZMVBFQZkQz89g0mFBt9OznjWCAe06sFjaXjDJwd /Kl+XmgbLkHX0pN7KFg/Lkrv6PfT4hjSqP4P51pRpjvlMqTcBOea52hF9uX1Gobsfi/V la8g== MIME-Version: 1.0 X-Received: by 10.60.133.50 with SMTP id oz18mr1894024oeb.64.1439829144464; Mon, 17 Aug 2015 09:32:24 -0700 (PDT) Received: by 10.76.81.100 with HTTP; Mon, 17 Aug 2015 09:32:23 -0700 (PDT) Received: by 10.76.81.100 with HTTP; Mon, 17 Aug 2015 09:32:23 -0700 (PDT) In-Reply-To: References: Date: Mon, 17 Aug 2015 09:32:23 -0700 Message-ID: Subject: Re: [POSSIBLE BUG] 10-STABLE CARP erroneously becomes master on boot From: Freddie Cash To: Damien Fleuriot Cc: FreeBSD Stable , Damien Fleuriot Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2015 16:32:25 -0000 On Aug 17, 2015 9:22 AM, "Damien Fleuriot" wrote: > > Hello list, > > > > I'm seeing this very peculiar behaviour between 2 10-STABLE boxes. > > Host A is CARP Master with advskew 20 and runs 10.2-BETA1 from 10/07 > Host B is CARP Backup with advskew 150 and runs 10.2-PRERELEASE from 12/08 > > > When I configure CARP in rc.conf on host B, it becomes Master on boot, and > host A remains Master as well. > When I force a state change on host B (ifconfig vlanx vhid y state backup), > it transitions to Backup then again to Master. > > When I comment out the CARP configuration in rc.conf , and configure CARP > manually on host B's interfaces after it boots, it correctly becomes and > remains Backup. > > > > Below is the excerpt from rc.conf pertaining to CARP configuration, the > only difference between the 2 hosts being their advskew. > > Host A > == BEGIN > > ifconfig_vlan410_alias0="vhid 110 pass passhere advskew 20 alias > 10.104.10.251/32" > > == END > > Host B > == BEGIN > > ifconfig_vlan410_alias0="vhid 110 pass passhere advskew 150 alias > 10.104.10.251/32" > > == END Put the IP first, and the vhid stuff last in rc.conf for things to work the most reliably. And drop the extra alias. ifconfig_vlan410_alias0="inet 10.104.10.251/32 vhid 110 pass passhere advskew 150" CARP requires that all IPs on an interface that are part of the same vhid to be listed (added) in the exact same order for the vhid to be considered "the same". That one trips me up all the time when manually adding an IP to a CARP pair, and then later rebooting one box as they both think they're master for that interface, while being a mix of master/backup for the other interfaces. Cheers, Freddie (running CARP on 2 10-CURRENT boxes and 2 10.1-p13 boxes)