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 #3493

Merged
merged 1 commit into from
May 21, 2024
Merged

Conversation

l0crian1
Copy link
Contributor

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

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>
@c-po c-po merged commit a67cde6 into vyos:current May 21, 2024
8 checks passed
@c-po
Copy link
Member

c-po commented May 21, 2024

@Mergifyio backport sagitta

Copy link
Contributor

mergify bot commented May 21, 2024

backport sagitta

✅ Backports have been created

c-po added a commit that referenced this pull request May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants