Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Jul 2009 12:09:08 -0300
From:      "Luiz Otavio O Souza" <lists.br@gmail.com>
To:        <vova@fbsd.ru>, "Julian Elischer" <julian@elischer.org>
Cc:        freebsd-net@freebsd.org, Jamie Ostrowski <jamie.ostrowski@gmail.com>, "Lucian@lastdot.org" <lucian@lastdot.org>
Subject:   Re: How to change default source address?
Message-ID:  <8222942B09F94943A7B9314F1D7833E4@adnote989>
References:  <5a3c8f450907230757j21191a11n6cae4699ec8a76e1@mail.gmail.com><29ae62fc0907232114r2afb9dc8y966a22db6d3236bc@mail.gmail.com><4A693DE2.3050905@elischer.org> <1248433706.1678.13.camel@localhost><4A69B6D7.3080501@elischer.org> <1248442843.1678.36.camel@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
>
>> >> 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

The actual routing code doesn't receive any information about the source 
address (the route is found using exclusively the destination address), so 
right now the kernel cannot select the fib by looking at the source address 
(local address).

There is an kernel option called RADIX_MPATH wich changes the routing code 
substancially (and looks like - from an untrained eye - it uses the 
local/source address to select the correct route). Unfornately my test 
hardware dies and i cannot look at this (right now) to tell you how this 
will work in the "real world", but if you can, you should try it.

Luiz




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8222942B09F94943A7B9314F1D7833E4>