Page MenuHomeVyOS Platform

CGNAT add op-mode to get current port allocation mapping
Closed, ResolvedPublicFEATURE REQUEST

Description

Add op-mode commands for getting current port allocation mapping

show nat cgant port-mapping
or
show nat cgnat port-allocation

It should show mapping from sudo nft list table ip cgnat
For example:

% show nat cgnat port allocation
Internal address     External address    External allocated ports
----------------     ----------------    --------------
100.64.0.1           192.0.2.1           3024-5023
100.64.0.2           192.0.2.1           5024-7023
100.64.0.3           192.0.2.1           7024-9023

Details

Version
-
Is it a breaking change?
Perfectly compatible
Issue type
Feature (new functionality)

Event Timeline

Viacheslav triaged this task as Wishlist priority.

PR https://github.com/vyos/vyos-1x/pull/3466

vyos@r4:~$ show nat cgnat allocation 
Internal IP    External IP      Port range
-------------  ---------------  ------------
100.64.0.0     192.168.122.222  1024-3023
100.64.0.1     192.168.122.222  3024-5023
100.64.0.2     192.168.122.222  5024-7023
100.64.0.3     192.168.122.222  7024-9023
100.64.0.4     192.168.122.222  9024-11023
100.64.0.5     192.168.122.222  11024-13023
100.64.0.6     192.168.122.222  13024-15023
100.64.0.7     192.168.122.222  15024-17023
100.64.0.8     192.168.122.222  17024-19023
100.64.0.9     192.168.122.222  19024-21023
100.64.0.10    192.168.122.222  21024-23023
100.64.0.11    192.168.122.222  23024-25023
100.64.0.12    192.168.122.222  25024-27023
100.64.0.13    192.168.122.222  27024-29023
100.64.0.14    192.168.122.222  29024-31023
100.64.0.15    192.168.122.222  31024-33023
vyos@r4:~$
Viacheslav changed the task status from Open to In progress.May 17 2024, 6:41 AM
Viacheslav claimed this task.
Viacheslav moved this task from Open to Finished on the VyOS 1.5 Circinus board.