lkml.org 
[lkml]   [1998]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectOFFTOPIC: Re: eth0 and eth1, how to get all packets to use the right , , source-adress?
Good day, Tomas,

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?

I'm having a really tough time figuring out how one could do this
in the arrangement you've shown above. As the source code for the kernel
is available, I suppose you could put together some kludge like hard
coding your source address, but this is a really bad way to go IMHO.
Using striaght masquerading with this network setup will _not_
solve this problem as masquerading rules can be applied to forwarding
packets only; packets from and to this linux box are never forwarded
through it, they just leave and arrive.
I suspect that what you're looking for is something like Cisco's
"ip unnumbered" approach, where the real address for the interface on the
right is used for the interface on the left as well. As far as I know,
this is not supported in Linux.

OPTION 1:
Unless you have a particular reason why packets from your lan need
to go _through_ the linux box, I would simply put the linux box as just
another workstation on the lan:

real real
adress _____________ adress
______| isdn-router |_______| Linux box _and_
|_____________| | Rest of network

The linux box would go from having two ethernet cards down to 1.
The linux box can still act as any kind of server it could have been
before. The only thing you lose is the ability to act as a firewall for
the lan.


OPTION 2:
If your workstations use the kind of apps that could go out
through your linux box as a masquerading firewall, you could leave your
physical network as it is and swap the network blocks:

real real
adress _____________ address _______ 192.168
______| isdn-router |_______| Linux*|_______| Rest of
|_____________| |_______| | network

* Set up IP masquerading on this box; see the Masquerading HOWTO at
http://sunsite.unc.edu/linux/HOWTO .
The network between the linux box and the ISDN router could
support any servers that need to be seen from the real world.

I suspect there _may_ be some way to do this with some really
screwed up ifconfig and route (and proxy arp?) statements, but I can't
seem to put it together.

OPTION 3:
If your ISDN router supports NAT, you could tell it to translate
the 192.168.linux.ip into a real address. With luck, it won't try to
translate the real addresses too.

Again, let's bring this one to private mail...
Cheers,
- Bill

---------------------------------------------------------------------------
Unix _is_ user friendly. It's just very selective about who its friends
are. And sometimes even best friends have fights.
William Stearns (wstearns@pobox.com)
---------------------------------------------------------------------------





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

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