how to interconnect two private network

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to interconnect two private network with possibles addresses in the 
same netmask with the help on a proxy machine with two interfaces 

example 

in the first network i have a client with IP address in 10.34.248.134 ( class 
C ) and i try to reach a server on the other private network with an IP 
address 10.10.254.12 .
My problem is 
With iptables and nat , it is possible to replace the address of clients with 
the address of the proxy .
But my purpose is to replace the client address in the proxy partially 
So i want to have a partial replacement on the input 
So the addresse 10.34.248.134 is changed in 154.34.248.134 by the nat .
Therefore i want to change only the first byte of the client address .

In my machine proxy i have squid to requests on http, https , ftp under http
and i have delegate to requests on another protocols or like "proxy socks" 
So to manage the routes , i just need that the clients address be changed 
beetwen the entry on the machine and the proxy service .
Like this the route on the proxy machine are simplified because the requests 
destinated to server are routed on the interface ( route by default ) .
And all the request that are done by clients are routed on the other interface 
on the nat with a rule for address 154.x.x.x and changed by the nat in 
address 10.x.x.x .

I want trying to do this the following rule

iptables -t nat -A POSTROUTING -s 10.0.0.0/255.0.0.0 -o eth0 -j SNAT --to 
source 154.0.0.0/255.0.0.0 

But i am not sure , is my probleme solvable by a combination of iptables , nat 
and route ?

Thanks for any clue 

Guilhem michel

-- 
Guilhem michel Administrateur proxy



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux