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

[SNMP] SNMP doesn't respond to queries through mgmt network(ip of mgmt is obtained through DHCP) if Loopback0 has ip configured #16165

Closed
dgsudharsan opened this issue Aug 15, 2023 · 2 comments · May be fixed by #16237
Assignees
Labels
Feature Request 🚀 MSFT Triaged this issue has been triaged

Comments

@dgsudharsan
Copy link
Collaborator

Description

The snmpd generation logic #15487 considers only if the mgmt ip is configured throught config_db. However, the IP address can be obtained through DHCP. Additionally when Loopback0 is used for BGP peering, the snmpd.conf generates agentAddress in snmpd.conf which results in snmp being reachable only through Loopback0. This will break the deployments where snmp is reached through mgmt network and has DHCP based ip address configuration.

Steps to reproduce the issue:

  1. Obtain IP address of mgmt through DHCP
  2. Configure Loopback IP and perform config reload.
  3. Run snmpget from mgmt network.

Describe the results you received:

snmpget fails

snmpget -v2c -c public 10.210.25.145 1.3.6.1.2.1.1.1.0
Timeout: No Response from 10.210.25.145.

Describe the results you expected:

snmpget should succeed as below

snmpget -v2c -c public 10.210.25.145 1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: SONiC Software Version: SONiC.202211_1_RC2.45-ece0303ec_Internal - HwSku: ACS-MSN3420 - Distribution: Debian 11.7 - Kernel: 5.10.0-18-2-amd64

Output of show version:

SONiC Software Version: SONiC.202211_1_RC2.45-ece0303ec_Internal
SONiC OS Version: 11
Distribution: Debian 11.7
Kernel: 5.10.0-18-2-amd64
Build commit: a06b442c2
Build date: Thu Aug 10 02:23:11 UTC 2023
Built by: sw-r2d2-bot@r-build-sonic-ci03-243

Platform: x86_64-mlnx_msn3420-r0
HwSKU: ACS-MSN3420
ASIC: mellanox
ASIC Count: 1
Serial Number: MT2019X13880
Model Number: MSN3420-CB2FO
Hardware Revision: A1
Uptime: 22:41:33 up  3:24,  1 user,  load average: 0.40, 1.02, 1.57
Date: Tue 15 Aug 2023 22:41:33

Docker images:
REPOSITORY                                         TAG                                  IMAGE ID       SIZE
docker-syncd-mlnx                                  202211_1_RC2.45-ece0303ec_Internal   25493653e11d   973MB
docker-syncd-mlnx                                  latest                               25493653e11d   973MB
docker-platform-monitor                            202211_1_RC2.45-ece0303ec_Internal   04074747a748   965MB
docker-platform-monitor                            latest                               04074747a748   965MB
docker-orchagent                                   202211_1_RC2.45-ece0303ec_Internal   f9a6dc2b87d8   475MB
docker-orchagent                                   latest                               f9a6dc2b87d8   475MB
docker-fpm-frr                                     202211_1_RC2.45-ece0303ec_Internal   abf77b6e7b2a   486MB
docker-fpm-frr                                     latest                               abf77b6e7b2a   486MB
docker-teamd                                       202211_1_RC2.45-ece0303ec_Internal   7039e9373fcf   456MB
docker-teamd                                       latest                               7039e9373fcf   456MB
docker-macsec                                      202211_1_RC2.44-ece0303ec_Internal   49a5dca8e944   458MB
docker-dhcp-relay                                  202211_1_RC2.44-ece0303ec_Internal   9cf9208b7a86   449MB
docker-eventd                                      202211_1_RC2.45-ece0303ec_Internal   b5de84719995   439MB
docker-eventd                                      latest                               b5de84719995   439MB
docker-snmp                                        202211_1_RC2.45-ece0303ec_Internal   415c498506a7   484MB
docker-snmp                                        latest                               415c498506a7   484MB
docker-sonic-telemetry                             202211_1_RC2.45-ece0303ec_Internal   706033e980f4   738MB
docker-sonic-telemetry                             latest                               706033e980f4   738MB
docker-lldp                                        202211_1_RC2.45-ece0303ec_Internal   4c615ec009f9   482MB
docker-lldp                                        latest                               4c615ec009f9   482MB
docker-mux                                         202211_1_RC2.45-ece0303ec_Internal   625568f82573   488MB
docker-mux                                         latest                               625568f82573   488MB
docker-sonic-p4rt                                  202211_1_RC2.45-ece0303ec_Internal   bf83bd5ceb82   522MB
docker-sonic-p4rt                                  latest                               bf83bd5ceb82   522MB
docker-database                                    202211_1_RC2.45-ece0303ec_Internal   0ed49cbf9409   440MB
docker-database                                    latest                               0ed49cbf9409   440MB
docker-router-advertiser                           202211_1_RC2.45-ece0303ec_Internal   177f5db7bb29   440MB
docker-router-advertiser                           latest                               177f5db7bb29   440MB
docker-sonic-mgmt-framework                        202211_1_RC2.45-ece0303ec_Internal   06258ca6b537   553MB
docker-sonic-mgmt-framework                        latest                               06258ca6b537   553MB
docker-nat                                         202211_1_RC2.45-ece0303ec_Internal   7006772b40a8   425MB
docker-nat                                         latest                               7006772b40a8   425MB
docker-sflow                                       202211_1_RC2.45-ece0303ec_Internal   82ff0d249905   423MB
docker-sflow                                       latest                               82ff0d249905   423MB
urm.nvidia.com/sw-nbu-sws-sonic-docker/sonic-wjh   1.5.4-202211-9                       63a31e8ed3e6   432MB
urm.nvidia.com/sw-nbu-sws-sonic-docker/doai        1.0.0-202211-4                       cfa4c2484b87   200MB

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

sonic_dump_r-lionfish-13_20230815_223522.tar.gz
before_lb_ip_snmpd.conf.txt
after_lb_ip_snmpd.conf.txt

@gechiang gechiang added Triaged this issue has been triaged MSFT labels Aug 16, 2023
@dgsudharsan
Copy link
Collaborator Author

Hi @SuvarnaMeenakshi Do you have any update on this issue?

SuvarnaMeenakshi added a commit to sonic-net/sonic-mgmt that referenced this issue Aug 25, 2023
What is the motivation for this PR?
Issue sonic-net/sonic-buildimage#16165

Changes added in the PR sonic-net/sonic-buildimage#15487 to support SNMP over IPv6 does not handle if mgmt IP address is obtained via DHCP.

How did you do it?
Skip the sonic-mgmt SNMP IPv6 related tests in 202211 so that the sonic-net/sonic-buildimage#15487 can be reverted.
@SuvarnaMeenakshi
Copy link
Contributor

We will need to update STATE_DB with changes to mgmt ip.
With the STATE_DB update, we could have snmp listening on STATE_DB change and restart snmpd so that it can listen on newly configured mgmt IP obtained via DHCP.

AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this issue Jan 25, 2024
…et#9630)

What is the motivation for this PR?
Issue sonic-net/sonic-buildimage#16165

Changes added in the PR sonic-net/sonic-buildimage#15487 to support SNMP over IPv6 does not handle if mgmt IP address is obtained via DHCP.

How did you do it?
Skip the sonic-mgmt SNMP IPv6 related tests in 202211 so that the sonic-net/sonic-buildimage#15487 can be reverted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request 🚀 MSFT Triaged this issue has been triaged
Projects
None yet
3 participants