[lkml]   [2001]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Default outgoing IP address?
On Tue, 27 Nov 2001, Oliver Xymoron wrote:

> I have a host which has canonical address foo, which also happens to be a
> gateway. Foo happens to be on the local side of the gateway, so when
> initiating connections, they appear to be from the gateway interface
> address, bar. This is inconvenient because bar is an address on a network
> I don't have DNS authority over, etc., so it'd be nice if outgoing
> connections by default would appear to come from foo.

This should do the trick, or something similar. It changes the default
route to prefer another source address if none is set through a bind(2)

ip route chg default via $DEF_GW dev $OUTSIDE_DEV src $MY_CANOICAL_SRC

A variation of this (for a slightly different purpose) is used by me.

Peter Svensson ! Pgp key available by finger, fingerprint:
<> ! 8A E9 20 98 C1 FF 43 E3 07 FD B9 0A 80 72 70 AF
Remember, Luke, your source will be with you... always...

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.061 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site