Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start docker without nat table?

Tags:

docker

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.

like image 474
yunfan Avatar asked Sep 26 '22 03:09

yunfan


1 Answers

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

docker -d --iptables=False &
like image 97
yunfan Avatar answered Sep 30 '22 07:09

yunfan