sonic-utilities
sonic-utilities copied to clipboard
Fix to use IPv6 linklocal address as snmp agent address
What I did
If link local IPv6 address is added as SNMP agent address, it will fail. This PR requires changes in snmpd.conf.j2 template here https://github.com/sonic-net/sonic-buildimage/pull/18350/
How I did it
Append scope id to ipv6 link local IP address.
How to verify it
Able to configure link local ipv6 address as snmp agent address
sudo config snmpagentaddress add fe80::3a38:a6ff:fe98:e960%eth0
admin@host:~$ sonic-db-cli CONFIG_DB keys "*SNMP*"
..
SNMP_AGENT_ADDRESS_CONFIG|fe80::3a38:a6ff:fe98:e960%eth0|| ---- Newly added agent IP along with zone id
SNMP_AGENT_ADDRESS_CONFIG|FC00:1::32|161|
SNMP_COMMUNITY|<>
...
admin@host:~$ docker exec -it snmp cat /etc/snmp/snmpd.conf | grep agentAddress
..
agentAddress udp:[fe80::3a38:a6ff:fe98:e960%eth0]
..
root@host:/# snmpget -v2c -c <comm> fe80::3a38:a6ff:fe98:e960%eth0 1.3.6.1.2.1.1.1.0
iso.3.6.1.2.1.1.1.0 = STRING: "SONiC Software Version: SONiC.20231110.10 - HwSku: *** - Distribution: Debian 11.9 - Kernel: 5.10.0-23-2-amd64"
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)
@SuvarnaMeenakshi would you please address the covrage issue?
@SuvarnaMeenakshi Can you please address the coverage issue?
@SuvarnaMeenakshi Please fix the coverage issue. Appreciate if you can share an ETA.
@SuvarnaMeenakshi would you please fix the coverage issue?
@qiluo-msft would you please review?
@qiluo-msft @keboliu Can we set the expectation that while adding snmpAgent address using CLI, the zone id will be added by the use or in the configuration. For example: sudo config snmpagentaddress add fe80::3a38:a6ff:fe98:e960%eth0
@SuvarnaMeenakshi seems there is a unit test issue, would you please check?
Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-utilities/pull/3487