Skip to content

Commit

Permalink
troubleshooting.md: add `ethtool -K flannel.1 tx-checksum-ip-generic …
Browse files Browse the repository at this point in the history
…off` for NAT

When the public IP is behind NAT, the UDP checksum fields of the VXLAN packets can be corrupted.
In that case, try running the following commands to avoid corrupted checksums:

```bash
/usr/sbin/ethtool -K flannel.1 tx-checksum-ip-generic off
```

To automate the command above via udev, create `/etc/udev/rules.d/90-flannel.rules` as follows:

```
SUBSYSTEM=="net", ACTION=="add|change|move", ENV{INTERFACE}=="flannel.1", RUN+="/usr/sbin/ethtool -K flannel.1 tx-checksum-ip-generic off"
```

ref:
- flannel-io/flannel issue 1279
- kubernetes/kops PR 9074
- karmab/kcli@b1a8eff

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Apr 4, 2024
1 parent de8b1f0 commit d3d58f2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions Documentation/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Other options include [Kyverno](https://kyverno.io/policies/pod-security/) and [
# Annotations

* `flannel.alpha.coreos.com/public-ip-overwrite`: Allows to overwrite the public IP of a node. Useful if the public IP can not determined from the node, e.G. because it is behind a NAT. It can be automatically set to a nodes `ExternalIP` using the [flannel-node-annotator](https://github.com/alvaroaleman/flannel-node-annotator)
See also the "NAT" section in [troubleshooting](./troubleshooting.md) if UDP checksums seem corrupted.

## Older versions of Kubernetes

Expand Down
21 changes: 21 additions & 0 deletions Documentation/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,27 @@ Vagrant typically assigns two interfaces to all VMs. The first, for which all ho

This may lead to problems with flannel. By default, flannel selects the first interface on a host. This leads to all hosts thinking they have the same public IP address. To prevent this issue, pass the `--iface=eth1` flag to flannel so that the second interface is chosen.

## NAT
When the public IP is behind NAT, the UDP checksum fields of the VXLAN packets can be corrupted.
In that case, try running the following commands to avoid corrupted checksums:

```bash
/usr/sbin/ethtool -K flannel.1 tx-checksum-ip-generic off
```

To automate the command above via udev, create `/etc/udev/rules.d/90-flannel.rules` as follows:

```
SUBSYSTEM=="net", ACTION=="add|change|move", ENV{INTERFACE}=="flannel.1", RUN+="/usr/sbin/ethtool -K flannel.1 tx-checksum-ip-generic off"
```

<!--
ref:
- https://github.com/flannel-io/flannel/issues/1279
- https://github.com/kubernetes/kops/pull/9074
- https://github.com/karmab/kcli/commit/b1a8eff658d17cf4e28162f0fa2c8b2b10e5ad00
-->

## Permissions
Depending on the backend being used, flannel may need to run with super user permissions. Examples include creating VXLAN devices or programming routes. If you see errors similar to the following, confirm that the user running flannel has the right permissions (or try running with `sudo)`.
* `Error adding route...`
Expand Down

0 comments on commit d3d58f2

Please sign in to comment.