Site icon Learning & Doing

blok IP with IPtables

Blok IP :

# iptables -A INPUT -s 65.55.44.100 -j DROP
# service iptables save

unblock :

# iptables -D INPUT -s xx.xxx.xx.xx -j DROP
# iptables -D INPUT -s 65.55.44.100 -j DROP
# service iptables save

cek config :

nano /etc/sysconfig/iptables

 

If you just want to block access to one port from an ip 65.55.44.100 to port 25 then type command:
# iptables -A INPUT -s 65.55.44.100 -p tcp --destination-port 25 -j DROP

Exit mobile version