Calico supports WireGuard encryption for both IPv4 and IPv6 traffic, which can be independently enabled via parameters in the FelixConfiguration resource.
Operating System | Kernel Version |
---|---|
Linux | 5.6 and above are installed by default |
Ubuntu 20.04 | 5.4.0-135-generic |
Kylin Linux Advanced Server V10 - SP3 | 4.19.90-52.22.v2207.ky10.x86_64 |
Operating System | Kernel Version |
---|---|
openEuler | 4.18.0-147.5.2.13.h996.eulerosv2r10.x86_64 |
CentOS 7 | 3.10.0-1160.el7.x86_64 |
Redhat 8.7 | 4.18.0-425.3.1.el8.x86_64 |
Kylin Linux Advanced Server V10 - SP2 | 4.19.90-24.4.v2101.ky10.x86_64 |
Kylin Linux Advanced Server V10 - SP1 | 4.19.90-23.8.v2101.ky10.x86_64 |
Kylin Linux Advanced Server V10 | 4.19.90-11.ky10.x86_64 |
Term | Explanation |
---|---|
wireguardEnabled | Enable encryption for IPv4 traffic over the IPv4 Underlay network. |
wireguardEnabledV6 | Enable encryption for IPv6 traffic over the IPv6 Underlay network. |
When using the Calico network plugin, ensure that the natOutgoing
parameter is set to true
to support WireGuard encryption. By default, this parameter is correctly configured for the Calico subnet when creating the cluster, requiring no additional configuration.
WireGuard supports encryption for both IPv4 and IPv6 traffic; if you need to encrypt both types of traffic, configuration must be done separately. For detailed parameter configuration, refer to the Felix Configuration Documentation, configuring both wireguardEnabled
and wireguardEnabledV6
parameters.
If WireGuard is not installed by default, refer to the WireGuard Installation Guide for manual installation, although there may be cases where manual installation of the WireGuard module fails.
Traffic between containers across nodes will be encrypted, including network traffic from one host to another; however, communication between Pods on the same node and traffic between a Pod and its host node will not be encrypted.
Enable or disable IPv4 and IPv6 encryption.
Note: The following commands must be executed in the CLI tool on the Master node where the node resides.
Enable IPv4 encryption only
Enable IPv6 encryption only
Enable both IPv4 and IPv6 encryption
Disable both IPv4 and IPv6 encryption
Method 1: Execute the command in the CLI tool to disable encryption.
Method 2: Modify the felixconfiguration configuration file to disable encryption.
Execute the following command to open the felixconfiguration configuration file.
Set wireguardEnabled
and wireguardEnabledV6
parameters to false to disable WireGuard encryption.
After completing the Calico WireGuard encryption configuration, execute the following command to confirm the WireGuard encryption status. If both IPv4 and IPv6 encryption are enabled, the presence of wireguardPublicKey
or wireguardPublicKeyV6
under the Status
field indicates successful activation; if both IPv4 and IPv6 encryption are disabled, these fields will not contain wireguardPublicKey
or wireguardPublicKeyV6
, indicating successful deactivation.
Output:
This document uses IPv4 traffic verification as an example; IPv6 traffic verification is similar to IPv4 and will not be repeated here.
After configuring WireGuard encryption, check the routing information, where traffic between nodes preferentially uses the wireguard.cali interface for message forwarding.
Capture packets on the node to observe cross-node traffic.
Testing shows that IPv4 type traffic is forwarded via the wireguard.cali interface.