Skip to content

Commit

Permalink
proxy: opt-out from SNAT for L7 + Tunnel for some scenarios
Browse files Browse the repository at this point in the history
Currently the L7 proxy performs SNAT for traffic when tunnel routing is
enabled, even for cluster-internal traffic. This prevents cilium_host from
detecting pod-level traffic, and we thus can't apply features.

Modify SupportsOriginalSourceAddr(), so that the proxy doesn't SNAT such
traffic when some conditions are met.

Signed-off-by: Zhichuan Liang <gray.liang@isovalent.com>
  • Loading branch information
jschwinger233 authored and aanm committed Dec 14, 2023
1 parent 4838ca2 commit 9fbd5a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/datapath/iptables/iptables.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func (m *Manager) SupportsOriginalSourceAddr() bool {
// Original source address use works if xt_socket match is supported, or if ip early demux
// is disabled, but it is not needed when tunneling is used as the tunnel header carries
// the source security ID.
return (m.haveSocketMatch || m.ipEarlyDemuxDisabled) && !m.sharedCfg.TunnelingEnabled
return (m.haveSocketMatch || m.ipEarlyDemuxDisabled) && (!m.sharedCfg.TunnelingEnabled || m.sharedCfg.EnableIPSec)
}

// removeRules removes iptables rules installed by Cilium.
Expand Down

0 comments on commit 9fbd5a8

Please sign in to comment.