docker伪装不会一直工作

我们有一个mesos / marathon / docker基础架构,在FrontEnd马拉松服务器和BackEnd马拉松服务器中将应用程序划分,所有服务器都由防火墙和vlan隔开。

为了让这两台服务器通信,我们使用了marathon-lb(docker app)。 这意味着(至less对我们来说),除了马拉松磅应用程序本身 – 在“主机”模式下使用networking – 所有其他docker应用程序正在使用networking“桥”模式( docker0接口)与互联网交谈,并且dockerd autocreate所有需要的iptable规则为了与世界交谈。

现在,这一切似乎工作, 无论如何,我们的防火墙正在logging, 有时我们的docker应用程序尝试使用docker应用程序的内部IP与其他物理服务器(例如,MySQL /结构,但也前端 – >后端mesos服务器)沟通,而不是使用真实的伪装地址运行docker虚拟机的服务器。

这些都标有“FIN”。

服务器都是Debian Jessie,docker app都是用java编写的, 17.04.0~ce-0~debian-jessie -engine版本是17.04.0~ce-0~debian-jessie

当我写了“某个时候”的时候,我的意思是数据包的百分比非常可变(从0到50%),

 iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination DOCKER-ISOLATION all -- anywhere anywhere ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED DOCKER all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain DOCKER (1 references) target prot opt source destination ACCEPT tcp -- anywhere 172.17.0.2 tcp dpt:http ACCEPT tcp -- anywhere 172.17.0.3 tcp dpt:9000 ACCEPT tcp -- anywhere 172.17.0.4 tcp dpt:http-alt ACCEPT tcp -- anywhere 172.17.0.6 tcp dpt:http-alt ACCEPT tcp -- anywhere 172.17.0.7 tcp dpt:8091 ACCEPT tcp -- anywhere 172.17.0.8 tcp dpt:8089 ACCEPT tcp -- anywhere 172.17.0.9 tcp dpt:http-alt ACCEPT tcp -- anywhere 172.17.0.10 tcp dpt:http-alt ACCEPT tcp -- anywhere 172.17.0.11 tcp dpt:http-alt ACCEPT tcp -- anywhere 172.17.0.5 tcp dpt:8086 Chain DOCKER-ISOLATION (1 references) target prot opt source destination RETURN all -- anywhere anywhere 

我也试着停止创buildiptables规则(–iptables = false)dockerd并使用一般规则,如:

 iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 

带来同样的结果。