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?<br><br>It seems this can be done very nicely in IPv6 by setting "preferred_lft 0" as described very nicely here:<br>
<br><a href="http://www.davidc.net/networking/ipv6-source-address-selection-linux">http://www.davidc.net/networking/ipv6-source-address-selection-linux</a><br><pre class="text geshifilter-text" style="font-family: monospace;">
ip -6 addr change 2a01:550:8000::11/128 dev eth0 preferred_lft 0<br></pre>There doesn't however appear to be a similar option to deprecate IPv4 addresses in this way.. <br><br>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.<br>
<br>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.<br><br>Rob<br>