Articles Comments

{ Berbagi, Menulis, Dan Mengajar } Ilmu… » Linux » Basic IPtables Firewall

Basic IPtables Firewall

Default Block and Selective Port to Open


#/bin/bash

iptables -Z
iptables -F -t filter
iptables -F -t nat

iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

#Untuk accept ICMP (ping)
iptables -A INPUT -s 0/0 -d 0/0 -p icmp -j ACCEPT

#Untuk Localhost
iptables -A INPUT -s 127.0.0.1 -d 0/0 -j ACCEPT

#Untuk FTP
iptables -A INPUT -s 10.8.9.153 -d 10.8.9.103 -p tcp –dport 21 -j ACCEPT

Filed under: Linux

Leave a Reply

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>