ScreenOS Firewalls (NOT SRX)
Reply
Contributor
rgmhtt
Posts: 46
Registered: ‎08-26-2009
0
Accepted Solution

NATed Interface from manual example not working on SSG5w

I recently got an SSG5w, and have been spending the last few weeks reading the manual and fiddling with the config.  I have a rather complex setup currently with an old Astaro firewall with lots of interfaces and vLANs and separate PPPoE, VoIP, and IPv6 firewalls that will all be replaced with the SSG5.  So I have already had to reinit the box as I could not delete all the cruft I first entered and started nice and clean.  Set up my zones, a few interfaces, and a policy then tried to get NAT working, to no success.  Below is my config file.  Interface 0/1 is the untrusted, public interface.  Interfaces 0/4.2 and 0/6 are the NATed interfaces I am trying to get working right now.

 

I am reading the most current manual (downloaded 7/31/09), Vol 2 - Interface Modes, NAT Modes, Configuring NAT mode.

 

set clock ntp
set clock timezone -5
set clock dst recurring start-weekday 2 0 3 02:00 end-weekday 1 0 11 02:00
set vrouter trust-vr sharable
set vrouter "untrust-vr"
exit
set vrouter "trust-vr"
unset auto-route-export
exit
set service "HP-Printing" protocol tcp src-port 1024-65535 dst-port 9100-9102
set service "IAX2" protocol tcp src-port 1024-65535 dst-port 5036-5036
set service "IAX2" + udp src-port 1-65535 dst-port 5036-5036
set service "MySSH" protocol tcp src-port 1-65535 dst-port 613-613
set service "MyVNC" protocol tcp src-port 1024-65535 dst-port 5901-5909
set service "MyVNC" + tcp src-port 1-65535 dst-port 5500-5500
set service "RSYNC" protocol tcp src-port 1024-65535 dst-port 873-873
set service "SIP-More" protocol tcp src-port 0-65535 dst-port 5061-5082
set service "SIP-More" + udp src-port 0-65535 dst-port 5061-5082
set service "Special1" protocol tcp src-port 1024-65535 dst-port 724-724
set service "Teredo" protocol tcp src-port 1024-65535 dst-port 3544-3545
set service "Webmin" protocol tcp src-port 1024-65535 dst-port 10000-10000
set service "Webmin" + tcp src-port 1024-65535 dst-port 20000-20000
set auth-server "Local" id 0
set auth-server "Local" server-name "Local"
set auth default auth server "Local"
set auth radius accounting port 1646
set admin name xxxxxxxxxxxxxx
set admin password xxxxxxxxxxxx
set admin ssh port nnnn

