<p>I found the solution ...</p>

<p>Check your network interfaces (<code>ifconfig -a cni0</code>).
Good config is:</p>

<blockquote>
  <p>cni0: flags=4163  mtu 1450
          inet 10.244.0.1  netmask 255.255.255.0  broadcast 0.0.0.0...</p>
</blockquote>

<p>That subnet (10.244.0.0) configured in <a href="https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml" rel="nofollow noreferrer">flannel-deploy.yaml</a></p>

<p>But, by default, a new server may have:</p>

<blockquote>
  <p>cni0: flags=4163  mtu 1450
          inet 192.168.0.1  netmask 255.255.255.0  broadcast 0.0.0.0...</p>
</blockquote>

<p>Change it to:</p>

<p><code>ifconfig eth0 10.244.0.1 netmask 255.255.255.0 broadcast 0.0.0.0</code></p>

CC BY-SA 4.0
2019-04-01T04:30:40.310Z
2019-04-01T18:09:58.327Z
2019-04-01T18:09:58.327Z
khesl
<p>I'm having troubles with network access from pods. I had installed new Kubernetes cluster with flannel-network plugin,
Checking the health of server - good.</p>

<p>I tried to check network via busybox: <code>kubectl run -it --rm --restart=Never busybox -n microservices --image=busybox sh</code>, then <code>ping 8.8.8.8</code> results in drop.</p>

<p>But <code>ping 8.8.8.8</code> succeeded when executed from <code>kubectl exec -it kube-flannel-ds-amd64-xxxx -n kube-system</code> (checking network inside flannel pod).</p>

<p>What can it be? 
I think it can be something with flannel or docker network configuration. But i did not find information about it.</p>

<p>I tried to change iptables configs, reinit cluster, create and changing docker network interfaces.</p>

<p>I have no more ideas, what can I do?</p>

<p>P.S. There is the same server installed before me and their settings and installation procedure are identical. And their connection is good.</p>

CC BY-SA 4.0
2019-03-29T08:34:14.130Z
Do you have ipv4 forwarding enabled? See: https://success.docker.com/article/ipv4-forwarding
Héctor Valverde
CC BY-SA 4.0
2019-04-01T04:32:48.967Z
Yes, without ip-forwarding kubectl init does not work
khesl
<kubernetes><networking>
External access to internet from Kubernetes Pods
khesl
# External access to internet from Kubernetes Pods

(Asked by: username_0 on 2019-03-27)

I'm having troubles with network access from pods. I had installed new Kubernetes cluster with flannel-network plugin,
Checking the health of server - good.

I tried to check network via busybox: `kubectl run -it --rm --restart=Never busybox -n microservices --image=busybox sh`, then `ping 8.8.8.8` results in drop.

But `ping 8.8.8.8` succeeded when executed from `kubectl exec -it kube-flannel-ds-amd64-xxxx -n kube-system` (checking network inside flannel pod).

What can it be?
I think it can be something with flannel or docker network configuration. But i did not find information about it.

I tried to change iptables configs, reinit cluster, create and changing docker network interfaces.

I have no more ideas, what can I do?

P.S. There is the same server installed before me and their settings and installation procedure are identical. And their connection is good.

**Tags:** kubernetes, networking

> **Comments:**
> **username_1**: Do you have ipv4 forwarding enabled? See: https://success.docker.com/article/ipv4-forwarding  
> **username_0**: Yes, without ip-forwarding kubectl init does not work  

---

## 1 answers

### Answer by username_0 on 2019-04-01. Score: 3 | Accepted answer

I found the solution ...

Check your network interfaces (`ifconfig -a cni0`).
Good config is:

> cni0: flags=4163 mtu 1450
> inet 10.244.0.1 netmask 255.255.255.0 broadcast 0.0.0.0...

That subnet (10.244.0.0) configured in [flannel-deploy.yaml](https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml)

But, by default, a new server may have:

> cni0: flags=4163 mtu 1450
> inet 192.168.0.1 netmask 255.255.255.0 broadcast 0.0.0.0...

Change it to:

`ifconfig eth0 10.244.0.1 netmask 255.255.255.0 broadcast 0.0.0.0`


---

