Re: iptable for multiple ip address

Linux Advanced Routing and Traffic Control

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

 



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/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux