-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add function to retrieve docker0 ipv4 and ipv6 addresses #15606
Conversation
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
@@ -484,3 +485,26 @@ def get_asic_presence_list(): | |||
# asic is asid id: asic0, asic1.... asicN. Get the numeric value. | |||
asics_list.append(int(get_asic_id_from_name(asic))) | |||
return asics_list | |||
|
|||
def get_docker0_ip(): |
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.
docker0_v6 = None | ||
|
||
# return (None, None) for single asic platform | ||
if not is_multi_asic(): |
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.
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.
This helper function is added so that we could use this to get docker0 ip for multi-asic platform.
Most likely we will need docker0 information only for multi-asic platform.
For example, we want to update SNMP_AGENT_ADDRESS_CONFIG table in config_db with docker0 and mgmt IP in miniraph parser and we could avoid adding the single/multi-asic in minigraph parser if we ensure that required IP is passed from this helped function.
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
Do not plan to use this change. |
Why I did it
#15487 this PR modifies snmpd to listen on specific IPs.
By default, snmpd will listen on management and loopback0 ipv4 and ipv6 addresses for single asic platform.
snmpd will listen will listen on management and docker0 ip address for multi asic platforn.
This PR is to add function to retrieve docker0 ip addresses for multi-asic platform, which could be used generically.
Work item tracking
How I did it
Add a new function get_docker0_ip() in sonic_py_common to get docker0 ipv4 and ipv6 address on multi-asic platform.
How to verify it
on multi-asic platform
on single-asic platform
Which release branch to backport (provide reason below if selected)
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)