To be more specififc I would use the following commands
Please Let me know If I go wrong anywhere
echo "1" > /proc/sys/net/ipv4/ip_forward
for forwarding packets
and Iptables masquerading rle as
#######################################
iptables -t nat -A POSTROUTING -j MASQUERADE
#####################################
/usr/sbin/iptables-save
##########very imp
iptables-save > /etc/sysconfig/iptables.rules
Now all teh requests thru my gateway would be allowed
FOr blocking requests made on port 80 by all would add folloing rule
###******** this rule blocks all requests coming on port 80 ******************
iptables -A FORWARD -i eth0 -p tcp -m tcp --dport 80 -j DROP
#*****************************************************
Now I would like to make an exception for IP addresses 192.168.0.82, 192.168.0.110
I would add rule
iptables -A FORWARD -i eth0 -p tcp -m tcp -s ! 192.168.0.82,192.168.0.110 --dport 80 -j DROP
Now at any stage I felt I ned to remove this rule what I would have done manually is
iptables -D FORWARD -i eth0 -p tcp -m tcp --dport 80 -j DROP
and
iptables -D FORWARD -i eth0 -p tcp -m tcp -s ! 192.168.0.82,192.168.0.110 --dport 80 -j DROP
Now I want a script to do the same thing with start stop option
I think our experts can give me a simple script to do the same