Configuring DNAT on Juniper SRX300
I have a web server (10.9.21.17) behind my Juniper SRX firewall. I want to make it available to the Internet. I have one static public ip address (1.1.1.116) and it is bound to the interface facing the Internet
edit security
set zones security-zone trust address-book address WEBSERV1 10.9.21.17/32
edit nat destination
set pool NATPOOL-WEB1 address 10.9.21.17 port 80
set rule-set RULE-WEB from zone untrust
set rule-set RULE-WEB rule R1 match destination-address 1.1.1.116
set rule-set RULE-WEB rule R1 match destination-port 80
set rule-set RULE-WEB rule R1 then destination-nat pool NATPOOL-WEB1
exit
edit policies from-zone untrust to-zone trust
set policy WEB1-ACCESS match source-address any destination-address WEBSERV1 application junos-http
set policy WEB1-ACCESS then permit
exit
exit
edit security
set zones security-zone trust address-book address WEBSERV2 10.9.21.90/32
edit nat
set proxy-arp interface ge-0/0/0.0 address 1.1.1.73
edit destination
set pool NATPOOL-WEB2 address 10.9.21.90 port 80
set rule-set RULE-WEB from zone untrust
set rule-set RULE-WEB rule R2 match destination-address 1.1.1.73
set rule-set RULE-WEB rule R2 match destination-port 80
set rule-set RULE-WEB rule R2 then destination-nat pool NATPOOL-WEB2
exit
edit policies from-zone untrust to-zone trust
set policy WEB2-ACCESS match source-address any destination-address WEBSERV2 application junos-http
set policy WEB2-ACCESS then permit
exit
exit
set rule-set RULE-WEB rule R2 match destination-port 80
set applications application SSH-2022 protocol tcp
set applications application SSH-2022 destination-port 2022
set security zones security-zone trust address-book address MONITOR 10.9.6.25/32
set security nat destination pool MONITOR_2022 address 10.9.6.25/32
set security nat destination pool MONITOR_2022 address port 2022
set security nat destination pool MONITOR_2443 address 10.9.6.25/32
set security nat destination pool MONITOR_2443 address port 2443
set security nat destination rule-set DNAT-MONITOR from zone CHARTER
set security nat destination rule-set DNAT-MONITOR rule DNAT_MONITOR_2022 match destination-address 1.1.1.18/32
set security nat destination rule-set DNAT-MONITOR rule DNAT_MONITOR_2022 match destination-port 2022
set security nat destination rule-set DNAT-MONITOR rule DNAT_MONITOR_2022 then destination-nat pool MONITOR_2022
set security nat destination rule-set DNAT-MONITOR rule DNAT_MONITOR_2443 match destination-address 1.1.1.18/32
set security nat destination rule-set DNAT-MONITOR rule DNAT_MONITOR_2443 match destination-port 2443
set security nat destination rule-set DNAT-MONITOR rule DNAT_MONITOR_2443 then destination-nat pool MONITOR_443
set security policies from-zone CHARTER to-zone trust policy NAT-MONITOR match source-address any
set security policies from-zone CHARTER to-zone trust policy NAT-MONITOR match destination-address MONITOR
set security policies from-zone CHARTER to-zone trust policy NAT-MONITOR match application any
set security policies from-zone CHARTER to-zone trust policy NAT-MONITOR then permit