Skip to content

Conversation

@QxBytes
Copy link
Contributor

@QxBytes QxBytes commented Oct 28, 2023

Reason for Change:

IP forwarding may not be enabled on the vm when transparent vlan endpoint client first starts (for the first time on this new vm). When namespaces are created, they would have ip forwarding disabled, leading to connectivity issues. This change runs a command to enable forwarding in each namespace on creation, as well as on the vm when the network is first created. Enabling IP forwarding on the namespace may be redundant but is useful for testing (can be removed if necessary). Does not use the existing enable ip forwarding function because that function seems to add additional iptable rules.

Adds transparent vlan multitenancy conflist to dropgz for testing.

Issue Fixed:

See above.

Requirements:

Notes:

@QxBytes QxBytes added cni Related to CNI. fix Fixes something. labels Oct 28, 2023
@QxBytes QxBytes marked this pull request as ready for review October 30, 2023 23:34
case opModeTransparentVlan:
logger.Info("Transparent vlan mode")
ifName = extIf.Name
nu := networkutils.NewNetworkUtils(nm.netlink, nm.plClient)
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 add UT for this code? if it returns error, cni should bubble up the err correctly

@QxBytes QxBytes force-pushed the alew/enable-ip-forward branch from dcfe1f9 to 18777da Compare November 2, 2023 00:34
@QxBytes QxBytes force-pushed the alew/enable-ip-forward branch from 18777da to c147e1b Compare November 2, 2023 16:28

func (nu NetworkUtils) EnableIPV4Forwarding() error {
_, err := nu.plClient.ExecuteCommand(enableIPV4ForwardCmd)
return errors.Wrap(err, "enable ipv4 forwarding failed")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should log error as well similar to ipv6 ?

@tamilmani1989 tamilmani1989 merged commit 428edb9 into master Nov 2, 2023
@tamilmani1989 tamilmani1989 deleted the alew/enable-ip-forward branch November 2, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cni Related to CNI. fix Fixes something.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants