Networking Forums

Networking Forums > Computer Networking > Linux Networking > NAT: 1-1 mapping from 192.168.x.x to 10.168.x.x ?

Reply
Thread Tools Display Modes

NAT: 1-1 mapping from 192.168.x.x to 10.168.x.x ?

 
 
Stefano Masini
Guest
Posts: n/a

 
      08-31-2004, 04:13 PM
Hi,

I have a machine on a 192.168.x.x network that I would like to
configure in such a way that it believes to be in 10.168.x.x.

In other words, if a packet comes in from, say, 192.168.3.4, I would
like it to be mangled as it was coming from 10.168.3.4.

In the same way, I would like outgoing packets for 10.168.x.x to be
mapped to 192.168.x.x.

I read the iptables manual and found out abount DNAT and SNAT, but it
seems what they do at most is mangle addresses into a pool of
addresses, is a round robin fashion. I don't need round robin. I need
a 1-1 mapping.

Anybody knows if this is doable ?

Thanks!
stefano
 
Reply With Quote
 
 
 
 
Allen Kistler
Guest
Posts: n/a

 
      09-01-2004, 01:26 AM
Stefano Masini wrote:
> Hi,
>
> I have a machine on a 192.168.x.x network that I would like to
> configure in such a way that it believes to be in 10.168.x.x.
>
> In other words, if a packet comes in from, say, 192.168.3.4, I would
> like it to be mangled as it was coming from 10.168.3.4.
>
> In the same way, I would like outgoing packets for 10.168.x.x to be
> mapped to 192.168.x.x.
>
> [snip]
>
> Anybody knows if this is doable ?


Specify a netmask on the --to address. The example in the netfilter HOWTO:

# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth1 \
-j SNAT --to 1.2.3.0/24

The example does SNAT based on outgoing source address, whereas you
probably want to do SNAT based on incoming source address and DNAT based
on incoming destination address (separate rules) in PREROUTING for
different interfaces.
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mapping pc fa Fred Loh Windows Networking 1 11-28-2008 07:41 PM
Mapping to DC DS Windows Networking 3 04-29-2006 04:53 PM
Mapping Drives Joe Windows Networking 2 09-28-2004 02:42 PM
Mapping dgrohowski@agcchem.com Windows Networking 0 01-20-2004 02:17 PM
Mapping ruben armas Windows Networking 0 07-07-2003 04:43 PM



1 2 3 4 5 6 7 8 9 10 11