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

backport: Disable iptables bridge forwarding on initialization #119

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

mingshuoqiu
Copy link
Contributor

@mingshuoqiu mingshuoqiu commented Sep 19, 2024

(cherry picked from commit 6521629)
Signed-off-by: Chris Chiu chris.chiu@suse.com

Problem:
In the Harvester cluster whose management network has a VLAN ID, the VM will be unable to access the host port or node port with the host IP where the VM is running.

Solution:
Disable net.bridge.bridge-nf-call-iptables to avoid iptables rules affecting bridge forwarding on vlan.init().

We could not disable net.bridge.bridge-nf-call-iptables in the harvester-installer because RKE2 will enable it after harvester-installer.

Related Issue:
harvester/harvester#3960

Test plan:

  • Spin up a Harvester whose management network has a VLAN ID
  • Create a VM with VLAN network whose VLAN ID is same with the management network.
  • Curl nodeIP:443 in the VM.

@rrajendran17
Copy link
Contributor

@mingshuoqiu I see iptables are disabled by default in the harvester node.Am I missing something ?
renuka-v131-dev:~ # sysctl -a | grep iptable
net.bridge.bridge-nf-call-iptables = 0

@mingshuoqiu
Copy link
Contributor Author

@mingshuoqiu I see iptables are disabled by default in the harvester node.Am I missing something ? renuka-v131-dev:~ # sysctl -a | grep iptable net.bridge.bridge-nf-call-iptables = 0

It is 1 if no secondary guest network created.

(cherry picked from commit 6521629)
Signed-off-by: Chris Chiu <chris.chiu@suse.com>
@starbops
Copy link
Member

Yes, it'll be turned off once there a new ClusterNetwork and VlanConfig created.

if err := disableBridgeNF(); err != nil {

Copy link
Member

@starbops starbops left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@rrajendran17
Copy link
Contributor

Is this a specific case of mgmt network in custom vlan ? who is the caller of init() ?

@bk201 bk201 self-requested a review September 25, 2024 01:35
@mingshuoqiu
Copy link
Contributor Author

@rrajendran17 I installed Harvester 1.3.2-rc2 on a new machine w/o any config file, the net.bridge.bridge-nf-call-iptables is still. We still need this patch to disable it by default.

@rrajendran17
Copy link
Contributor

Sure then, Thanks. LGTM

@mingshuoqiu mingshuoqiu merged commit 3cb1caa into harvester:v0.4.x Sep 26, 2024
4 checks passed
@mingshuoqiu mingshuoqiu deleted the backport_pr83 branch September 26, 2024 02:01
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.

5 participants