-
Notifications
You must be signed in to change notification settings - Fork 85
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
[caclmgrd][DualToR] Fix a case where vlan address is not network address for DualToR Active-active configuration #95
Conversation
for DualToR Active-active configuration Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
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.
Please add an example of the issue and config in the description.
@@ -54,8 +54,10 @@ def get_ipv4_networks_from_interface_table(table, intf_name): | |||
iface_name, iface_cidr = key | |||
if iface_name.startswith(intf_name): | |||
ip_ntwrk = ipaddress.ip_network(iface_cidr, strict=False) | |||
if isinstance(ip_ntwrk, ipaddress.IPv4Network): | |||
addresses.append(ip_ntwrk) | |||
ip_str = iface_cidr.split("/")[0] |
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.
Could you check if this works if there are secondary IPs in Vlan? Like two or three different IPs in the same Vlan?
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.
Works as intended, added in description
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
+1 |
added |
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.
lgtm
…ess for DualToR Active-active configuration (sonic-net#95) * [caclmgrd][DualToR] Fix a case where vlan address is not network address for DualToR Active-active configuration Signed-off-by: vaibhav-dahiya <[email protected]> * fix UT Signed-off-by: vaibhav-dahiya <[email protected]> * add all Signed-off-by: vaibhav-dahiya <[email protected]> * add test Signed-off-by: vaibhav-dahiya <[email protected]> * add ut Signed-off-by: vaibhav-dahiya <[email protected]> * add Tests Signed-off-by: vaibhav-dahiya <[email protected]> * add changes Signed-off-by: vaibhav-dahiya <[email protected]> * fix typo Signed-off-by: vaibhav-dahiya <[email protected]> * add vals Signed-off-by: vaibhav-dahiya <[email protected]> --------- Signed-off-by: vaibhav-dahiya <[email protected]>
Cherry-pick PR to 202305: #97 |
@vdahiya12 could you update ADO in the description? |
…ess for DualToR Active-active configuration (#95) * [caclmgrd][DualToR] Fix a case where vlan address is not network address for DualToR Active-active configuration Signed-off-by: vaibhav-dahiya <[email protected]> * fix UT Signed-off-by: vaibhav-dahiya <[email protected]> * add all Signed-off-by: vaibhav-dahiya <[email protected]> * add test Signed-off-by: vaibhav-dahiya <[email protected]> * add ut Signed-off-by: vaibhav-dahiya <[email protected]> * add Tests Signed-off-by: vaibhav-dahiya <[email protected]> * add changes Signed-off-by: vaibhav-dahiya <[email protected]> * fix typo Signed-off-by: vaibhav-dahiya <[email protected]> * add vals Signed-off-by: vaibhav-dahiya <[email protected]> --------- Signed-off-by: vaibhav-dahiya <[email protected]>
@StormLiangMS added |
…ess for DualToR Active-active configuration (sonic-net#95) * [caclmgrd][DualToR] Fix a case where vlan address is not network address for DualToR Active-active configuration Signed-off-by: vaibhav-dahiya <[email protected]> * fix UT Signed-off-by: vaibhav-dahiya <[email protected]> * add all Signed-off-by: vaibhav-dahiya <[email protected]> * add test Signed-off-by: vaibhav-dahiya <[email protected]> * add ut Signed-off-by: vaibhav-dahiya <[email protected]> * add Tests Signed-off-by: vaibhav-dahiya <[email protected]> * add changes Signed-off-by: vaibhav-dahiya <[email protected]> * fix typo Signed-off-by: vaibhav-dahiya <[email protected]> * add vals Signed-off-by: vaibhav-dahiya <[email protected]> --------- Signed-off-by: vaibhav-dahiya <[email protected]>
Cherry-pick PR to 202311: #189 |
…ess for DualToR Active-active configuration (#95) * [caclmgrd][DualToR] Fix a case where vlan address is not network address for DualToR Active-active configuration Signed-off-by: vaibhav-dahiya <[email protected]> * fix UT Signed-off-by: vaibhav-dahiya <[email protected]> * add all Signed-off-by: vaibhav-dahiya <[email protected]> * add test Signed-off-by: vaibhav-dahiya <[email protected]> * add ut Signed-off-by: vaibhav-dahiya <[email protected]> * add Tests Signed-off-by: vaibhav-dahiya <[email protected]> * add changes Signed-off-by: vaibhav-dahiya <[email protected]> * fix typo Signed-off-by: vaibhav-dahiya <[email protected]> * add vals Signed-off-by: vaibhav-dahiya <[email protected]> --------- Signed-off-by: vaibhav-dahiya <[email protected]>
Covers test gap #11436 which is raised to cover this issue sonic-net/sonic-host-services#95. The test will check nat rules and make sure vlan ip to mux cable soc_ip snat is correct, and in the case of multivlan, only vlan ip of the vlan as soc_ip is used.
Work item tracking
26211097
This PR fixes #82 where a corner case is not covered, if vlan address of DUT is not network address.
Basically a src IP is added to the SNAT rule so that only packets originating from ToR with src IP as vlan IP get natted by the rule and change the src IP to LoopBack IP
For multiple vlan IP's only the vlan address coming from configuration is picked as the vlan address and not the network address.
We consider a case where there are multiple vlan IP's are example in such format :
In such a case we expect iptables rules should be :
where soc_ip's are such :
Before this change the souce IP of the vlan is not correctly picked in the iptables rule