From owner-freebsd-net@FreeBSD.ORG Fri Jul 24 13:40:51 2009 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 5C983106564A for ; Fri, 24 Jul 2009 13:40:51 +0000 (UTC) (envelope-from vova@sw.ru) Received: from relay.sw.ru (mailhub.sw.ru [195.214.232.25]) by mx1.freebsd.org (Postfix) with ESMTP id CC0608FC13 for ; Fri, 24 Jul 2009 13:40:50 +0000 (UTC) (envelope-from vova@sw.ru) Received: from vbook.fbsd.ru ([10.30.1.111]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id n6ODehiZ011679 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Jul 2009 17:40:44 +0400 (MSD) Received: from vova by vbook.fbsd.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1MUL0t-0000pT-O3; Fri, 24 Jul 2009 17:40:43 +0400 From: Vladimir Grebenschikov To: Julian Elischer In-Reply-To: <4A69B6D7.3080501@elischer.org> References: <5a3c8f450907230757j21191a11n6cae4699ec8a76e1@mail.gmail.com> <29ae62fc0907232114r2afb9dc8y966a22db6d3236bc@mail.gmail.com> <4A693DE2.3050905@elischer.org> <1248433706.1678.13.camel@localhost> <4A69B6D7.3080501@elischer.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 24 Jul 2009 17:40:43 +0400 Message-Id: <1248442843.1678.36.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov Cc: freebsd-net@freebsd.org, Jamie Ostrowski , "Lucian@lastdot.org" Subject: Re: How to change default source address? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vova@fbsd.ru List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 13:40:51 -0000 > >> you could set up 2 routing tables and assign different apps to use > >> different tables > > > > Is it possible to select routing table by ipfw setfib X ? > > > > someting like: > > > > ipfw add setfib 1 ip from a.b.c.d to any out xmit em0 > > setfib 1 route add default 10.10.10.1 > > no that wouldn't work for 2 reasons. > 1/ for local sockets, the routing decision is made already before it > gets to the firewall > 2/ for non-ocal packets (from another machine that you are routing) > the packet needs to be tested on the recv (in) side of things > but by then the sending machine has aready decided on a local address too. Not nice. I have a dream, that fbsd now capable to do real multi-fib routing :( What about ipfw fwd ? That was working years ago for me, but of course, requires to put all custom routing entries into ipfw rules. What about binding of FIBs to local addresses or/and interfaces ? Such way that kernel will decide what fib to use examining local IP address of package ? -- Vladimir B. Grebenschikov vova@fbsd.ru