Networking Forums

Networking Forums > Computer Networking > Linux Networking > 1 to 1 NAT a full Subnet

Reply
Thread Tools Display Modes

1 to 1 NAT a full Subnet

 
 
Cameron Kerr
Guest
Posts: n/a

 
      06-24-2004, 05:24 AM
zapper <(E-Mail Removed)> wrote:

> I want 10.0.0.1 to see subnet 192.168.0.0/24 as 192.168.2.2/24. I want
> to map IPs from one subnet to another:
>
> 192.168.0.1 -> 192.168.2.1
> 192.168.0.2 -> 192.168.2.2
> 192.168.0.3 -> 192.168.2.3
> .....
> and so on


There is a feature for this. I've seen it the latests standard 2.6
kernels. Probably available via patch-o-matic too. It's called netmap

--
Cameron Kerr
(E-Mail Removed) : http://nzgeeks.org/cameron/
Empowered by Perl!
 
Reply With Quote
 
 
 
 
zapper
Guest
Posts: n/a

 
      06-24-2004, 05:38 AM
Hi,
This is an old question. But I hope someone must have comeup with a
solution.

Scenario:

(Inner Network) - (Gateway) - (Outernetwork)
192.168.0.1 10.0.0.1


I want 10.0.0.1 to see subnet 192.168.0.0/24 as 192.168.2.2/24. I want
to map IPs from one subnet to another:

192.168.0.1 -> 192.168.2.1
192.168.0.2 -> 192.168.2.2
192.168.0.3 -> 192.168.2.3
......
and so on


I can do this by assigning 192.168.2.0/24 IP addresses to the Gateway
interface on the outernetwork side. In case of this class C example
the Gateway will have 254 virtual interfaces on it. Otherwise the
gateway will not pick up packets addressed to 192.168.2.0/24 network.

This is all fine, but this will become very difficult to handle with
more IPs. Besides I am sure there must be an elegent method to do the
same in Linux.

Any comments on this??

(Please dont tell me to assign 192.168.2.0 IPs to hosts on my inner
lan. Thats not a possibility at this stage)
 
Reply With Quote
 
cyclone
Guest
Posts: n/a

 
      07-15-2004, 02:49 PM
Well a simple shell script will creat all the interfaces you want
without much work on your part.

Haven't tried it myself, but you should be able to make a chain rule
that rewrites the packet header to change the IP, then just make it the
gateway for the other network, insted of virtual mapping each address.
Just rewrite all packets to fake ip.
Robert

On Wed, 23 Jun 2004 22:38:25 -0700, zapper wrote:

> Hi,
> This is an old question. But I hope someone must have comeup with a
> solution.
>
> Scenario:
>
> (Inner Network) - (Gateway) - (Outernetwork)
> 192.168.0.1 10.0.0.1
>
>
> I want 10.0.0.1 to see subnet 192.168.0.0/24 as 192.168.2.2/24. I want
> to map IPs from one subnet to another:
>
> 192.168.0.1 -> 192.168.2.1
> 192.168.0.2 -> 192.168.2.2
> 192.168.0.3 -> 192.168.2.3
> .....
> and so on
>
>
> I can do this by assigning 192.168.2.0/24 IP addresses to the Gateway
> interface on the outernetwork side. In case of this class C example
> the Gateway will have 254 virtual interfaces on it. Otherwise the
> gateway will not pick up packets addressed to 192.168.2.0/24 network.
>
> This is all fine, but this will become very difficult to handle with
> more IPs. Besides I am sure there must be an elegent method to do the
> same in Linux.
>
> Any comments on this??
>
> (Please dont tell me to assign 192.168.2.0 IPs to hosts on my inner
> lan. Thats not a possibility at this stage)


 
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
Routing - Computers on either subnet have problems finding PCs on the other subnet ZZYZX Windows Networking 2 03-26-2011 01:01 AM
Broadcast address / changing subnet mask to full class C help need kentiler Windows Networking 1 02-11-2009 08:09 PM
Full Subnet with need to expand Mike Windows Networking 2 11-14-2005 09:05 PM
Shared Disk Space full when not full Steve Bruce, mct Windows Networking 3 08-25-2005 05:39 PM
1 to 1 NAT a full Subnet zapper Linux Networking 1 06-27-2004 05:02 PM



1 2 3 4 5 6 7 8 9 10 11