Thứ Hai, 7 tháng 1, 2019

iptables - NAT

*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [78:15453]

-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT


-A INPUT -s XXXXXX -j ACCEPT


#-A INPUT -p tcp -m state --state NEW -m tcp --dport 53714 -j ACCEPT
#-A INPUT -p tcp -m state --state NEW -m tcp --dport 3389 -j ACCEPT


-A FORWARD -i eno16777984 -o eno33557248 -p tcp -m tcp --dport 3389 --tcp-flags FIN,SYN,RST,ACK SYN -m conntrack --ctstate NEW -j ACCEPT
-A FORWARD -i eno16777984 -o eno33557248 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i eno33557248 -o eno16777984 -m conntrack --ctstate NEW,RELATED,ESTABLISHED -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited



COMMIT



*nat
:PREROUTING ACCEPT [69:4625]
:INPUT DROP [1:120]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -i eno16777984 -p tcp -m tcp --dport 3389 -j DNAT --to-destination 10.10.10.10
-A POSTROUTING ! -d 10.10.10.0/24 -o eno16777984 -j SNAT --to-source YYYYYYY
-A POSTROUTING ! -d 10.10.10.0/24 -o eno16777984 -j MASQUERADE

-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 53714 -j ACCEPT



COMMIT

Không có nhận xét nào:

Đăng nhận xét