-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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][IPv6]: Fix SNMP IPv6 reachability issue in certain scenarios #15487
Merged
Merged
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8e7aa23
[SNMP][IPv6]: Fix SNMP IPv6 reachability issue in certain scenario
SuvarnaMeenakshi cf2f69d
snmpd to listen on loopback0 ip only if interface exists.
SuvarnaMeenakshi 8b1359f
Update minigraph parser to update SNMP_AGENT_ADDRESS_CONFIG
SuvarnaMeenakshi 6d0c64f
Add unit-test for minigraph change.
SuvarnaMeenakshi 27ed71e
Update minigraph parser and add unit-test.
SuvarnaMeenakshi da40251
Moved logic to minigraph parser to add right IP addresses.
SuvarnaMeenakshi 6859d0d
Remove logic to get docker0 ip.
SuvarnaMeenakshi e9cdf0a
Modify function name
SuvarnaMeenakshi 40ba8f1
Modify to simpler change to easily backport to
SuvarnaMeenakshi 15bf353
Merge remote-tracking branch 'origin/master' into HEAD
SuvarnaMeenakshi d1e4de4
Merge remote-tracking branch 'origin/master' into HEAD
SuvarnaMeenakshi 817396c
Modify as per review comment
SuvarnaMeenakshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,22 @@ mkdir -p /etc/ssw /etc/snmp | |
# Parse snmp.yml and insert the data in Config DB | ||
/usr/bin/snmp_yml_to_configdb.py | ||
|
||
DOCKER0_V4=$(ip -4 addr show docker0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
DOCKER0_V6=$(ip -6 addr show docker0 scope global | grep -oP '(?<=inet6\s)[0-9a-fA-F:]+') | ||
# Loopback0 interface will not exist on multi-asic device | ||
if ip link show Loopback0 >/dev/null 2>&1; then | ||
LOOPBACK0_EXITS=true | ||
fi | ||
|
||
ADD_PARAM=$(printf '%s {"docker0_v4":"%s","docker0_v6":"%s","loopback0_exists":"%s"}' \ | ||
"-a" "$DOCKER0_V4" "$DOCKER0_V6" "$LOOPBACK0_EXITS") | ||
|
||
SONIC_CFGGEN_ARGS=" \ | ||
-d \ | ||
-y /etc/sonic/sonic_version.yml \ | ||
-t /usr/share/sonic/templates/sysDescription.j2,/etc/ssw/sysDescription \ | ||
-t /usr/share/sonic/templates/snmpd.conf.j2,/etc/snmp/snmpd.conf \ | ||
$ADD_PARAM \ | ||
" | ||
|
||
sonic-cfggen $SONIC_CFGGEN_ARGS | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic is complex.
how about minigraph.py just generated correct SNMP_AGENT_ADDRESS_CONFIG?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think docker0 IP is not part of user config, you can use template here.
However, mgmt IP, lo IP are from user config, it is natural to add them into ConfigDB SNMP_AGENT_ADDRESS_CONFIG table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the challenge of determine single/multi-asic in minigraph.py. So it is okay to keep complex code here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have modified the snmpd.conf.j2 template to use management and loopback IP for single asic platform.
With this, we could backport to previous branches to ensure that we could use ipv6 .
Next step is to: