From owner-freebsd-net@FreeBSD.ORG Sat Feb 25 22:27:45 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C33116A423 for ; Sat, 25 Feb 2006 22:27:45 +0000 (GMT) (envelope-from edwin@mavetju.org) Received: from mail2out.barnet.com.au (mail2out.barnet.com.au [202.83.176.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 61A0343D82 for ; Sat, 25 Feb 2006 22:27:24 +0000 (GMT) (envelope-from edwin@mavetju.org) Received: by mail2out.barnet.com.au (Postfix, from userid 27) id 306FF7073D5; Sun, 26 Feb 2006 09:27:23 +1100 (EST) X-Viruscan-Id: <4400D9CB0000B85807F0E5@BarNet> Received: from mail2-auth.barnet.com.au (mail2.barnet.com.au [202.83.176.13]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.barnet.com.au", Issuer "BarNet Root Certificate Authority" (verified OK)) by mail2.barnet.com.au (Postfix) with ESMTP id EC1737073B7; Sun, 26 Feb 2006 09:27:22 +1100 (EST) Received: from k7.mavetju (edwin-3.int.barnet.com.au [10.10.12.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail2-auth.barnet.com.au (Postfix) with ESMTP id 400807073B0; Sun, 26 Feb 2006 09:27:22 +1100 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id 22BBB1E2; Sun, 26 Feb 2006 09:27:17 +1100 (EST) Date: Sun, 26 Feb 2006 09:27:17 +1100 From: Edwin Groothuis To: Brian Candler Message-ID: <20060225222717.GC92618@k7.mavetju> References: <20060225070722.GA92618@k7.mavetju> <20060225142846.GA70376@uk.tiscali.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060225142846.GA70376@uk.tiscali.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-net@freebsd.org Subject: Re: socket / bind - specific address 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: Sat, 25 Feb 2006 22:27:45 -0000 On Sat, Feb 25, 2006 at 02:28:46PM +0000, Brian Candler wrote: > On Sat, Feb 25, 2006 at 06:07:22PM +1100, Edwin Groothuis wrote: > > The situation is as follows: > > > > We have a couple of FreeBSD routers, with RFC1918 addresses on the > > ethernets and a public address on the loopback. This works fine for > > connecting to the routers, but is problematic for locally originated > > outgoing traffic (think NTP, think syslog): it takes the IP address > > of the outgoing interface, which is the RFC1918 address. > > > > Is there a way (sysctl, kernel option) to define which IP address > > is used for locally originated outgoing traffic? > > One way is to run your daemon (ntpd, syslogd etc) within a jail, and give > the jail your public loopback as its IP address. I'm surely going to try this and see if it works. Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/