Add the ability to get all address and port block allocation in syslog.
Changing the external address range could change the combination of external address and port allocation. It will be to get the actual allocations in the syslog during the commit.
Initial config
set nat cgnat pool external ext-01 external-port-range '4000-8000' set nat cgnat pool external ext-01 per-user-limit port '2000' set nat cgnat pool external ext-01 range 192.168.122.222/32 set nat cgnat pool external ext-01 range 192.168.122.225/32 set nat cgnat pool internal int-01 range '100.64.0.1-100.64.0.4' set nat cgnat rule 10 source pool 'int-01' set nat cgnat rule 10 translation pool 'ext-01'
Allocations:
vyos@r4# run show nat cgnat allocation Internal IP External IP Port range ------------- --------------- ------------ 100.64.0.1 192.168.122.222 4000-5999 100.64.0.2 192.168.122.222 6000-7999 100.64.0.3 192.168.122.225 4000-5999 100.64.0.4 192.168.122.225 6000-7999 [edit] vyos@r4#
Change external pool
delete nat cgnat pool external ext-01 range 192.168.122.222/32 set nat cgnat pool external ext-01 range 192.168.122.254/32 commit
Check after the change. External address and port 192.168.122.225:4000-5999 are different for the same internal IP
vyos@r4# run show nat cgnat allocation Internal IP External IP Port range ------------- --------------- ------------ 100.64.0.1 192.168.122.225 4000-5999 100.64.0.2 192.168.122.225 6000-7999 100.64.0.3 192.168.122.254 4000-5999 100.64.0.4 192.168.122.254 6000-7999
It's nice to have this information in the syslog when it was changed to log the actual info allocation.