-
Notifications
You must be signed in to change notification settings - Fork 665
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
Management vrf snmp cli support #472
Management vrf snmp cli support #472
Conversation
This commit adds CLI support for management VRF using l3dev. mVRF can be enabled using config vrf add mgmt and deleted using config vrf del mgmt. Show commands for management VRF are added which displays the linux command output, will update show command display after concluding what would be the output for the show commands. Added cli to configure management interface(eth0), config interface ip eth0 add can be used to configure eth0 ip and config ip eth0 remove is used to remove eth0 ip. New cli config/show commands: config vrf add mgmt config vrf del mgmt config interface eth0 ip add ip/mask gatewayIP config interface eth0 ip remove ip/mask show mgmt-vrf show mgmt-vrf route show mgmt-vrf addresses show mgmt-vrf interfaces Signed-off-by: Harish Venkatraman <[email protected]>
f6071a6
to
b5647b9
Compare
Are the changes for SNMP CLI described anywhere ? |
@a-barboza : We will be explaining these CLIs in the CLI reference manual. If you need the same information to be filled in this PR, let us know. |
|
@a-barboza : We shall look into this PR after we merge the PR463. Request you to kindly review the 463 and provide the comments. |
@a-barboza : Reg Q5 "In snmpagentaddress why is the get_entry() there? Is it a No-OP ?", |
This PR has dependency on PR3586 for handling these config change in the backend. Request you to merge this after the PR3586 is merged. |
Dependent PR3586 is merged. Request the reviewers to review this PR. |
retest this please |
1 similar comment
retest this please |
) #### Why I did it sonic-net/sonic-utilities#472 Added SNMP_AGENT_ADDRESS_CONFIG table in config db. This PR is to add corresponding YANG model for that table. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Added YANG modesl for SNMP_AGENT_ADDRESS_CONFIG. keys: agent_ip, port number, vrf. CLI implementaion checks if agent_ip, port number already exists in CONFIG_DB table, if it does, then new entry is not added. So added another condition to ensure combination of agent_ip and port is unique. Below is an example of how data looks like in DB: ``` 127.0.0.1:6379[4]> HGETALL "SNMP_AGENT_ADDRESS_CONFIG|10.1.1.1|161|foo" 1) "NULL" 2) "NULL" 127.0.0.1:6379[4]> HGETALL "SNMP_AGENT_ADDRESS_CONFIG|10.1.0.32|161|" 1) "NULL" 2) "NULL" ``` #### How to verify it Added unit-test for various combinations and ensures that it passes.
…ic-net#15587) #### Why I did it sonic-net/sonic-utilities#472 Added SNMP_AGENT_ADDRESS_CONFIG table in config db. This PR is to add corresponding YANG model for that table. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Added YANG modesl for SNMP_AGENT_ADDRESS_CONFIG. keys: agent_ip, port number, vrf. CLI implementaion checks if agent_ip, port number already exists in CONFIG_DB table, if it does, then new entry is not added. So added another condition to ensure combination of agent_ip and port is unique. Below is an example of how data looks like in DB: ``` 127.0.0.1:6379[4]> HGETALL "SNMP_AGENT_ADDRESS_CONFIG|10.1.1.1|161|foo" 1) "NULL" 2) "NULL" 127.0.0.1:6379[4]> HGETALL "SNMP_AGENT_ADDRESS_CONFIG|10.1.0.32|161|" 1) "NULL" 2) "NULL" ``` #### How to verify it Added unit-test for various combinations and ensures that it passes.
CLI commands for configuring few parameters that are required in snmpd.conf.
Requried back end snmpd patches are already applied in sonic-buildimage to handle this additional "VRF" configuration.
Configuration
root@sonic:# config vrf add mgmt
root@sonic:# config snmpagentaddress add 100.104.45.9 -v mgmt
root@sonic:# config snmptrap modify 3 100.94.212.7 -v mgmt
root@sonic:# cat /etc/sonic/snmp.yml
snmp_rocommunity: public
snmp_location: public
v1_trap_dest: NotConfigured
v2_trap_dest: NotConfigured
v3_trap_dest: 100.94.212.7:162%mgmt public
snmp_agent_address_1: 100.104.45.9%mgmt
root@sonic:~# docker exec -it snmp bash
The file /etc/snmp/snmpd.conf inside snmp docker shows the following configuration which will be used by snmpd daemon.
Following %mgmt will be used by snmpd to listen to the IP 100.104.45.9 in "mgmt" vrf.
agentAddress 100.104.45.9%mgmt
Following %mgmt will be used by snmpd to send traps to the server 100.94.212.7 in "mgmt" vrf.
informsink 100.94.212.7:162%mgmt public