How to start docker without nat table?

My system

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 problem 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, is there a way to run docker without a nat table?


Update: I know that I can run docker normally when I turn on the nat module, but the question is that nat has a bad effect on the network bandwidth of our computers. So I want to know in some way I can use docker without the nat module? Or anyone can explain why docker should use the nat module.

+4
source share
2 answers

OK, I finally found the answer. Use the following command to start docker without iptables.

docker -d --iptables=False &
+2
source

, Linux nat. Docker 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

+1

Source: https://habr.com/ru/post/1617359/


All Articles