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

Fix to use IPv6 linklocal address as snmp agent address

Open SuvarnaMeenakshi opened this issue 2 years ago • 2 comments

Why I did it

fixes https://github.com/sonic-net/sonic-buildimage/issues/16001 and https://github.com/sonic-net/sonic-buildimage/issues/17807

https://github.com/sonic-net/sonic-buildimage/pull/17045 modified minigraph parser to use management and loopback IPs to support SNMP query over IPv6. With this fix, if mgmt or loopback IP contains link local IP, that will not work as link local IP has to be appended with scope id associating the IP address to a specific interface. This PR change is to ensure that snmp works with link local IPv6 address.

Work item tracking
  • Microsoft ADO (number only):

How I did it

  1. Modify minigraph parser to append the Ip address with % scope id if snmp agent address being used is link local IP address.
  2. Modify snmpd.conf.j2 to take this change while checking if an IP address is ipv4 or ipv6.

How to verify it

Verified by configuring link local ipv6 address. Last login: Wed Mar 13 01:45:09 2024 from 10.1.84.57 admin@<>:~$ sudo netstat -tulnp | grep 161 ...
udp6 0 0 fe80::f6ee:31ff:fe9:161 :::* 70355/snmpd
..

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

  • [ ] 201811
  • [ ] 201911
  • [ ] 202006
  • [ ] 202012
  • [ ] 202106
  • [ ] 202111
  • [ ] 202205
  • [ ] 202211
  • [ ] 202305

Tested branch (Please provide the tested image version)

  • [ ]
  • [ ]

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

SuvarnaMeenakshi avatar Mar 13 '24 02:03 SuvarnaMeenakshi

@SuvarnaMeenakshi seems the current unit test was broken, would you please check?

keboliu avatar Mar 18 '24 03:03 keboliu

  1. parser to append the Ip address with % scope id if snmp agent address being used is l

done, please help review the changes. thank you.

SuvarnaMeenakshi avatar Mar 24 '24 19:03 SuvarnaMeenakshi

@qiluo-msft Can you please review?

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

@qiluo-msft , @SuvarnaMeenakshi is it safe to merge/cherry-pick this change?

yxieca avatar May 13 '24 16:05 yxieca

@SuvarnaMeenakshi Please raise a new PR for 202405 branch to address the conflict. Thanks

bingwang-ms avatar Jul 22 '24 15:07 bingwang-ms

@SuvarnaMeenakshi , Do we have already PR Vs. 202405 ? Thanks.

dprital avatar Aug 08 '24 09:08 dprital

@SuvarnaMeenakshi , Do we have already PR Vs. 202405 ? Thanks.

@dprital yes, the changes are already merged to 202405. @bingwang-ms fixed the tags to reflect that the changes are merged in 202405.

 git log --oneline origin/202405 | grep "linklocal"
a0ff20edf [snmpd]: Fix to use IPv6 linklocal address as snmp agent address (#18350)

SuvarnaMeenakshi avatar Aug 12 '24 16:08 SuvarnaMeenakshi