Skip to content

Commit db0e7e0

Browse files
authored
Merge pull request #85914 from kquinn1204/OCPBUGS-45217
OCPBUGS-45217 Degraded machine config
2 parents ecee664 + 2150eae commit db0e7e0

File tree

1 file changed

+73
-7
lines changed

1 file changed

+73
-7
lines changed

modules/nw-metallb-configure-secondary-interface.adoc

Lines changed: 73 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,42 @@ From {product-title} 4.14 the default network behavior is to not allow forwardin
88
{product-title} clusters upgraded from 4.13 are not affected because a global parameter is set during upgrade to enable global IP forwarding.
99
====
1010

11-
To enable IP forwarding for the secondary interface, you have two options:
11+
To enable IP forwarding for the secondary interface, you have two options:
1212

13+
* Enable IP forwarding for a specific interface.
1314
* Enable IP forwarding for all interfaces.
14-
* Enable IP forwarding for a specific interface.
1515
+
1616
[NOTE]
1717
====
1818
Enabling IP forwarding for a specific interface provides more granular control, while enabling it for all interfaces applies a global setting.
1919
====
2020
21+
[id="nw-enabling-ip-forwarding-specific-interface_{context}"]
22+
== Enabling IP forwarding for a specific interface
2123
.Procedure
2224

23-
. Enable forwarding for a specific secondary interface, such as `bridge-net` by creating and applying a `MachineConfig` CR.
25+
. Patch the Cluster Network Operator, setting the parameter `routingViaHost` to `true`, by running the following command:
26+
+
27+
[source,terminal]
28+
----
29+
$ oc patch network.operator cluster -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig": {"routingViaHost": true} }}}}' --type=merge
30+
----
31+
32+
. Enable forwarding for a specific secondary interface, such as `bridge-net` by creating and applying a `MachineConfig` CR:
33+
34+
.. Base64-encode the string that is used to configure network kernel parameters by running the following command on your local machine:
35+
+
36+
[source,terminal]
37+
----
38+
$ echo -e "net.ipv4.conf.bridge-net.forwarding = 1\nnet.ipv6.conf.bridge-net.forwarding = 1\nnet.ipv4.conf.bridge-net.rp_filter = 0\nnet.ipv6.conf.bridge-net.rp_filter = 0" | base64 -w0
39+
----
40+
+
41+
.Example output
42+
+
43+
[source,terminal]
44+
----
45+
bmV0LmlwdjQuY29uZi5icmlkZ2UtbmV0LmZvcndhcmRpbmcgPSAxCm5ldC5pcHY2LmNvbmYuYnJpZGdlLW5ldC5mb3J3YXJkaW5nID0gMQpuZXQuaXB2NC5jb25mLmJyaWRnZS1uZXQucnBfZmlsdGVyID0gMApuZXQuaXB2Ni5jb25mLmJyaWRnZS1uZXQucnBfZmlsdGVyID0gMAo=
46+
----
2447

2548
.. Create the `MachineConfig` CR to enable IP forwarding for the specified secondary interface named `bridge-net`.
2649

@@ -32,7 +55,7 @@ apiVersion: machineconfiguration.openshift.io/v1
3255
kind: MachineConfig
3356
metadata:
3457
labels:
35-
machineconfiguration.openshift.io/role: <node_role> <1>
58+
machineconfiguration.openshift.io/role: <node_role> <1>
3659
name: 81-enable-global-forwarding
3760
spec:
3861
config:
@@ -41,15 +64,16 @@ spec:
4164
storage:
4265
files:
4366
- contents:
44-
source: data:text/plain;charset=utf-8;base64,`echo -e "net.ipv4.conf.bridge-net.forwarding = 1\nnet.ipv6.conf.bridge-net.forwarding = 1\nnet.ipv4.conf.bridge-net.rp_filter = 0\nnet.ipv6.conf.bridge-net.rp_filter = 0" | base64 -w0`
45-
verification: {}
67+
source: data:text/plain;charset=utf-8;base64,bmV0LmlwdjQuY29uZi5icmlkZ2UtbmV0LmZvcndhcmRpbmcgPSAxCm5ldC5pcHY2LmNvbmYuYnJpZGdlLW5ldC5mb3J3YXJkaW5nID0gMQpuZXQuaXB2NC5jb25mLmJyaWRnZS1uZXQucnBfZmlsdGVyID0gMApuZXQuaXB2Ni5jb25mLmJyaWRnZS1uZXQucnBfZmlsdGVyID0gMAo= <2>
68+
verification: {}
4669
filesystem: root
4770
mode: 644
4871
path: /etc/sysctl.d/enable-global-forwarding.conf
4972
osImageURL: ""
5073
----
5174
+
5275
<1> Node role where you want to enable IP forwarding, for example, `worker`
76+
<2> Populate with the generated base64 string
5377

5478
.. Apply the configuration by running the following command:
5579
+
@@ -58,8 +82,50 @@ spec:
5882
$ oc apply -f enable-ip-forward.yaml
5983
----
6084

61-
. Alternatively, you can enable IP forwarding globally by running the following command:
85+
.Verification
86+
87+
. After you apply the machine config, verify the changes by following this procedure:
88+
89+
.. Enter into a debug session on the target node by running the following command:
6290
+
91+
[source,terminal]
92+
----
93+
$ oc debug node/<node-name>
94+
----
95+
This step instantiates a debug pod called `<node-name>-debug`.
96+
97+
.. Set `/host` as the root directory within the debug shell by running the following command:
98+
+
99+
[source,terminal]
100+
----
101+
$ chroot /host
102+
----
103+
The debug pod mounts the host’s root file system in `/host` within the pod. By changing the root directory to `/host`, you can run binaries contained in the host’s executable paths.
104+
105+
.. Verify that IP forwarding is enabled by running the following command:
106+
+
107+
[source,terminal]
108+
----
109+
$ cat /etc/sysctl.d/enable-global-forwarding.conf
110+
----
111+
+
112+
.Expected output
113+
114+
[source,terminal]
115+
----
116+
net.ipv4.conf.bridge-net.forwarding = 1
117+
net.ipv6.conf.bridge-net.forwarding = 1
118+
net.ipv4.conf.bridge-net.rp_filter = 0
119+
net.ipv6.conf.bridge-net.rp_filter = 0
120+
----
121+
+
122+
The output indicates that IPv4 and IPv6 packet forwarding is enabled on the `bridge-net` interface.
123+
124+
[id="nw-enabling-ip-forwarding-globally_{context}"]
125+
== Enabling IP forwarding globally
126+
127+
* Enable IP forwarding globally by running the following command:
128+
63129
[source,terminal]
64130
----
65131
$ oc patch network.operator cluster -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"ipForwarding": "Global"}}}}}

0 commit comments

Comments
 (0)