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 <mheon@redhat.com>
This commit is contained in:
Matthew Heon 2020-05-11 13:57:19 -04:00
parent 7837bf3c07
commit 50487832c6
2 changed files with 6 additions and 4 deletions

View File

@ -7,6 +7,7 @@
"bridge": "cni-podman0",
"isGateway": true,
"ipMasq": true,
"hairpinMode": true,
"ipam": {
"type": "host-local",
"routes": [{ "dst": "0.0.0.0/0" }],

View File

@ -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