From owner-freebsd-questions@FreeBSD.ORG Thu Oct 30 09:39:48 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 525BF1065670 for ; Thu, 30 Oct 2008 09:39:48 +0000 (UTC) (envelope-from lists@oak-wood.co.uk) Received: from ash.oak-wood.co.uk (ash.oak-wood.co.uk [62.3.200.116]) by mx1.freebsd.org (Postfix) with ESMTP id F41A78FC1E for ; Thu, 30 Oct 2008 09:39:47 +0000 (UTC) (envelope-from lists@oak-wood.co.uk) Received: from localhost (localhost [127.0.0.1]) by ash.oak-wood.co.uk (Postfix) with ESMTP id B8305BCF47 for ; Thu, 30 Oct 2008 09:19:49 +0000 (GMT) Received: from ash.oak-wood.co.uk ([127.0.0.1]) by localhost (ash.oak-wood.co.uk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 55467-08 for ; Thu, 30 Oct 2008 09:19:49 +0000 (GMT) Received: from [192.168.37.233] (bluebell.thegrove.oak-wood.co.uk [192.168.37.233]) by ash.oak-wood.co.uk (Postfix) with ESMTPA id 86267BCEB0 for ; Thu, 30 Oct 2008 09:19:49 +0000 (GMT) Message-ID: <49097C34.3030608@oak-wood.co.uk> Date: Thu, 30 Oct 2008 09:19:48 +0000 From: Chris Hastie User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.17) Gecko/20080925 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Setting a different default source address X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2008 09:39:48 -0000 Is it possible to set a default source address on a machine? I have an ADSL connection with a fixed IP and a further /29 routed to it. Until recently I used an ADSL router which acquired the connection IP, and then the first of the /29 on the internal interface. In an effort to conserve both IPs and the number of machines I have running I have recently changed to using an ADSL modem (Vigor Draytek 110) which essentially does no more than change the PPPoA to PPPoE. A FreeBSD machine then handles the connection using ppp. The machine in question has always used one of the /29 addresses, and continues to do so (this is assigned to its DMZ facing NIC, vr0). Now, of course, outgoing packets are using the connection address, which is assigned to tun0. Whilst I can override this on an application by application basis for many things (eg postfix smtp_bind_address parameter, ping -S switch) is there any way to override it system wide, so that the address from the /29 is used by default? I think I succeeded in doing something similar for an IPv6 tunnel by not assigning an IP address to gif0 and configuring the routing as follows in rc.conf: ipv6_defaultrouter="-interface gif0" But I'm not clear whether this would work with ppp, and if so, how to do it.