-
Notifications
You must be signed in to change notification settings - Fork 1.5k
rsyslogd display "sendto() error: Network is unreachable" when management VRF is enabled #5880
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
Comments
@padmanarayana , can you comment on this issue? |
|
@anshuv-mfst Should the rsyslog service be started using "ip vrf exec mgmt" like NTP service?
|
As per design (https://github.com/Azure/SONiC/blob/master/doc/mgmt/sonic_stretch_management_vrf_design.md), syslog is currently not supported with mVRF. |
syslog is not yet supported with mVRF in the community code, thus this error when mgmt VRF is configured. |
in my case that was a problem with udp traffic. so in the bottm of my client configuration file, I have added the following line : . @@192.168.0.101:514 @@ = TCP I hope that it will help you |
@tisteagle and I made a patch that enables rsyslog for VRF management, fixing this issue. The intention is to submit a PR with the fix, but if somebody else needs it you can apply the following patch. diff --git a/files/image_config/rsyslog/rsyslog.conf.j2 b/files/image_config/rsyslog/rsyslog.conf.j2
index 37410293a..f863d8497 100644
--- a/files/image_config/rsyslog/rsyslog.conf.j2
+++ b/files/image_config/rsyslog/rsyslog.conf.j2
@@ -38,11 +38,21 @@ $UDPServerRun 514
# Define a custom template
$template SONiCFileFormat,"%timegenerated%.%timegenerated:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
+# Use RFC3164 compatible format for remote syslog
+$template SONiCRemoteFormat,"<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
$ActionFileDefaultTemplate SONiCFileFormat
#Set remote syslog server
{% for server in SYSLOG_SERVER %}
-*.* @[{{ server }}]:514;SONiCFileFormat
+*.* action(type="omfwd"
+ template="SONiCRemoteFormat"
+ target="{{ server }}"
+ port="{{SYSLOG_SERVER[server].get("port", 514)}}"
+ protocol="{{SYSLOG_SERVER[server].get("protocol", "udp")}}"
+{% if 'vrf' in SYSLOG_SERVER[server] %}
+ device="{{SYSLOG_SERVER[server]["vrf"]}}"
+{% endif %}
+ )
{% endfor %}
# You can then manually add a {
"SYSLOG_SERVER": {
"10.198.0.12": {
"vrf": "mgmt"
}
}
} |
@nazariig Nice! Confirmed to work fine for us using 202211. Thanks! I believe this issue can be closed |
Description
rsyslogd display "sendto() error: Network is unreachable" when management VRF is enabled, and eth0 does not have any syslog packet.
Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
The text was updated successfully, but these errors were encountered: