From owner-freebsd-net@FreeBSD.ORG Fri Oct 18 10:22:52 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5FD26648 for ; Fri, 18 Oct 2013 10:22:52 +0000 (UTC) (envelope-from ole.myhre@dataoppdrag.no) Received: from mail1.dataoppdrag.no (mail1.dataoppdrag.no [IPv6:2a02:f58:7:1::2]) by mx1.freebsd.org (Postfix) with ESMTP id D8CB62326 for ; Fri, 18 Oct 2013 10:22:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail1.dataoppdrag.no (Postfix) with ESMTP id 4DA102D0D3 for ; Fri, 18 Oct 2013 12:22:50 +0200 (CEST) Received: from mail1.dataoppdrag.no ([127.0.0.1]) by localhost (mail1.dataoppdrag.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kCrmfnN4it2M for ; Fri, 18 Oct 2013 12:22:50 +0200 (CEST) Received: from EX-MBX02.cust-d1.dataoppdrag.no (ex-mbx02.cust-d1.dataoppdrag.no [IPv6:2a02:f58:0:313:b898:7b82:13e0:c3bd]) by mail1.dataoppdrag.no (Postfix) with ESMTPS id 3C6842D006 for ; Fri, 18 Oct 2013 12:22:50 +0200 (CEST) Received: from EX-MBX01.cust-d1.dataoppdrag.no ([fe80::6db0:e393:6a07:457]) by EX-MBX02.cust-d1.dataoppdrag.no ([fe80::b898:7b82:13e0:c3bd%11]) with mapi id 14.02.0342.003; Fri, 18 Oct 2013 12:22:50 +0200 From: Ole Myhre To: "freebsd-net@freebsd.org" Subject: Interface up/down, carp and loopback route Thread-Topic: Interface up/down, carp and loopback route Thread-Index: Ac7L5ZlsrA8IdnofT2qcoevAvXN/vQ== Date: Fri, 18 Oct 2013 10:22:50 +0000 Message-ID: Accept-Language: en-US, nb-NO Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2a02:f58:0:314:91d:fe7d:557b:b606] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2013 10:22:52 -0000 Hi, I'm seeing some inconsistent behavior with how carp handles the loopback ro= ute when it transition from MASTER to BACKUP and how the loopback route is = handled when an interface is marked down. This is currently tested on 10.0-BETA1. (fw1 and fw2 has just been booted) [root@fw1 ~]# ifconfig em2 | grep 'carp\|inet ' inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1 carp: MASTER vhid 1 advbase 1 advskew 0 [root@fw1 ~]# netstat -rn | grep 192.168.0.1 192.168.0.1 link#3 UHS 0 0 lo0 [root@fw1 ~]#=20 [root@fw2 ~]# ifconfig em2 | grep 'carp\|inet ' inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1 carp: BACKUP vhid 1 advbase 1 advskew 0 [root@fw2 ~]# netstat -rn | grep 192.168.0.1 [root@fw2 ~]# [root@fw1 ~]# ifconfig em2 vhid 1 advskew 100 [root@fw1 ~]# ifconfig em2 | grep 'carp\|inet ' inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1 carp: BACKUP vhid 1 advbase 1 advskew 100 [root@fw1 ~]# netstat -rn | grep 192.168.0.1 [root@fw1 ~]# [root@fw2 ~]# ifconfig em2 | grep 'carp\|inet ' inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1 carp: MASTER vhid 1 advbase 1 advskew 0 [root@fw2 ~]# netstat -rn | grep 192.168.0.1 192.168.0.1 link#3 UHS 0 0 lo0 [root@fw2 ~]# [root@fw2 ~]# ifconfig em2 vhid 1 advskew 200 [root@fw2 ~]# ifconfig em2 | grep 'carp\|inet ' inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1 carp: BACKUP vhid 1 advbase 1 advskew 200 [root@fw2 ~]# netstat -rn | grep 192.168.0.1 [root@fw2 ~]# So far, so good. The loopback route is removed when the carp interface goes= back to BACKUP, and added when it goes to MASTER. However, if I mark an interface as down: [root@fw1 ~]# ifconfig em2 | grep 'carp\|inet ' inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1 carp: MASTER vhid 1 advbase 1 advskew 100 [root@fw1 ~]# netstat -rn | grep 192.168.0.1 192.168.0.1 link#3 UHS 0 0 lo0 [root@fw1 ~]# ifconfig em2 down [root@fw1 ~]# ifconfig em2 | grep 'carp\|inet ' inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 vhid 1 carp: INIT vhid 1 advbase 1 advskew 100 [root@fw1 ~]# netstat -rn | grep 192.168.0.1 192.168.0.1 link#3 UHS 0 0 lo0 [root@fw1 ~]# The loopback route is not removed. The same things happen if I set any interface to down, not just interfaces = with carp enabled. Is this expected behavior, or is it a bug? Or maybe it is (or should be) a = sysctl setting? And is the loopback route really necessary at all? --=20 Ole Myhre