I use iptables and tried to ban my ipaddress on all ports by the command:

iptables -A INPUT -p tcp -s XX.XX.XX.XX -j DROP

I cannot access lighttpd on port 80 - yeah, it works.

But I can still connect to my SSH on port 22 and doing stuffs. Please check the screenshot. What am I doing wrong?

enter image description here

link|improve this question
2  
Without seeing all of your rules, it's impossible to say. Most likely some other rule is shadowing this one. Oh by the way, probably not the best idea to be posting your IP like that knowing that it's not secured. – Chris May 5 '11 at 4:47
feedback

migrated from stackoverflow.com May 5 '11 at 7:33

This question came from our site for professional and enthusiast programmers.

2 Answers

You probably have other IPtables rules that cancel the effect of this rule.

Have you considered using a simpler frontend to IPtables, such as ufw (Uncomplicated FireWall)? Things like these have a tendency to solve themselves with a simpler tool. Typically, a program like ufw is more than enough for your average firewall configuration.

link|improve this answer
feedback

iptables -A INPUT -p tcp -s XX.XX.XX.XX --dport 22 -j DROP

link|improve this answer
Instead of 22 only, you can make it 1:65535 if you want to block all ports. – 0xAli May 5 '11 at 5:05
feedback

Your Answer

 
or
required, but never shown