All of lore.kernel.org
 help / color / mirror / Atom feed
* NTH
@ 2006-03-30 17:34 Pedro Drimel Neto
  2006-03-31 10:58 ` NTH Stephan Scholz
  0 siblings, 1 reply; 2+ messages in thread
From: Pedro Drimel Neto @ 2006-03-30 17:34 UTC (permalink / raw)
  To: netfilter

Hi all,

I'm using the nth module for each connection it change of IP.
The scenario is:
--------------              -------------
| Server with | ------ > |    Server    |
|      NTH     |               |   Master    |
--------------              -------------
So, the users connect to "Server with NTH" and the .bashrc of the user has a 
ssh to "Server Master".
On "Server with NTH" has an interface, eth0, with 2 logics, eth0:0 and 
eth0:1
eth0: 10.0.0.2
eth0:0 10.0.0.3
eth0:1: 10.0.0.4
Above are the rules on "Server with NTH"
iptables -t nat -A POSTROUTING -o eth0 -d "Server Master" -m nth --counter 
7 --every 3 --packet 0 -j SNAT --to-source 10.0.0.2
iptables -t nat -A POSTROUTING -o eth0 -d "Server Master" -m nth --counter 
7 --every 3 --packet 1 -j SNAT --to-source 10.0.0.3
iptables -t nat -A POSTROUTING -o eth0 -d "Server Master" -m nth --counter 
7 --every 3 --packet 2 -j SNAT --to-source 10.0.0.4

So, at each connection to "Server Master" the IP is changed.
As NTH support only packet 0, 1 and 2 and I need to more IPs to be changed, 
if I add more a interface does it work ?
Thanks a lot.

Regards. 



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: NTH
  2006-03-30 17:34 NTH Pedro Drimel Neto
@ 2006-03-31 10:58 ` Stephan Scholz
  0 siblings, 0 replies; 2+ messages in thread
From: Stephan Scholz @ 2006-03-31 10:58 UTC (permalink / raw)
  To: Pedro Drimel Neto; +Cc: netfilter

Yes, that should work. Simply increase the "every" number and add a new rule.

Example for 4 hosts:

iptables -t nat -A POSTROUTING -o eth0 -d "Server Master" -m nth --counter 7 --every 4 --packet 0 -j SNAT --to-source 10.0.0.2
iptables -t nat -A POSTROUTING -o eth0 -d "Server Master" -m nth --counter 7 --every 4 --packet 1 -j SNAT --to-source 10.0.0.3
iptables -t nat -A POSTROUTING -o eth0 -d "Server Master" -m nth --counter 7 --every 4 --packet 2 -j SNAT --to-source 10.0.0.4
iptables -t nat -A POSTROUTING -o eth0 -d "Server Master" -m nth --counter 7 --every 4 --packet 3 -j SNAT --to-source 10.0.0.5

Stephan

Pedro Drimel Neto wrote:
> Hi all,
> 
> I'm using the nth module for each connection it change of IP.
> The scenario is:
> --------------              -------------
> | Server with | ------ > |    Server    |
> |      NTH     |               |   Master    |
> --------------              -------------
> So, the users connect to "Server with NTH" and the .bashrc of the user
> has a ssh to "Server Master".
> On "Server with NTH" has an interface, eth0, with 2 logics, eth0:0 and
> eth0:1
> eth0: 10.0.0.2
> eth0:0 10.0.0.3
> eth0:1: 10.0.0.4
> Above are the rules on "Server with NTH"
> iptables -t nat -A POSTROUTING -o eth0 -d "Server Master" -m nth
> --counter 7 --every 3 --packet 0 -j SNAT --to-source 10.0.0.2
> iptables -t nat -A POSTROUTING -o eth0 -d "Server Master" -m nth
> --counter 7 --every 3 --packet 1 -j SNAT --to-source 10.0.0.3
> iptables -t nat -A POSTROUTING -o eth0 -d "Server Master" -m nth
> --counter 7 --every 3 --packet 2 -j SNAT --to-source 10.0.0.4
> 
> So, at each connection to "Server Master" the IP is changed.
> As NTH support only packet 0, 1 and 2 and I need to more IPs to be
> changed, if I add more a interface does it work ?
> Thanks a lot.
> 
> Regards.
> 


-- 

Stephan Scholz

sscholz@astaro.com | Development
Astaro AG | www.astaro.com | Phone +49-721-25516-0
Fax +49-721-25516-200
Amalienbadstraße 36 / Bau 33a | 76227 Karlsruhe | Germany

- PC Magazine Best of the Year 2004/2005
- CRN Best of the Year 2005
- SC Magazine "Best Buy" & 5 star rating - October 2005, Best of the Year 2005
- Internet Professionell "Empfehlung der Redaktion" - November 2005



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-31 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-30 17:34 NTH Pedro Drimel Neto
2006-03-31 10:58 ` NTH Stephan Scholz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.