SNAT own module
Hi gurus,
I posted a message a few days ago about doing a forced SNAT before routing.
A good guy (thanks, Peter) answered me that it was impossible to SNAT the packet before routing because doing SNAT makes the packet impossible to route.
What I want to know is if is possible to do this in a raw manner. I mean, I
have an ethernet card (let it be eth0) which IP address 10.0.0.1, which manages the 10.0.0.X network. The problem is that hosts attached to that network don't have to have an IP address on that range. I want to "manage" all these address doing SNAT the sooner the better when a packet enters my Linux box so my machine only sees addresses on that range. I mean, independently of what an address a host has, I want my machine to view it as an owner of one of the 10.0.0.X's suitables addresses. This has to be done before routing (I also run a transparent www proxy) because I want to do MASQUERADING on POSTROUTING. The only thing I need is to change the address and update the checksums of the packet. My configuration is like this:
x.y.z.t ___ _____
s.u.w.q ___| | |
| |LINUX|
| 10.0.0.1 | | a.b.c.d
. |-------------| BOX |----------
. | |_____|
. | MY LAN TO THE ISP's ROUTER
g.h.j.k ___|
\_______ _______/
\/ I want this addresses to appear as a normal, homogeneus network to my box.
And I need to do that before routing. I have resolved the routing of the packets, but this point worries me a lot.
Does anyone know the better way to do this?
Thanks in advanced,
Eduard.
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
Quoted 1 line · On Tue, Dec 03, 2002 at 04:40:33PM +0100, Eduard Calvo (B-teljpa) EXP JAN 03…
Hi gurus,
hi again :-)
Quoted 4 lines
What I want to know is if is possible to do this in a raw manner. I mean, I
have an ethernet card (let it be eth0) which IP address 10.0.0.1, which manages the 10.0.0.X network. The problem is that hosts attached to that network don't have to have an IP address on that range.
Now we get to the point. IMHO you are trying to create an unnecessary complicated structure. The easiest way to solve this is to add another ip(s) to eth0.
If you are not allowed to do this, you could possibly just add static routes.
Anyway, not a netfilter-devel question, slightly growing offtopic.
Quoted 1 line
Does anyone know the better way to do this?
See above :-)
Quoted 1 line
Eduard.
Bye,
Peter Surda (Shurdeek) <[email protected]>, ICQ 10236103, +436505122023
--
The three Rs of Microsoft support: Retry, Reboot, Reinstall.