set admin auth timeout 30
set admin auth server "Local"
set admin format dos
set zone "Trust" vrouter "trust-vr"
set zone "Untrust" vrouter "trust-vr"
set zone "DMZ" vrouter "trust-vr"
set zone "VLAN" vrouter "trust-vr"
set zone id 100 "Home"
set zone id 101 "HTT"
set zone id 102 "Labs"
set zone id 103 "Office"
set zone id 104 "VoIP"
set zone "Untrust-Tun" vrouter "trust-vr"
set zone "Trust" tcp-rst
set zone "Untrust" block
unset zone "Untrust" tcp-rst
set zone "DMZ" tcp-rst
set zone "VLAN" block
unset zone "VLAN" tcp-rst
set zone "Home" block
unset zone "Home" tcp-rst
set zone "HTT" block
unset zone "HTT" tcp-rst
set zone "Labs" block
unset zone "Labs" tcp-rst
set zone "Office" block
unset zone "Office" tcp-rst
set zone "VoIP" block
unset zone "VoIP" tcp-rst
set zone "Untrust" screen tear-drop
set zone "Untrust" screen syn-flood
set zone "Untrust" screen ping-death
set zone "Untrust" screen ip-filter-src
set zone "Untrust" screen land
set zone "V1-Untrust" screen tear-drop
set zone "V1-Untrust" screen syn-flood
set zone "V1-Untrust" screen ping-death
set zone "V1-Untrust" screen ip-filter-src
set zone "V1-Untrust" screen land
set interface "ethernet0/0" zone "Untrust"
set interface "ethernet0/1" zone "DMZ"
set interface "ethernet0/3" zone "Office"
set interface "ethernet0/4" zone "Labs"
set interface "ethernet0/4.2" tag 17 zone "Labs"
set interface "wireless0/0" zone "Trust"
set interface "bgroup0" zone "Trust"
set interface bgroup0 port ethernet0/6
unset interface vlan1 ip
set interface ethernet0/0 ip 208.83.67.128/29
set interface ethernet0/0 route
set interface ethernet0/3 ip 208.83.67.152/29
set interface ethernet0/3 route
set interface ethernet0/4 ip 208.83.67.176/28
set interface ethernet0/4 route
set interface ethernet0/4.2 ip 192.168.128.16/28
set interface ethernet0/4.2 nat
set interface wireless0/0 ip 192.168.2.1/24
set interface wireless0/0 nat
set interface bgroup0 ip 192.168.1.1/24
set interface bgroup0 nat
set interface ethernet0/0 bandwidth egress mbw 1024 ingress mbw 1024
set interface ethernet0/3 bandwidth egress mbw 1024 ingress mbw 1924
set interface ethernet0/4 bandwidth egress mbw 1024 ingress mbw 1024
set interface ethernet0/4.2 bandwidth egress gbw 10 mbw 1024 ingress mbw 1024
unset interface vlan1 bypass-others-ipsec
unset interface vlan1 bypass-non-ip
set interface ethernet0/0 manage-ip 208.83.67.134
set interface ethernet0/3 manage-ip 208.83.67.156
set interface ethernet0/4 manage-ip 208.83.67.188
set interface ethernet0/4.2 manage-ip 192.168.128.18
unset interface ethernet0/0 ip manageable
set interface ethernet0/3 ip manageable
set interface ethernet0/4 ip manageable
set interface ethernet0/4.2 ip manageable
set interface wireless0/0 ip manageable
set interface bgroup0 ip manageable
set interface ethernet0/0 manage ping
set interface ethernet0/3 manage ping
set interface ethernet0/3 manage web
set interface ethernet0/4 manage ping
set interface ethernet0/4 manage web
set interface ethernet0/4.2 manage ping
set interface ethernet0/4.2 manage web
set interface ethernet0/4 dhcp server service
set interface ethernet0/4.2 dhcp server service
set interface wireless0/0 dhcp server service
set interface bgroup0 dhcp server service
set interface ethernet0/4 dhcp server enable
set interface ethernet0/4.2 dhcp server enable
set interface wireless0/0 dhcp server auto
set interface bgroup0 dhcp server auto
set interface ethernet0/4 dhcp server option lease 1440000
set interface ethernet0/4 dhcp server option gateway 208.83.67.188
set interface ethernet0/4 dhcp server option netmask 255.255.255.240
set interface ethernet0/4 dhcp server option dns1 208.83.67.148
set interface ethernet0/4 dhcp server option wins1 208.83.67.146
set interface ethernet0/4.2 dhcp server option lease 1440000
set interface ethernet0/4.2 dhcp server option gateway 192.168.128.18
set interface ethernet0/4.2 dhcp server option netmask 255.255.255.240
set interface ethernet0/4.2 dhcp server option dns1 208.83.67.148
set interface ethernet0/4.2 dhcp server option wins1 208.83.67.146
set interface wireless0/0 dhcp server option gateway 192.168.2.1
set interface wireless0/0 dhcp server option netmask 255.255.255.0
set interface bgroup0 dhcp server option gateway 192.168.1.1
set interface bgroup0 dhcp server option netmask 255.255.255.0
set interface ethernet0/4 dhcp server ip 208.83.67.185 to 208.83.67.187
set interface ethernet0/4.2 dhcp server ip 192.168.128.28 to 192.168.128.30
set interface wireless0/0 dhcp server ip 192.168.2.36 to 192.168.2.38
set interface bgroup0 dhcp server ip 192.168.1.33 to 192.168.1.35
unset interface ethernet0/4 dhcp server config next-server-ip
unset interface ethernet0/4 dhcp server config updatable
unset interface ethernet0/4.2 dhcp server config next-server-ip
unset interface ethernet0/4.2 dhcp server config updatable
unset interface wireless0/0 dhcp server config next-server-ip
unset interface bgroup0 dhcp server config next-server-ip
set interface "serial0/0" modem settings "USR" init "AT&F"
set interface "serial0/0" modem settings "USR" active
set interface "serial0/0" modem speed 115200
set interface "serial0/0" modem retry 3
set interface "serial0/0" modem interval 10
set interface "serial0/0" modem idle-time 10
set flow tcp-mss
unset flow no-tcp-seq-check
set flow tcp-syn-check
unset flow tcp-syn-bit-check
set flow reverse-route clear-text prefer
set flow reverse-route tunnel always
set domain htt-consult.com
set hostname newblock
set pki authority default scep mode "auto"
set pki x509 default cert-path partial
set dns host dns1 208.83.64.5
set dns host dns2 208.83.64.6
set dns host dns3 0.0.0.0
set ike respond-bad-spi 1
unset ike ikeid-enumeration
unset ike dos-protection
unset ipsec access-session enable
set ipsec access-session maximum 5000
set ipsec access-session upper-threshold 0
set ipsec access-session lower-threshold 0
set ipsec access-session dead-p2-sa-timeout 0
unset ipsec access-session log-error
unset ipsec access-session info-exch-connected
unset ipsec access-session use-error-log
set vrouter "untrust-vr"
exit
set vrouter "trust-vr"
exit
set url protocol websense
exit
set policy id 1 from "Trust" to "Untrust"  "Any" "Any" "ANY" permit
set policy id 1 disable
set policy id 1
exit
set policy id 3 name "Services" from "Labs" to "Untrust"  "Any" "Any" "ANY" permit
set policy id 3
exit
set policy id 2 name "Services" from "Labs" to "Untrust"  "Any" "Any" "DNS" permit
set policy id 2 disable
set policy id 2
set service "FTP"
set service "HTTP"
set service "HTTPS"
set service "ICMP-ANY"
set service "MySSH"
set service "NTP"
set service "RSYNC"
exit
set nsmgmt bulkcli reboot-timeout 60
set ssh version v2
set config lock timeout 5
unset license-key auto-update
set ssl encrypt 3des sha-1
set ntp server "66.187.233.4"
set wlan 0 channel auto
set wlan 1 channel auto
set snmp port listen 161
set snmp port trap 162
set vrouter "untrust-vr"
set route 0.0.0.0/0 interface ethernet0/0 gateway 208.83.67.129 preference 20 permanent
exit
set vrouter "trust-vr"
unset add-default-route
set route 0.0.0.0/0 interface ethernet0/0 gateway 208.83.67.129 preference 20
exit
set vrouter "untrust-vr"
exit
set vrouter "trust-vr"
exit
 

Super Contributor
arizvi
Posts: 287
Registered: ‎10-21-2008
0

Re: NATed Interface from manual example not working on SSG5w

Interface Natting has the following conditions : 

 

1. Interface-based NAT on traffic from the Trust zone to the Untrust zone.

 

2. Interface-based NAT on traffic from the User-Defined zone to the Untrust zone.

(Note: This is possible only if the User-Defined and Untrust zones are in different virtual routing domains.)

 

3. No interface-based NAT on traffic between the Trust and User-Defined zones.

 

I think you hitting to the condition No.2 , please verify that they are in different VRs.

 

Thanks

Atif

Contributor
rgmhtt
Posts: 46
Registered: ‎08-26-2009
0

Re: NATed Interface from manual example not working on SSG5w

HUH???

 

Why is the supplied zone 'Untrust' in the supplied vrouter 'trust-vr'?????  From reading the manual I would have expected this!  On page 96 of the manual there is this really nice graphic of the 'Trust' zone NATed to the 'Untrust' zone.

 

I feel this is a 'bug' in the default config.  Seems the 'easiest' way to fix this is to download the config, edit that one line to put the 'Untrust' zone into the 'untrust-vr' and upload the config.

 

Here goes.  If I hose it up, there is always re-initing the box again!

 

 

Contributor
rgmhtt
Posts: 46
Registered: ‎08-26-2009
0

Re: NATed Interface from manual example not working on SSG5w

OOPS!

 

"From reading the manual I would **NOT** have expected this!"

Super Contributor
arizvi
Posts: 287
Registered: ‎10-21-2008
0

Re: NATed Interface from manual example not working on SSG5w

Above update is not clear for me.

 

IS the problem resolved or still exists.

 

Thanks

Atif

If this worked for you please flag my post as an "Accepted Solution" so others can benefit. A kudo would be cool if you think I earned it.
Contributor
rgmhtt
Posts: 46
Registered: ‎08-26-2009
0

Re: NATed Interface from manual example not working on SSG5w

I made the edit change, the zone 'Untrust' is now in the virtual router 'untrust-vr'.  I did not make any other change, and still not NATing working.

 

:smileysad:

 

 

Super Contributor
arizvi
Posts: 287
Registered: ‎10-21-2008
0

Re: NATed Interface from manual example not working on SSG5w

I will check in my lab setup . but just as a workaround use the "nat src" in the policy :

 

set policy id 3 name "Services" from "Labs" to "Untrust"  "Any" "Any" "ANY" nat src permit

 

Thanks

Atif

Contributor
rgmhtt
Posts: 46
Registered: ‎08-26-2009
0

Re: NATed Interface from manual example not working on SSG5w

This change did not make a difference.  Still nothing.

 

Since interface 0/1 is now in the untrust-vr, I also tried changing the default routing so that 0.0.0.0/0 from trust-vr goes to untrust-vr and 0.0.0.0/0 from untrust-vr goes to 208.83.67.129.  No difference.

 

How do I monitor traffic through a interface so I can see what the packets look like?

Super Contributor
arizvi
Posts: 287
Registered: ‎10-21-2008
0

Re: NATed Interface from manual example not working on SSG5w

What firewall is it and what firmware are you running on it.

 

run the the following debug :

 

1) debug flow basic

2) set ff src-ip x.x.x.x

3) set ff dst-ip x.x.x.x

4) cl db

Run the ping test

5) undebug all

6) get db s

Contributor
rgmhtt
Posts: 46
Registered: ‎08-26-2009
0

Re: NATed Interface from manual example not working on SSG5w

It is a SSG5w.

 

Hardware ver:    7.10(0)

Firmware ver:     6.0.0r4.0



1) debug flow basic

 

I am not familiar with these commands.  I am a Redhat Linux guy...

 

 

2) set ff src-ip x.x.x.x

3) set ff dst-ip x.x.x.x

 

 

 Are these filter commands, so that only packets with those addresses are shown?  What do I do with the NATing of the src?

 

4) cl db

Run the ping test

 

I know ping really well :smileyhappy:  but what is the src-ip in the ping?  

 

5) undebug all

6) get db s

 

thanks for your help.

 

 

Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.