Linux-kernel mailing list archive 1998-25,: Re: OFFTOPIC: Re: eth0 and eth1, how to get all packets to use the right , , source-adress?

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

Jon Lewis (jlewis@inorganic5.fdt.net)
Tue, 23 Jun 1998 22:50:07 -0400 (EDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Chris Wedgwood: "Re: Thread implementations..."
- Previous message: Chris Atenasio: "Re: striping (RAID0) performance ?"
- In reply to: : ""

On Tue, 23 Jun 1998, William Stearns wrote:

> While this is a nice feature to have in the kernel, I think this
> is currently a network setup issue. Perhaps this could go to private
> email with Tomas summarizing the answers in a few days?
>
>
> On Sun, 21 Jun 1998, Tomas Lund wrote:
>
> > A friend of mine has a problem with routing on a Linux box. The network
> > looks something like this:
> >
> > real real
> > adress _____________ 192.168 _______ adress
> > ______| isdn-router |_______| Linux |_______| Rest of
> > |_____________| |_______| | network
> >
> > The interface on the "far side" of the isdn-router has an ip-adress from
> > the ISP, and the rest of the network is using a class C-network that is
> > routed to the ISDN-router. The Linux-box and the ethernet interface on the
> > ISDN-router use 192.168 adresses. Everything works great except one thing,
> >
> > You cannot access the internet from the Linux-box since all packets sent
> > out gets a source-adress from the 192.168-net. This i perfectly normal I
> > assume, since the default route is out trough that interface :)
> >
> > The question is, how do you get it to ALWAYS use the ip-adress on the
> > other interface?

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've used this sort of thing before to cause a system with multiple
addresses to use "the one I want" as saddr, and I think it will work in
your situation as well.

------------------------------------------------------------------
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

- Next message: Chris Wedgwood: "Re: Thread implementations..."
- Previous message: Chris Atenasio: "Re: striping (RAID0) performance ?"
- In reply to: : ""