[Gllug] Linux Source Address selection

Robert McKay robert at mckay.com
Mon Oct 18 10:20:29 UTC 2010


I'm wondering if there is any way in Linux to deprecate IPv4 addresses so
that they are never used as the source address of an outbound connection?

It seems this can be done very nicely in IPv6 by setting "preferred_lft 0"
as described very nicely here:

http://www.davidc.net/networking/ipv6-source-address-selection-linux

ip -6 addr change 2a01:550:8000::11/128 dev eth0 preferred_lft 0

There doesn't however appear to be a similar option to deprecate IPv4
addresses in this way..

I want to make sure that a tunnel's address is never used as the source even
when the routing goes over the tunnel, unless the socket is explicitly bound
to the tunnel address.

It's not a big deal.. I can work around it by force-binding apps to the
right address but it's been annoying me for some time and I just wondered if
anyone has any bright ideas.

Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20101018/2073950e/attachment.html>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list