Re: need help with iptables
Firstly, i would advise against putting DNS names into your IPTables script for performance reasons. drop to a command box, and type ping www.yahoo.com it will ping yahoo.com, and give you their IP address. i got 184.108.40.206, but i know they also have a 66.?.?.? address range as well.
then type "whois 220.127.116.11", and it will give you the netblock (CIDR) in this case, "18.104.22.168/20". it is this you should then use in your script as opposed to www.yahoo.com. remember yahoo have more than 1 netblock, you will need to find the others and bar those as well.
for each netblock, create 2 rules like:
"iptables -A INPUT -p tcp --dport 80 -d 22.214.171.124/20 -s 10.250.0.100/16 -j DROP"
"iptables -A OUTPUT -p tcp --dport 80 -d 126.96.36.199/20 -s 10.250.0.100/16 -j DROP"
these should then block access from the 10x network specified to port 80 (http) of yahoo- after you have done that for all the netblocks yahoo has servers sitting on.
This normally indicates you are creating the chain more than once. ie, a line like this exists multiple times: iptables -N <chain name>.
Originally Posted by mahesh
Have a look for the whole of your script for reoccurances of the same declaration.