Re: Q: remapping IP addresses for inbound and outbound traffic

From: Jan Engelhardt
Date: Sat Aug 12 2006 - 13:19:58 EST



>Let one Linux box have two interfaces to IPv4 networks,
>and for some IP both networks have the host with this IP address, e.g. from RFC1918.
>Or even both use the same IPv4 address block.
>We can say that one IP from the first network
>and numerically the same IP from the second "means" different hosts.
>
>I clarify these terms so carefully because in news:comp.os.linux.networking
>some people state that I "use terms in strange ways" :)

But we are not in comp.os.linux.networking here, and getting a concrete
example like "my eth0 has 134.76.13.21/24 and my eth1 has 10.foo.bar/xyz"
is a little easier to understand.

>The software of this box needs to connect all hosts in both networks,
>and also to receive inbound TCP connections.
>The evident way is to "remap" overlapping IPv4 area of one network
>to some "place" not used neither in it nor in other.

If they do not use the same address block, they don't overlap and there is
no need to remap them.

>This means that, when we receive a packet from remapped area,
>the kernel should replace the source IP to an "internal representaion".
>Versa, sending something to "internally represented" IP
>the kernel should replace such IP by its external value.


Jan Engelhardt
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/