Re: OFFTOPIC: Re: eth0 and eth1, how to get all packets to use the right , , source-adress?

Jon Lewis (jlewis@inorganic5.fdt.net)
Wed, 24 Jun 1998 10:13:02 -0400 (EDT)


On Tue, 23 Jun 1998, Jon Lewis wrote:

> > > real real
> > > adress _____________ 192.168 _______ adress
> > > ______| isdn-router |_______| Linux |_______| Rest of
> > > |_____________| |_______| | network
> > >
> There is a trick that I belive might work for your case...but your
> description above is not 100% clear to me, so I could be wrong.
>
> Assuming the Linux box has eth0(192.168.x.x) and eth1(your routable IP
> /24), and the default route currently is via eth0, packets leaving the
> Linux box taking the default route normally will have the 192.168 address.
> To force a different saddr, no hacking should be required. Just do the
> following (assuming your real IP /24 is 1.2.3.0/24 and the ISDN router
> ether is 192.168.0.1).
>
> ifconfig eth0:0 1.2.3.254 up
> route add -net default gw 192.168.0.1 dev eth0:0

I just tested this, and it's somewhat more complex. Apparently this works
fine for assuming another IP from the same network...but you can't specify
both a device and gateway as I did above, trying for force packets to
take a non-obvious path to the gateway. To make it work in this case
another step is needed:

ifconfig eth0:0 1.2.3.254 up
route add -host 192.168.0.1 dev eth0:0
route add -net default gw 192.168.0.1

With this, I think it should work for your case.

------------------------------------------------------------------
Jon Lewis <jlewis@fdt.net> | Spammers will be winnuked or
Network Administrator | drawn and quartered...whichever
Florida Digital Turnpike | is more convenient.
______http://inorganic5.fdt.net/~jlewis/pgp for PGP public key____

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu