This article explains how an active NAT translated session associated with a re-named NAT rule-set is closed and removed upon committing.
When an existing NAT rule-set is re-named, all the associated session are closed and removed from the session table.
The device treats a NAT rule-set rename change as a deletion and addition of a new rule-set, causing all the associated translated sessions with the old NAT rule-set name to be torn down.
Here's an example for a Telnet session:-
NAT rule-set config:-
set security nat source rule-set abc from zone trust set security nat source rule-set abc to zone untrust set security nat source rule-set abc rule r1 match source-address 0.0.0.0/0 set security nat source rule-set abc rule r1 match destination-address 0.0.0.0/0 set security nat source rule-set abc rule r1 then source-nat interface
Policy allowing the traffic:-
set security policies from-zone trust to-zone untrust policy policy1 match source-address any set security policies from-zone trust to-zone untrust policy policy1 match destination-address any set security policies from-zone trust to-zone untrust policy policy1 match application any set security policies from-zone trust to-zone untrust policy policy1 then permit
Before the NAT rule-set abc is renamed, we see a session in progress:-
root@r008> show security flow session Session ID: 6, Policy name: policy1/4, Timeout: 1786, Valid In: 20.0.0.2/63842 --> 10.0.0.2/23;tcp, If: ge-0/0/1.0, Pkts: 10, Bytes: 682 Out: 10.0.0.2/23 --> 10.0.0.1/31214;tcp, If: ge-0/0/2.0, Pkts: 8, Bytes: 584
NAT rule-set is renamed from abc to xyz:-
root@r008# show |compare [edit security nat source] + rule-set xyz { + from zone trust; + to zone untrust; + rule r1 { + match { + source-address 0.0.0.0/0; + destination-address 0.0.0.0/0; + } + then { + source-nat { + interface; + } + } + } + } - rule-set abc { - from zone trust; - to zone untrust; - rule r1 { - match { - source-address 0.0.0.0/0; - destination-address 0.0.0.0/0; - } - then { - source-nat { - interface; - } - } - } - } [edit] root@r008# commit and-quit commit complete
Upon review of session we see that the session is no longer active in the table:-
root@r008> show security flow session Total sessions: 0
Once the traffic is initiated again, new session is formed with different session ID:-
root@r008> show security flow session Session ID: 7, Policy name: policy1/4, Timeout: 1796, Valid In: 20.0.0.2/50282 --> 10.0.0.2/23;tcp, If: ge-0/0/1.0, Pkts: 10, Bytes: 682 Out: 10.0.0.2/23 --> 10.0.0.1/22111;tcp, If: ge-0/0/2.0, Pkts: 8, Bytes: 584