Skip to content

Conversation

@QxBytes
Copy link
Contributor

@QxBytes QxBytes commented Aug 12, 2022

Reason for Change:
Packets sent from a network container to another network container on the same VM and same VNET will now leave the VM, have NSG rules applied, and then return to the VM in the transparent vlan (formerly native) mode. Previously, they would be routed in the VNET namespace, never leaving the VM.

Issue Fixed:
N/A

Requirements:

Notes:
Disables rp filter to enable asymmetric routing.

Tests ok (all basic functionality, 2 VMs, NS, delete, add)
@QxBytes QxBytes marked this pull request as ready for review August 12, 2022 22:29
Comment on lines 95 to 98
_, err := nm.plClient.ExecuteCommand(DisableRPFilterCmd)
if err != nil {
return nil, fmt.Errorf("[transparent vlan] failed to disable rp filter: %w", err)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets scope this to vnet namespace level.. set disable rp_filter in vnet namespace on its creation

azureMac = "12:34:56:78:9a:bc" // Packets leaving the VM should have this MAC
loopbackIf = "lo" // The name of the loopback interface
numDefaultRoutes = 2 // VNET NS, when no containers use it, has this many routes
tunnelingTable = 2 // Packets not entering on the vlan interface go to this routing table
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have same routing table number for different vnet namespaces?

if err != nil {
return errors.Wrap(err, "transparent vlan failed to disable rp filter in vnet")
}
DisableRPFilterVlanIfCmd := strings.Replace(DisableRPFilterCmd, "all", client.vlanIfName, 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be disableRPFilterVlanIfCmd

Copy link
Member

@tamilmani1989 tamilmani1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tamilmani1989 tamilmani1989 merged commit ebbd31c into Azure:master Aug 16, 2022
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