Skip to content

[interfaces.j2]: Remove syslog policy routing rules from interfaces template#28092

Open
Bojun-Feng wants to merge 1 commit into
sonic-net:masterfrom
Bojun-Feng:bug/revert-syslog-iprule-block
Open

[interfaces.j2]: Remove syslog policy routing rules from interfaces template#28092
Bojun-Feng wants to merge 1 commit into
sonic-net:masterfrom
Bojun-Feng:bug/revert-syslog-iprule-block

Conversation

@Bojun-Feng

@Bojun-Feng Bojun-Feng commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Why I did it

files/image_config/interfaces/interfaces.j2 installs policy routing rules (ip rule add pref 32764 to <server>/32 table <vrf_table>) for every SYSLOG_SERVER entry at boot time. This implementation followed the existing forced_mgmt_routes mechanism, but the Syslog Source IP HLD (Section 2.3.1) scopes syslog configuration exclusively to rsyslog.conf.j2 and does not authorize interfaces.j2 modifications.

For the unset-VRF case, the rule hijacks data-plane traffic to the management routing table after reboot (issue #27043). For the mgmt-VRF case, rsyslog.conf.j2 already handles VRF routing via Device="mgmt" (SO_BINDTODEVICE), making the ip rule redundant.

This PR removes the syslog block.

How I did it

  • Remove the SYSLOG_SERVER ip rule loop from interfaces.j2
  • Update test expectations to reflect that no syslog-specific ip rules are emitted

How to verify it

  1. Run src/sonic-config-engine/tests/test_j2files.py, all interfaces test cases should pass with updated expectations
  2. On a device with any syslog server configured, config save && reboot and confirm ip rule show has no pref 32764 entries for syslog server IPs
  3. Verify mgmt-VRF syslog servers still route correctly via rsyslog's Device="mgmt" socket binding

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202605

Description for the changelog

Remove redundant syslog policy routing rules from interfaces.j2 that conflict with data-plane routing after reboot

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

…emplate

* Remove SYSLOG_SERVER ip rule block added by PR sonic-net#20340 and VRF gate added by PR sonic-net#27068
* Remove hardcoded 10.20.6.16 fallback rule and associated test expectations

Signed-off-by: Bojun-Feng <bojundf@gmail.com>
@Bojun-Feng Bojun-Feng force-pushed the bug/revert-syslog-iprule-block branch from c31b030 to 7c81400 Compare June 25, 2026 20:44
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@Bojun-Feng

Copy link
Copy Markdown
Contributor Author

/azpw retry

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1149005:

✅Stage Test:

  • Job impacted-area-kvmtest-t1-lag-vpp by Elastictest: retried.

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request for branch(es): 202505,202511,202605.
Added label(s) for branch(es) 202505,202511,202605.

---Powered by SONiC BuildBot

@Bojun-Feng

Copy link
Copy Markdown
Contributor Author

Hi @tirupatihemanth, for context @wen587's last activity on this repo was Oct 2025, so they may not be reachable for review. The commit message for PR #20340 says the intent was to align the ip rule with the syslog server IP (paralleling NTP/TACACS forced_mgmt_routes). The HLD scopes this differently, so I believe the removal is safe regardless of original intent. Happy to wait if you'd like more time for input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants