Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 27 Nov 2001 15:42:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 27 Nov 2001 15:41:58 -0500 Received: from waste.org ([209.173.204.2]:31878 "EHLO waste.org") by vger.kernel.org with ESMTP id ; Tue, 27 Nov 2001 15:41:48 -0500 Date: Tue, 27 Nov 2001 14:41:28 -0600 (CST) From: Oliver Xymoron To: Bill Davidsen cc: Linux Kernel Mailing List Subject: Re: Default outgoing IP address? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Nov 2001, Bill Davidsen wrote: > On Mon, 26 Nov 2001, Oliver Xymoron wrote: > > > On a machine with multiple interfaces, is it possible to set the default > > outgoing IP address to something other than the address for the interface > > on the outgoing route? > > > > For instance, a machine acts as a gateway, with addresses A and B, where A > > faces the world (but isn't in DNS) and B is the canonical address. > > Outgoing connections from the machine should appear to come from B. > > If you mean having multiple IP addresses on the same NIC, sure you can do > that, see the section on DNAT in iptables. However, if you have multiple > NICs, you do not want to send a packet from one which has the IP of the > other, as your router is very likely to become confused and get its ARP > table in a twist. > > You can force packets out one NIC or the other, usually using iproute, but > I don't think that's what you have in mind, is it? In any case, doable. 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. I'll take a look at iproute. -- "Love the dolphins," she advised him. "Write by W.A.S.T.E.." - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/