1
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?

3
  • Is it all you got in output chain? are there any other rules?
    – Hex
    Jan 21, 2013 at 23:00
  • Only this one. I started today with iptables and I've been checking out how it works.
    – user149678
    Jan 21, 2013 at 23:00
  • Check out my answer.
    – Hex
    Jan 21, 2013 at 23:03

2 Answers 2

3

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

2
  • ok! problem of misunderstanding. I didn't notice about the -d.
    – user149678
    Jan 21, 2013 at 23:05
  • No problems, glad you fix it :)
    – Hex
    Jan 21, 2013 at 23:05
1

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.

You must log in to answer this question.