forked from antrea-io/antrea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WireGuard] Fix service traffic requiring SNAT (antrea-io#2697)
The service traffic requiring SNAT couldn't be transferred to peer Node when the endpoint Pod is on another Node. This was because we didn't set any address on WireGuard device antrea-wg0. Therefore, when iptables MASQUERADE action took effect, it chose one IP from other interfaces, which might not be the gateway address on antrea-gw0. This caused two problems: 1. Peer wireguard didn't accept the packet as its source address was not in its "allowed ips" 2. Peer Node wouldn't route the response back via the encrypted tunnel as the destination IP was not in its "allowed ips" This patch fixes it by assigning the gateway IPs on the WireGuard device. But it uses "/32" mask for IPv4 address and "/128" mask for IPv6 address to avoid impacting routes on Antrea gateway. Signed-off-by: Quan Tian <qtian@vmware.com>
- Loading branch information
Showing
4 changed files
with
61 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//go:build windows | ||
// +build windows | ||
|
||
// Copyright 2021 Antrea Authors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters