Monthly Archives: June 2015

Allow incoming/outgoing SNMP traffic in IPTables

Allow outgoing SNMP traffic in IPTables

iptables -A INPUT -i eth0 -p udp -s--sport 161:162 -d
--dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

iptables -A OUTPUT -p udp -s --sport 1024:65535 -d
--dport 161:162 -m state --state NEW,ESTABLISHED -j ACCEPT

Allow incoming SNMP traffic in IPTables

iptables -A INPUT -i eth0 -p udp -s 152.102.124.31 --dport 161:162 -j ACCEPT
iptables -A OUTPUT -p udp -d 152.102.124.31 --dport 1024:65535 -j ACCEPT

Allow Incoming/Outgoing ICMP traffic in IPTables

Enable or allow ICMP ping incoming client request.

iptables -A INPUT -i eth0 -p icmp --icmp-type 8 -s-d
-m state --state NEW,ESTABLISHED,RELATED -j ACCEPT

iptables -A OUTPUT -p icmp --icmp-type 0 -s -d
-m state --state ESTABLISHED,RELATED -j ACCEPT

Allow or enable outgoing ping request.

iptables -A INPUT -i eth0 -p icmp --icmp-type 0 -s-d
-m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -A OUTPUT -p icmp --icmp-type 8 -s -d
-m state --state NEW,ESTABLISHED,RELATED -j ACCEPT