Description

This article explains how to fix the issue if the Security Director is trying to rename the NAT rule in the preview. But the renamed rule doesn't exist in the policy


The preview will be like this:


delete security nat source rule-set ExistingRuleSet

##source-nat-rule-set##

set security nat source rule-set RenamedRuleset rule RULENAME match destination-address-name ADDRESSNAME

set security nat source rule-set RenamedRuleset rule RULENAME match destination-port 443

set security nat source rule-set RenamedRuleset rule RULENAME match source-address-name ADDRESSNAME

set security nat source rule-set RenamedRuleset rule RULENAME then source-nat interface

set security nat source rule-set RenamedRuleset from zone FROMZONE

set security nat source rule-set RenamedRuleset to zone Untrust

Symptoms

This issue occurs when we change the 'Source Ingress' and 'Destination Egress' while modifying a rule under any rule set within the NAT policy. This is as per the SD Design.

Solution

To fix this issue:

 

1) Reimport the NAT policy

 

Or

 

2) If reimport is impossible, there are some database steps to fix the issue. However, the steps are lengthy when compared to simple import operations. Here are the steps:

 

mysql -ujboss -p$(grep mysql.jboss /etc/sysconfig/JunosSpace/pwd | awk -F= '{print $2}') sm_db

 

mysql> SET FOREIGN_KEY_CHECKS=0; 

mysql> delete from DCNATRuleCM where ruleSetName=" RenamedRuleset" and name="RULENAME"; 

mysql> update NatRuleSetName set ruleSetName='ExistingRuleSet' where ruleSetName ='RenamedRuleset' and policy_id = (select id from DCNatPolicyEntity where name='NATPolicyName');

mysql> SET FOREIGN_KEY_CHECKS=1; 

 

Afterward, the preview will display a different delta, which can be corrected through the WebUI.

Modification History

2024-10-30 : Article Created