From 50487832c641028d87c2249ac77efdeb9907ebc3 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Mon, 11 May 2020 13:57:19 -0400 Subject: Add HairpinMode to our CNI configs This may resolve some issues with routing traffic between containers using the host's IP. Signed-off-by: Matthew Heon --- cni/87-podman-bridge.conflist | 1 + pkg/network/netconflist.go | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cni/87-podman-bridge.conflist b/cni/87-podman-bridge.conflist index 13b09a5b5..ef760a61b 100644 --- a/cni/87-podman-bridge.conflist +++ b/cni/87-podman-bridge.conflist @@ -7,6 +7,7 @@ "bridge": "cni-podman0", "isGateway": true, "ipMasq": true, + "hairpinMode": true, "ipam": { "type": "host-local", "routes": [{ "dst": "0.0.0.0/0" }], diff --git a/pkg/network/netconflist.go b/pkg/network/netconflist.go index 34ff00024..4271d3f54 100644 --- a/pkg/network/netconflist.go +++ b/pkg/network/netconflist.go @@ -21,10 +21,11 @@ func NewNcList(name, version string) NcList { // NewHostLocalBridge creates a new LocalBridge for host-local func NewHostLocalBridge(name string, isGateWay, isDefaultGW, ipMasq bool, ipamConf IPAMHostLocalConf) *HostLocalBridge { hostLocalBridge := HostLocalBridge{ - PluginType: "bridge", - BrName: name, - IPMasq: ipMasq, - IPAM: ipamConf, + PluginType: "bridge", + BrName: name, + IPMasq: ipMasq, + HairpinMode: true, + IPAM: ipamConf, } if isGateWay { hostLocalBridge.IsGW = true -- cgit v1.2.3-54-g00ecf