How to start docker without nat table?

2019-06-25 08:47发布

My system is

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

But the nat table is disabled in our company machine.So when I run docker -d, the issue is

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)

So, there is any way to run docker without nat table?


Update: I know I can run docker normally when I enable the nat module, but the question is enable the nat has a bad effect to our machines' network throughput. So I want to know, any way I can use docker without the nat module? Or any one can explain why docker must use the nat module.

标签: docker
1条回答
放荡不羁爱自由
2楼-- · 2019-06-25 09:13

OK, I finally found the answer. Use the follow command can start docker without iptables.

docker -d --iptables=False &
查看更多
登录 后发表回答