* many one-to-one NAT
@ 2004-05-16 13:06 Yaron Presente
2004-05-17 6:09 ` Philip Craig
0 siblings, 1 reply; 2+ messages in thread
From: Yaron Presente @ 2004-05-16 13:06 UTC (permalink / raw)
To: netfilter; +Cc: Yaron Presente
Hi All,
I'm a newbie to this list and I apologize if this question has already
appeared in previous posts.
I would like to do NAT from a private range to a public range of the
same size, in a way that just
the network part of the IP address would be translated.
For example, I would like a single iptables rule to map 192.168.10.0/24
=> 10.1.1.0/24 as follows:
192.168.10.1 => 10.1.1.1
192.168.10.2 => 10.1.1.2
.
.
.
192.168.10.254 => 10.1.1.254
I know that I can do it by defining the whole set of rules explicitly,
but I'm looking for a better solution in terms of simplicity and
performance.
Can anyone help?
Thanks,
--
Yaron Presente
MRV International
Direct : 972-4-9936237
Fax : 972-4-9890564
Email : ypresente@mrv.com
www.mrv.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: many one-to-one NAT
2004-05-16 13:06 many one-to-one NAT Yaron Presente
@ 2004-05-17 6:09 ` Philip Craig
0 siblings, 0 replies; 2+ messages in thread
From: Philip Craig @ 2004-05-17 6:09 UTC (permalink / raw)
To: Yaron Presente; +Cc: netfilter
Yaron Presente wrote:
> I would like to do NAT from a private range to a public range of the
> same size, in a way that just
> the network part of the IP address would be translated.
Use the NETMAP target. This is included in 2.6, but I think you have to
patch 2.4 kernels still.
> For example, I would like a single iptables rule to map 192.168.10.0/24
> => 10.1.1.0/24 as follows:
> 192.168.10.1 => 10.1.1.1
> 192.168.10.2 => 10.1.1.2
> .
> .
> .
> 192.168.10.254 => 10.1.1.254
Assuming 192.168.10.0/24 is private:
iptables -t nat -A PREROUTING -d 10.1.1.0/24 -j NETMAP --to 192.168.10.0/24
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -j NETMAP --to 10.1.1.0/24
--
Philip Craig - SnapGear, A CyberGuard Company - http://www.SnapGear.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-05-17 6:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-16 13:06 many one-to-one NAT Yaron Presente
2004-05-17 6:09 ` Philip Craig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox