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

T6375: Fix/Update NAT logging (backport #3493) #3495

Merged
merged 1 commit into from
May 22, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented May 21, 2024

Change Summary

Fixed broken logging for "show log nat"

Added the following commands:
show log nat source
show log nat source rule <ruleNum>
show log nat destination nat
show log nat destination nat rule <ruleNum>
show log nat static
show log nat static rule <ruleNum>

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)

https://vyos.dev/T6257

Related PR(s)

Component(s) name

nat, log

Proposed changes

This change will fix the broken show log nat, as well as add additional show log nat commands with filtering on source/destination/static

How to test

Configure NAT and run show commands:

vyos@vyos:~$ show log nat
May 21 05:45:40 kernel: [SRC-NAT-15-MASQ]IN= OUT=eth0.101 SRC=10.5.5.5 DST=4.2.2.2 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=38271 DF PROTO=ICMP TYPE=8 CODE=0 ID=30181 SEQ=1
May 21 05:51:39 kernel: [STATIC-SRC-NAT-10]IN= OUT=eth0.101 SRC=10.5.5.5 DST=4.2.2.2 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=11281 DF PROTO=ICMP TYPE=8 CODE=0 ID=32481 SEQ=1
May 21 05:53:17 kernel: [STATIC-DST-NAT-10]IN=eth0.101 OUT= MAC=0c:11:a6:1d:00:00:64:9d:99:d2:08:53:08:00 SRC=192.168.2.21 DST=10.0.101.235 LEN=60 TOS=0x00 PREC=0x00 TTL=127 ID=16028 PROTO=ICMP TYPE=8 CODE=0 ID=208 SEQ=34739
May 21 13:49:51 kernel: [DST-NAT-10]IN=eth0.101 OUT= MAC=0c:11:a6:1d:00:00:64:9d:99:d2:08:53:08:00 SRC=192.168.2.21 DST=10.0.101.235 LEN=52 TOS=0x00 PREC=0x00 TTL=127 ID=19424 DF PROTO=TCP SPT=15495 DPT=22 WINDOW=64240 RES=0x00 SYN URGP=0

vyos@vyos:~$ show log nat source
May 21 05:45:40 kernel: [SRC-NAT-15-MASQ]IN= OUT=eth0.101 SRC=10.5.5.5 DST=4.2.2.2 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=38271 DF PROTO=ICMP TYPE=8 CODE=0 ID=30181 SEQ=1

vyos@vyos:~$ show log nat source rule 15
May 21 05:45:40 kernel: [SRC-NAT-15-MASQ]IN= OUT=eth0.101 SRC=10.5.5.5 DST=4.2.2.2 LEN=84 TOS=0x00 PREC=0x00 TTL=64 ID=38271 DF PROTO=ICMP TYPE=8 CODE=0 ID=30181 SEQ=1

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 #3493 done by [Mergify](https://mergify.com).

Fixed broken logging for "show log nat"

Added the following commands:
show log nat source
show log nat source rule <ruleNum>
show log nat destination nat
show log nat destination nat rule <ruleNum>
show log nat static
show log nat static rule <ruleNum>

(cherry picked from commit 5cb9b84)
@mergify mergify bot mentioned this pull request May 21, 2024
12 tasks
@github-actions github-actions bot added the sagitta VyOS 1.4 LTS label May 21, 2024
@c-po c-po requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team May 21, 2024 18:00
@c-po c-po merged commit d702b78 into sagitta May 22, 2024
4 of 5 checks passed
@mergify mergify bot deleted the mergify/bp/sagitta/pr-3493 branch May 22, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sagitta VyOS 1.4 LTS
2 participants