Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination                  
DROP       all  --  69.59.197.21         anywhere  

I have right now this active rule. However as you can figure out, it isn't working because I'm writing this question. If I add the rule to the INPUT chain, it works perfectly.

Initially I thought aaa of course, it isn't working because it's asking DNS for www.serverfault.com, so I added the rule iptables -A OUTPUT -s www.serverfault.com -j DROP, but still the same.

Why is iptables allowing outgoing packets to this web?

share|improve this question
    
Is it all you got in output chain? are there any other rules? –  Hex Jan 21 '13 at 23:00
    
Only this one. I started today with iptables and I've been checking out how it works. –  yzT Jan 21 '13 at 23:00
    
Check out my answer. –  Hex Jan 21 '13 at 23:03

2 Answers 2

up vote 3 down vote accepted

As far as I can understand you dont want to allow your server to connect to that ip so it should be dst not src.

iptables -A OUTPUT -d 69.59.197.21 -j DROP

share|improve this answer
    
ok! problem of misunderstanding. I didn't notice about the -d. –  yzT Jan 21 '13 at 23:05
    
No problems, glad you fix it :) –  Hex Jan 21 '13 at 23:05

You are blocking packets with a source address of 69.59.197.21 you need to block packets with a destination address of 69.59.197.21.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.