From owner-freebsd-net@FreeBSD.ORG Wed May 7 20:03:36 2008 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 4C19B106564A for ; Wed, 7 May 2008 20:03:36 +0000 (UTC) (envelope-from ml@netfence.it) Received: from parrot.aev.net (parrot.aev.net [212.31.247.179]) by mx1.freebsd.org (Postfix) with ESMTP id D3D648FC1A for ; Wed, 7 May 2008 20:03:34 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.ventu ([151.77.252.30]) (authenticated bits=128) by parrot.aev.net (8.14.2/8.13.8) with ESMTP id m47JasNk033133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 7 May 2008 21:37:05 +0200 (CEST) (envelope-from ml@netfence.it) Received: from alamar.ventu (alamar.ventu [10.1.2.18]) by soth.ventu (8.14.2/8.14.2) with ESMTP id m47JUohj077669 for ; Wed, 7 May 2008 21:30:50 +0200 (CEST) (envelope-from ml@netfence.it) Message-ID: <48220305.7010605@netfence.it> Date: Wed, 07 May 2008 21:29:09 +0200 From: Andrea Venturoli User-Agent: Thunderbird 2.0.0.14 (X11/20080504) MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 212.31.247.179 Subject: Routing problem with aliases 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, 07 May 2008 20:03:36 -0000 Hello. A box of mine has an interface configured with two IPs on two different nets: # ifconfig xl0: flags=8943 mtu 1500 options=9 inet 192.168.2.2 netmask 0xffffff00 broadcast 192.168.2.255 inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255 ether 00:50:da:77:5f:79 media: Ethernet autoselect (100baseTX ) status: active Then I have two gateways: 192.168.2.1 and 192.168.0.6. "ping 192.168.2.1" works correctly (source address 192.168.2.2 is used) "ping 192.168.0.6" also does (source address 192.168.0.2 is used) Setting 192.168.2.1 as my default gateway allows me to ping any host on the Internet (again source address 192.168.2.2 is used). However, if I set 192.168.0.6 as the default router, I can't reach the Internet, since it uses source address 192.168.2.2 and the next router won't obviously like it. Is this normal behaviour? Anything to set or check? Any other hint? Perhaps I should mention that I also have some carp devices on that interface, but I'm not sure whether it matters. bye & Thanks av.