-
Notifications
You must be signed in to change notification settings - Fork 346
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
NAT: T6371: fix NAT op mode when list of ports/ranges configured #3532
Conversation
FYI: same behavior exists in Sagitta, this should be backported to resolve bug there as well. |
Please add before and after examples to this PR so we can see how the output changed. Backport will be created afterwards. |
@c-po, here you go: Before - case 1: -> original bug report, dport should show 5000-8000 but rather the dictionary config including port range is shown instead. This can be reproduced in 1.4x and 1.5x.
Before - case 2: -> further investigation using a comma-separated list of ports yielded this result. This can be reproduced in 1.4x and 1.5x.
After:
Test NAT rules:
Results after test NAT rules committed:
|
780c4f1
to
5429e63
Compare
…perated list of ports/ranges exists
@c-po addressed your feedback to add an inner function. Output:
|
Much more readable now! |
@Mergifyio backport sagitta |
✅ Backports have been created
|
Change Summary
Before: Issuing the op mode command "show nat source rules" will throw an exception if the user has configured NAT rules using a list of ports as a comma-separated list (e.g. '!22,telnet,http,123,1001-1005'). Also there was no handling for the "!" rule and so '!53' would display as '53'.
With this PR: Introduced iteration to capture all configured ports and append to the appropriate string for display to the user as well as handling of '!' if present in user's configuration.
Types of changes
Related Task(s)
https://vyos.dev/T6371
Related PR(s)
Component(s) name
Proposed changes
See change summary above.
How to test
Smoketest result
Checklist: