sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

Fix to use IPv6 linklocal address as snmp agent address

Open SuvarnaMeenakshi opened this issue 1 year ago • 7 comments

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 avatar Mar 13 '24 06:03 SuvarnaMeenakshi

@SuvarnaMeenakshi would you please address the covrage issue?

keboliu avatar Mar 18 '24 03:03 keboliu

@SuvarnaMeenakshi Can you please address the coverage issue?

dgsudharsan avatar Apr 24 '24 04:04 dgsudharsan

@SuvarnaMeenakshi Please fix the coverage issue. Appreciate if you can share an ETA.

bingwang-ms avatar Apr 24 '24 15:04 bingwang-ms

@SuvarnaMeenakshi would you please fix the coverage issue?

keboliu avatar May 13 '24 09:05 keboliu

@qiluo-msft would you please review?

keboliu avatar May 23 '24 10:05 keboliu

@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 avatar May 23 '24 17:05 SuvarnaMeenakshi

@SuvarnaMeenakshi seems there is a unit test issue, would you please check?

keboliu avatar Jun 07 '24 02:06 keboliu

Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-utilities/pull/3487

mssonicbld avatar Aug 12 '24 17:08 mssonicbld