*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type echo-request -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --syn -m state --state NEW -m multiport --dports 22,443,9790 -j ACCEPT
-A INPUT -p tcp -m tcp --syn --dport 53 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --syn --dport 853 -m state --state NEW -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp --dport 853 -j ACCEPT
COMMIT
*nat
:PREROUTING ACCEPT [0:0]
-A PREROUTING -p tcp -d <%= @ipv4 %> --dport 53 -j DNAT --to-destination <%= @ipv4 %>:853
-A PREROUTING -p udp -d <%= @ipv4 %> --dport 53 -j DNAT --to-destination <%= @ipv4 %>:853
:INPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
COMMIT
