Iptables on ubuntu Ubuntu 10.04.1 not working
- by Kevin
I am trying to block an IP address from accessing my server by using iptables, but didn't succeed.
Here are the commands that I used. (after these commands, I still keep seeing 50.18.12.86 sending request to my Apache server).
sudo iptables -F
sudo iptables -I OUTPUT -s 50.18.12.86 -j REJECT
sudo iptables -I INPUT -s 50.18.12.86 -j REJECT
sudo iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
REJECT all -- 50.18.12.86 0.0.0.0/0 reject-with icmp-port-unreachable
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
REJECT all -- 50.18.12.86 0.0.0.0/0 reject-with icmp-port-unreachable
I have tried DROP instead of REJECT, but doesn't help.