From owner-freebsd-net@FreeBSD.ORG Wed May 18 08:00:09 2011 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 4AC211065673 for ; Wed, 18 May 2011 08:00:09 +0000 (UTC) (envelope-from crapsh@monkeybrains.net) Received: from lavash.monkeybrains.net (mail.monkeybrains.net [208.69.40.9]) by mx1.freebsd.org (Postfix) with ESMTP id 1C74E8FC13 for ; Wed, 18 May 2011 08:00:09 +0000 (UTC) Received: from [10.17.45.145] (173-228-119-230.dsl.dynamic.sonic.net [173.228.119.230]) (authenticated bits=0) by lavash.monkeybrains.net (8.14.4/8.14.4) with ESMTP id p4I7JaQl088400 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Wed, 18 May 2011 00:19:37 -0700 (PDT) (envelope-from crapsh@monkeybrains.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=monkeybrains.net; s=monkey; t=1305703177; bh=MN7nORdKuJ6zclW45pTv34USm1ZAJfWdK4l9H2otDqM=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type: Content-Transfer-Encoding; b=m0ODD6mLcMvDHN9WFv60NdHdR2F2UaQnFZ848AQP+rOzWPsd+i160vsmsEvAiqM4S 8vUQAHOL0c7QqdXahvzR5fy7EQcL9QgPUcEOHaPZHgX3YEIvu17PzkXeA382CTRC6V sbBCzYNBKY3NFQ3c+LglBdH7hvrHGkz6Aj0cwC/U= Message-ID: <4DD3730A.7090106@monkeybrains.net> Date: Wed, 18 May 2011 00:19:38 -0700 From: Rudy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.11pre) Gecko/20100928 Shredder/3.1.5pre MIME-Version: 1.0 To: "freebsd-net@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.96.5 at lavash.monkeybrains.net X-Virus-Status: Clean Subject: request: have ifconfig purge routes that are being added via ifconfig 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: Wed, 18 May 2011 08:00:09 -0000 Summary: * ifconfig FAILs if route exists when adding an alias * ifconfig SILENTLY adds the IP even when route exists when creating virtual interaces * DESIRED functionality: purge routes to make way for IPs with ifconfig * Less desired: stop the SILENT adding of IPs as that makes for a bogus network Background: OSPF adds route, eg 1.2.3.0/24, into the kernel If I try to add 1.2.3.4/24 to my router, it fails as that route already exists. Workaround: route del 1.2.3.0/14 && ifconfig igb0 alias 1.2.3.4/24 However, if I can create a vlan with an IP that conflicts with an existing route. Add this to rc.conf: ifconfig_vlan2="1.2.3.4/24 vlan 2 vlandev igb0 then ifconfig vlan2 create Voila: you get a static route to 1.2.3.0/24 to your other router AND the local IP. Makes for a very messed up routing siltation. Workaround: route del 1.2.3.0/14 && ifconfig vlan2 create Proposal: Change the way ifconfig works. [1] Optimally, automatically do the 'route del' first [2] Otherwise, bring these two methods of adding IPs into sync and have the 'ifconfig vlan2 create' NOT add the IP when an existing route exists. Rudy