H
H
hostadmin2013-06-20 23:57:04
linux
hostadmin, 2013-06-20 23:57:04

Rules not working in iptables

Hello.

I'm trying on a web server (Debian 6) to limit the bad guys a bit and want to use iptables for that.
I enter the simplest rule to check
iptables -A INPUT -p tcp -s 111.111.111.111 -j DROP
, but you can still log in from this IP, you can see the rule with the iptables -nL command .

I tried rebooting :(

The same command run on the local server under UBUNTU works as expected - the specified IP does not have access to the computer.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
simbajoe, 2013-06-21
@hostadmin

Doesn't this answer your question: stackoverflow.com/questions/16142446/why-cant-i-block-an-ip-address-with-iptables-on-debian-6 ?

I
Ilya Evseev, 2013-06-21
@IlyaEvseev

Instead of "-A", use "-I", that is, do not add to the end of the chain, but insert it at the beginning.

P
pkv, 2013-06-26
@pkv

In order not to toil with -A -I I control the priority of the rules simply by editing the /etc/sysconfig/iptables file.
What is more priority is higher, something is lower.
Edited, saved, restarted

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question