Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T6350: CGNAT add op-mode to show allocation (backport #3466) #3470

Closed
wants to merge 1 commit into from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 17, 2024

Change Summary

Add op-mode command show nat cgnat allocation to get CGNAT allocations (internal address, external address, port-range)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

cgnat

Proposed changes

How to test

set nat cgnat pool external ext01 external-port-range '1024-65535'
set nat cgnat pool external ext01 per-user-limit port '2000'
set nat cgnat pool external ext01 range 192.168.122.222/32
set nat cgnat pool internal int01 range '100.64.0.0/28'
set nat cgnat rule 10 source pool 'int01'
set nat cgnat rule 10 translation pool 'ext01'

Show allocation:

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:~$ 

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

This is an automatic backport of pull request #3466 done by [Mergify](https://mergify.com).

Add op-mode command `show nat cgnat allocation` to get CGNAT
allocations (internal address, external address, port-range)

(cherry picked from commit d5c4b75)
@mergify mergify bot mentioned this pull request May 17, 2024
12 tasks
@github-actions github-actions bot added the sagitta VyOS 1.4 LTS label May 17, 2024
@sever-sever
Copy link
Member

We do not have CGNAT for 1.4

@mergify mergify bot deleted the mergify/bp/sagitta/pr-3466 branch May 17, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sagitta VyOS 1.4 LTS
Development

Successfully merging this pull request may close these issues.

1 participant