Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

iptables deny all

# Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

# Accept on localhost
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# Allow established sessions to receive traffic
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
Source by superuser.com #
 
PREVIOUS NEXT
Tagged: #iptables #deny
ADD COMMENT
Topic
Name
8+3 =