<p>In my Kubernetes cluster I couldn't connect to the internet from my Containers. So after searching, I found a possible solution, that is to turn off "IP Masquerade". But I had no luck turning this off. Whatever I did I cannot get it disabled.</p>

<p>First I change the following,</p>

<pre><code>/etc/kubernetes/cni/docker_opts_cni.env

DOCKER_OPT_BIP=""
DOCKER_OPT_IPMASQ="false"
</code></pre>

<p>Then tried </p>

<pre><code>/etc/kubernetes/cni/docker_opts_cni.env

DOCKER_OPT_BIP=""
DOCKER_OPT_IPMASQ="--ip-masq=false"
</code></pre>

<p>I'm using the latest Kubernetes version(v 1.6.3) and I have followed <a href="https://coreos.com/kubernetes/docs/latest/getting-started.html" rel="nofollow noreferrer">this</a> to configure my cluster. I'm using flannel without calico. Can someone guide me on how I can get this disabled? Thanks in advance/</p>

<p>This is an example configuration for creating new flannel network using cni for docker. </p>

<pre><code>/etc/kubernetes/cni/net.d/10-flannel.conf

{
    "cniVersion": "0.2.0",
    "name": "mybridge",
    "type": "bridge",
    "bridge": "cni_bridge1",
    "isGateway": true,
    "ipMasq": true,
    "ipam": {
        "type": "host-local",
        "subnet": "10.15.30.0/24",
        "routes": [
            { "dst": "0.0.0.0/0" },
            { "dst": "1.1.1.1/32", "gw":"10.15.30.1"}
        ],
        "rangeStart": "10.15.30.100",
        "rangeEnd": "10.15.30.200",
        "gateway": "10.15.30.99"
    }
}
</code></pre>

<p>In your configuration file changing <code>ipMasq</code> value for <code>true</code> to <code>false</code> or adding the option if not present should turn off "IP Masquerade"  </p>
