Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NAT : Update the CRM used counters for SNAT and DNAT entries (sonic-n…
…et#1655) Issue : CRM used counters are not getting updated for SNAT and DNAT entries Steps to recreate: Add a static NAT entry and verify the CRM counters root@sonic:/home/admin# config nat feature enable root@sonic:/home/admin# config interface ip add Ethernet9 12.12.0.1/24 root@sonic:/home/admin# config interface ip add Ethernet11 125.56.90.12/24 root@sonic:/home/admin# config nat add interface Ethernet11 -nat_zone 1 root@sonic:/home/admin# root@sonic:/home/admin# config nat add static basic 125.56.90.8 12.12.0.2 root@sonic:/home/admin# show nat translations Static NAT Entries ..................... 2 Static NAPT Entries ..................... 0 Dynamic NAT Entries ..................... 0 Dynamic NAPT Entries ..................... 0 Static Twice NAT Entries ..................... 0 Static Twice NAPT Entries ..................... 0 Dynamic Twice NAT Entries ..................... 0 Dynamic Twice NAPT Entries ..................... 0 Total SNAT/SNAPT Entries ..................... 1 Total DNAT/DNAPT Entries ..................... 1 Total Entries ..................... 2 Protocol Source Destination Translated Source Translated Destination ---------- --------- ------------- ------------------- ------------------------ all 12.12.0.2 --- 125.56.90.8 --- all --- 125.56.90.8 --- 12.12.0.2 root@sonic:/home/admin# =============After polling interval of 300 seconds ======== root@sonic:/home/admin# crm show resources snat Resource Name Used Count Available Count --------------- ------------ ----------------- snat_entry 0 1024 root@sonic:/home/admin# root@sonic:/home/admin# crm show resources dnat Resource Name Used Count Available Count --------------- ------------ ----------------- dnat_entry 0 1024 root@sonic:/home/admin# Fix: Increment/Decrement the crm used counters for snat/dnat entries when entry is created/deleted. Repeated the same steps to add static nat entry like above and verified the crm counters. root@sonic:/home/admin# crm show resources dnat Resource Name Used Count Available Count --------------- ------------ ----------------- dnat_entry 1 1023 root@sonic:/home/admin# crm show resources snat Resource Name Used Count Available Count --------------- ------------ ----------------- snat_entry 1 1023 root@sonic:/home/admin# Signed-off-by: Akhilesh Samineni [email protected]
- Loading branch information