Skip to content
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

[configlet] Duplicate Helpers IP Configuration #1403

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

d-dashkov
Copy link
Contributor

@d-dashkov d-dashkov commented Feb 5, 2021

- What I did
Fixed duplicate IP addresses when configure DHCP relay using configlets that has duplicate helper IPs.
fixes sonic-net/sonic-buildimage#6559
Also it works with dublicate IP addresses in MGMT_INTERFACE.*.forced_mgmt_routes.

- How I did it
Check the input configuration with YANG models, (in case the modes do not exist, find duplicates and remove them).

- How to verify it
DHCP_SRVERS

Create configlet.json with content:
[
{
	"VLAN": {
		"Vlan1000": {
			"dhcp_servers": ["192.0.0.6", "192.0.0.6", "192.0.0.6", "192.0.0.8"]
		}
	}
}
]

Run the following CLI commands:
configlet -j ./configlet.json -u

Duplicated instance of "dhcp_servers" leaf-list ("192.0.0.6").

MGMT_INTERFACE

Create mg_configlet.json with content:
[
{
    "MGMT_INTERFACE": {
        "eth0|192.168.111.214/24": {
		    "forced_mgmt_routes": [
				"10.0.0.100/31",
				"10.0.0.100/31",
				"10.250.0.8",
				"10.0.0.100/31",
				"10.255.0.0/28"
			],
            "gwaddr": "192.168.111.3"
        }
    }
}
]

Run the following CLI commands:
configlet -j ./mg_configlet.json -u

Note: Below table(s) have no YANG models:
MGMT_INTERFACE,
Duplicate found: 10.0.0.100/31
Duplicate found: 10.0.0.100/31

show runningconfiguration all

"eth0|192.168.111.214/24": {
	"forced_mgmt_routes": [
		"10.0.0.100/31",
		"10.250.0.8",
		"10.255.0.0/28"
	],
	"gwaddr": "192.168.111.3"
}


- New command output (if the output of a command-line utility has changed)

Duplicated instance of "" leaf-list 
Duplicate found: 192.0.0.6

Signed-off-by: d-dashkov Dmytro_Dashkov@Jabil.com

Signed-off-by: d-dashkov <Dmytro_Dashkov@Jabil.com>
Signed-off-by: d-dashkov <Dmytro_Dashkov@Jabil.com>
Signed-off-by: d-dashkov <Dmytro_Dashkov@Jabil.com>
@d-dashkov
Copy link
Contributor Author

retest this please

Signed-off-by: d-dashkov <Dmytro_Dashkov@Jabil.com>
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
 [sonic-swsss] Fix the issue of field "next_hop_ip" not getting updated
 in state DB in ERSPAN Mirror (sonic-net#1375)
[vlanmgr] Support Jumbo Frame By Default (sonic-net#1393)
[fec] added logic that put port down before applying fec
onfiguration (sonic-net#1399)
 [fec] Get FEC mode when port is already admin down (sonic-net#1403)
 Refine getDbId() calling to fix build after swss-common change
 (sonic-net#1245)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[configlet/dhcp relay] Duplicate Helpers IP Configuration
1 participant