Docker Community Forums

Share and learn in the Docker community.

Port forwading issue


(Kps18) #1

Hi all

I recently upgraded the kernel version from 3.10 to 3.18.16 after that docker(starting ,stopping,run a container) is working fine. But port forwarding is not working.

Docker version

Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): ba1f6c3/1.6.2
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): ba1f6c3/1.6.2
OS/Arch (server): linux/amd64

uname -a
Linux 3.18.16 #1 SMP Wed Jul 15 17:49:43 IST 2015 x86_64 x86_64 x86_64 GNU/Linux

Here the iptables rule for the reference

iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 59498 packets, 29M bytes)
pkts bytes target prot opt in out source destination
44876 2600K DOCKER all – any any anywhere anywhere ADDRTYPE match dst-type LOCAL

Chain INPUT (policy ACCEPT 33496 packets, 23M bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 19841 packets, 2083K bytes)
pkts bytes target prot opt in out source destination
0 0 DOCKER all – any any anywhere !loopback/8 ADDRTYPE match dst-type LOCAL

Chain POSTROUTING (policy ACCEPT 19842 packets, 2083K bytes)
pkts bytes target prot opt in out source destination
28211 1868K MASQUERADE all – any !docker0 172.17.0.0/16 anywhere
0 0 MASQUERADE tcp – any any 172.17.0.193 172.17.0.193 tcp dpt:9110
0 0 MASQUERADE tcp – any any 172.17.0.193 172.17.0.193 tcp dpt:8110

Chain DOCKER (2 references)
pkts bytes target prot opt in out source destination
0 0 DNAT tcp – !docker0 any anywhere anywhere tcp dpt:9110 to:172.17.0.193:9110
1 60 DNAT tcp – !docker0 any anywhere anywhere tcp dpt:8110 to:172.17.0.193:8110

The above 8110 is not connecting from other machine.

Pls help


(Jeanepaul) #2

Docker version is outdated, could you try updating it first? and port forwarding is working before you upgrade the kernel?


(Kps18) #3

@jeanepaul Also i have updated the docker version to 1.8.1

docker --version
Docker version 1.8.1, build d12ea79

Issue still persist.

Main thing is docker is working with these kernel(3.18 and above), but port forwarding is not working. If we downgrade the kernel (3.10) seems to be working fine.