Answers for "iptables allow all"

4

iptables open port

sudo iptables -A INPUT -p tcp --dport xxxx -j ACCEPT
Posted by: Guest on August-17-2020
0

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
Posted by: Guest on September-20-2021

Browse Popular Code Answers by Language