Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Pedro Drimel Neto" <pedrodrimel@uol.com.br>
To: netfilter@lists.netfilter.org
Subject: match nth
Date: Mon, 6 Feb 2006 11:00:00 -0200	[thread overview]
Message-ID: <00bd01c62b1d$41c1be60$2f00a8c0@TRINTASETE> (raw)

Hi all,

I'm using nth on my linux box to do a simple load balancing, I need to use 
some different IPs to connect to another server (like a "bridge", the 
clients connect on linux box and them connect to the server) this is needed 
because the "server" understand the use of license by IP.

So, I'm using nth with --packet 0, 1 and 2 what means 3 different IP (one 
interface with two logics)

I added other interface like eth1 but I don't know how to do nth match with 
more IPs (like six).

These are the rules:

#ifconfig eth0 10.0.0.1 netmask 255.255.255.0
#ifconfig eth0:0 10.0.0.2 netmask 255.255.255.0
#ifconfig eth0:1 10.0.0.3 netmask 255.255.255.0

#iptables -t nat -A POSTROUTING -o eth0 -d 10.0.0.9 -m nth --counter 
7 --every 3 --packet 0 -j SNAT --to-source 10.0.0.1
#iptables -t nat -A POSTROUTING -o eth0 -d 10.0.0.9 -m nth --counter 
7 --every 3 --packet 1 -j SNAT --to-source 10.0.0.2
#iptables -t nat -A POSTROUTING -o eth0 -d 10.0.0.9 -m nth --counter 
7 --every 3 --packet 2 -j SNAT --to-source 10.0.0.3

It's OK but when I try with eth1 only the IPs of eth0 is funcional

#ifconfig eth1 10.0.0.4 netmask 255.255.255.0
#ifconfig eth1:0 10.0.0.5 netmask 255.255.255.0
#ifconfig eth1:1 10.0.0.6 netmask 255.255.255.0

#iptables -t nat -A POSTROUTING -o eth1 -d 10.0.0.9 -m nth --counter 
7 --every 3 --packet 0 -j SNAT --to-source 10.0.0.4
#iptables -t nat -A POSTROUTING -o eth1 -d 10.0.0.9 -m nth --counter 
7 --every 3 --packet 1 -j SNAT --to-source 10.0.0.5
#iptables -t nat -A POSTROUTING -o eth1 -d 10.0.0.9 -m nth --counter 
7 --every 3 --packet 2 -j SNAT --to-source 10.0.0.6


Sorry for my bad english...

Any ideas? Thanks.

Best Regards. 



             reply	other threads:[~2006-02-06 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-06 13:00 Pedro Drimel Neto [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-01-10  1:45 match nth vikrant
2006-01-09 18:33 Pedro Drimel Neto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='00bd01c62b1d$41c1be60$2f00a8c0@TRINTASETE' \
    --to=pedrodrimel@uol.com.br \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox