2

Help please.

Iptables on POSTROUTING do not recognize docker0 bridge. May be there is some other issue, but seems that the packets not go thru the rules in which docker bridge is source of the packets.

1) net.ipv4.ip_forward = 1

2) Host net. interfaces:

docker0    172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0  #docker bridge       
eno1       z.z.z.186                                    #real interface

3) Docker container net. interface:

eth0       172.17.0.2  Bcast:0.0.0.0  Mask:255.255.0.0

4) Host routing table:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  
0.0.0.0         z.z.z.185        0.0.0.0         UG    0      0        0 eno1
10.10.49.0      0.0.0.0        255.255.255.0     U     0      0        0 eno2  
z.z.z.184       0.0.0.0        255.255.255.248   U     0      0        0 eno1
172.17.0.0      0.0.0.0        255.255.0.0       U     0      0        0 docker0

5) Iptables FILTER table:

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  any    docker0  anywhere             anywhere            
 3145  264K ACCEPT     all  --  docker0 any     anywhere             anywhere        

and NAT table

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source              destination         
  0     0 MASQUERADE  all  --  *      eno1    172.17.0.0/16       !172.17.0.0/16      
  0     0 MASQUERADE  all  --  *      eno1    172.17.0.1           0.0.0.0/0           
  0     0 MASQUERADE  all  --  *      eno1    172.17.0.2           0.0.0.0/0          
  0     0 MASQUERADE  all  --  *      eno1    172.17.0.0/16        0.0.0.0/0           
  105  6769 MASQUERADE all  --  *     eno1    0.0.0.0/0            0.0.0.0/0

So docker container (172.17.0.2) can communicate with host (z.z.z.186) but not further to internet. It gets no ping response from host's default gateway(z.z.z.185).

I will be glad to any ideas.

  • Solved by setup docker server on ubuntu14.04. I assume it is the docker issue. Thanks. – bojack Aug 16 '16 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.