Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: Jose Luis Domingo Lopez <lartc@24x7linux.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] iptable for multiple ip address
Date: Thu, 12 Sep 2002 19:49:14 +0000	[thread overview]
Message-ID: <marc-lartc-103186025127166@msgid-missing> (raw)
In-Reply-To: <marc-lartc-103183780131074@msgid-missing>

On Thursday, 12 September 2002, at 16:54:03 +0200,
Juan Antonio Morillas Cerezo wrote:

>         	Yes, with iptables you can have more than one IP
>         address for each physical interface, both in "local" and
>         "external" places, then you have to add them as aliases with
>         ip, and do some NAT to connect each side, if there are private
>         IPs involved.
> 
I would add the following. If what the original poster wants is to
somehow give a LAN with private IP addressing access to the Internet
using not a simple public IP address, but a pool of them, you easily
can. Just create an iptables rule with a SNAT target like this:

iptables -t nat -A POSTROUTING --out-interface $WAN_IF \
    --jump SNAT --to-source $START_PUB_IP-$END_PUB_IP

The only limitation I see with this approach is that IP addresses must
be contiguous, but I think this is a typical scenario, because our ISP
tend to give addresses in blocks :)

Hope this helps.

-- 
Jose Luis Domingo Lopez
Linux Registered User #189436     Debian Linux Woody (Linux 2.4.19-pre6aa1)
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  parent reply	other threads:[~2002-09-12 19:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-12 13:35 [LARTC] iptable for multiple ip address James Ma
2002-09-12 14:54 ` Juan Antonio Morillas Cerezo
2002-09-12 19:49 ` Jose Luis Domingo Lopez [this message]
2002-09-14 12:14 ` Eric Leblond

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=marc-lartc-103186025127166@msgid-missing \
    --to=lartc@24x7linux.com \
    --cc=lartc@vger.kernel.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