Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jul 2009 19:54:10 +0100
From:      Bruce Simpson <bms@incunabulum.net>
To:        "Lucian@lastdot.org" <lucian@lastdot.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: How to change default source address?
Message-ID:  <4A68B1D2.5080201@incunabulum.net>
In-Reply-To: <5a3c8f450907230757j21191a11n6cae4699ec8a76e1@mail.gmail.com>
References:  <5a3c8f450907230757j21191a11n6cae4699ec8a76e1@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Lucian@lastdot.org wrote:
> Hi guys,
>
> I need to change the default source address on a freebsd server.
> My situation is somehow similar to this
> (http://marc.info/?l=freebsd-questions&m=122535960804508&w=2).
> In linux i can easily do it like:
>
> ip ro replace default via 10.10.10.1 src a.b.c.d (where a.b.c.d is em0 alias).
>   

There is preliminary source address policy/selection support in the 
network stack, from KAME, however it is not currently fully implemented 
for IPv4.

Most users just bind their daemons to different interface addresses. As 
Julian points out, you could use a packet filter (e.g. PF, IPFW) to 
change the source address for your traffic, but I suspect you want a 
socket-layer solution.

If your applications can't be told to use different interface addresses, 
then this is the quickest way to achieve what you want. However, 
volunteers to finish the source address selection support, are more than 
welcome.

thanks,
BMS





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