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

[caclmgrd][DualToR] Fix a case where vlan address is not network address for DualToR Active-active configuration #17511

Merged
merged 6 commits into from
Dec 22, 2023

Conversation

vdahiya12
Copy link
Contributor

@vdahiya12 vdahiya12 commented Dec 15, 2023

This PR fixes sonic-net/sonic-host-services#95 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 :

Vlan705                 10.131.113.17/28     up/up         N/A                   N/A
Vlan805                 10.131.111.129/26    up/up         N/A                   N/A

  "VLAN_INTERFACE": {
        "Vlan705|10.131.113.17/28": {},
        "Vlan805|10.131.111.129/26": {},

In such a case we expect iptables rules should be :

target     prot opt source               destination         
SNAT       all  --  10.131.113.17        10.131.113.19        to:10.212.64.1
SNAT       all  --  10.131.111.129       10.131.111.131       to:10.212.64.1

where soc_ip's are such :

10.131.111.131, 10.131.113.19

Before this change the souce IP of the vlan is not correctly picked in the iptables rule

for DualToR Active-active configuration

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 changed the title [caclmgrd][DualToR] Fix a case where vlan address is not network address [caclmgrd][DualToR] Fix a case where vlan address is not network address for DualToR Active-active configuration Dec 15, 2023
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@yxieca yxieca merged commit 403d13a into sonic-net:202205 Dec 22, 2023
16 checks passed
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.

2 participants