Why this iptables config not working ?

By tsec05 ·
for table in filter nat mangle
iptables -t $table -F
iptables -t $table -X
iptables -t $table -Z

iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A INPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

# enable fowarding
echo 1 > /proc/sys/net/ipv4/ip_forward

# Access Internet Rules
iptables -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -m multiport -p tcp --dport 80,443,21,22,110 -i eth2 -o eth1 -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 0 -o eth1 -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 8 -o eth2 -j ACCEPT
# enable DNS
#iptables -A FORWARD -p udp --sport 53 -i eth2 -o eth1 -j ACCEPT
iptables -A FORWARD -p udp --dport 53 -i eth1 -o eth2 -j ACCEPT

# Nat Dynamique
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -A FORWARD -i eth2 -o eth1 -j ACCEPT

#Nat Destination

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Networks Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums