Re: Two IP add

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

 



Op donderdag 5 juni 2003 15:29, schreef Ray Leach:
> On Thu, 2003-06-05 at 13:38, Dharmendra.T wrote:
> > On Thu, 2003-06-05 at 15:26, Paulo Andre wrote:
> >         I would like to do the following:
> >
> >         Stop MASQUESRADING to two servers say. 10.10.10.5 and 10.10.10.8,
> > how would i do this with a rule.
> >
> >         iptables -t nat -A POSTROUTING -s x.x.x.x -d ! 'servers ip' -j
> > MASQUERADE now how would i put in two ip address's ?

Ok , you could do something like this:

NO_MASK="10.10.10.5 10.10.10.8"

if [ ${NO_MASK} != "" ] ; then
  for nomask in ${NO_MASK}; do
 	iptables -t nat -A POSTROUTING -s x.x.x.x -d ! ${NO_MASK} -j MASQUERADE
done;
fi

this is a bit more flexible, cause , you can ad more ip's the NO_MASK easily 
without changing the rule itself, or have to write a new line.

Pascal



[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