如何启动docker没有NAT表?

我的系统是

Linux in28-051 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux 

但是nat表在我们公司的机器上是禁用的。所以当我运行docker -d时,问题是

 root@XXXXX:~# docker -d INFO[0000] +job init_networkdriver() INFO[0000] +job serveapi(unix:///var/run/docker.sock) INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) Unable to enable network bridge NAT: iptables failed: iptables --wait -t nat -I POSTROUTING -s 172.17.42.1/16 ! -o docker0 -j MASQUERADE: iptables v1.4.21: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. (exit status 3) INFO[0000] -job init_networkdriver() = ERR (1) FATA[0000] Shutting down daemon due to errors: (exit status 3) 

那么,有没有办法运行docker没有nat表?


更新:我知道我可以正常运行docker,当我启用NAT模块,但问题是启用NAT对我们的机器的networking吞吐量有坏影响。 所以我想知道,任何方式我可以使用docker没有NAT模块? 或者任何人都可以解释为什么docker必须使用nat模块。

好的,我终于find了答案。 使用follow命令可以启动docker而不使用iptables。

 docker -d --iptables=False & 

看起来你错过了你的Linux nat模块。 Dockernetworking使用iptables将东西发送到您的容器。

你可以检查运行任何这些:

 lsmod | grep nat lsmod | grep ip grep -i iptables /boot/config-`uname -r` modprobe /lib/modules/<kernel-version>/kernel/net/ipv4/netfilter/iptable_nat.ko 

您可能需要使用iptables nat支持来重新编译内核。

类似的问题/回答: https : //serverfault.com/questions/593263/iptables-nat-does-not-exist