Forwarding traffic from Docker container on my NAS

Hi guys!

I have a problem I can't solve by myself it seems :(

I have a router (192.168.1.1), connected to my NAS(Synology DS1515+ with local IP 192.168.1.8), which is running Docker(which seems to be using the IP 172.17.0.0:16) with an image for airdcpp-webclient (https://hub.docker.com/r/gangefors/airdcpp-webclient/). Running "more /etc/hosts" in the container I named AirDC reveals that the container is using 172.168.0.2.

I can connect to my webclient(container port 5600, and local port 32700) by opening http://192.168.1.8:32700 in my browser. So far no problem. I can also connect to different hubs, and chat with friends. So far it seems to be working well. The problem starts when I try to go over to "Active" mode, in other words, making a direct connection to someone.

I have my router set up to port forward the 3 different ports I'm using, and I have tried with several IPs I thought could work.

My router has the following portforwarding configured(I know it's a mess, I tried so many different IPs):

My docker and NAS is running with these settings(I'm guessing there is something I need to configure in the static route section, but I don't know what): http://imgur.com/FsslR9S

And Lastly, my web client I want to configure is running with these settings currently: http://imgur.com/EBoFdux
and http://imgur.com/QSxL7cw

If anyone can help me I would be very grateful :)

I'd like to add that I can run the AirDC Web client with portforwarding successfully on my local computer, but got stuck when trying to do the same thing on my NAS through the power of Docker :)

Where is the state change of "active" mode? Does it originate in the router, in docker, the nas or airdc?

According to the docs on Docker hub you should be using ports 21248 and 21249 which from what I can see you haven't exposed from the docker container.

That state is set in airdc, here http://imgur.com/EBoFdux

Thanks, did not see that part. I changed accordingly in my router as well as airdc, but still no luck. See image bellow.

I have a feeling that I have to somehow translate the 172.17.0.X addresses to my local 192.168.1.X ones, but I might be wrong.

Imgur

I tried to clarify by doing this map of the network as I perceive it. http://imgur.com/vLpDDsf

Can you check that the ports are available from the internet? http://www.yougetsignal.com/tools/open-ports/

He said that he also tested it without docker which worked.

Have your tried pinging between those address from outside and inside the container?

Interesting page! No, according to that page my 2 ports I'm trying to use 21248 and 21249 are closed.

Good idea.

I tried to ping from my local computer at 192.168.1.2. These are the results:
192.168.1.8 (the NAS): works
172.0.0.2 (The AirDC container in Docker): Does not work

Pinging done from NAS:
192.168.1.2 (my local computer): works
172.0.0.2(The AirDC container in Docker): works.

Ok, the reason that you cannot ping AirDC from a client system is because it's on a different network, the container translates this docker to your set current network so it can speak outside.

The ports that deevus mentioned needs to be open since that's the product your using, or is the one your using a fork?

Now from what I can understand it (AirDC) it uses less resources when using active mode correct? Is this really a problem?

Thanks for your reply.

As can be seen in this picture https://imgur.com/mIuGNkB
My ports are open. I think, but it does not seem to register it that, why, I do not know :(
Perhaps I'm wrong in assuming it's 192.168.1.8 that I should open ?

The reason I need the "active mode" is that I cannot make a direct connection to someone who is in "passive mode", as long as I am in "passive mode" as well.

Ok, I'm not sure how AirDC works but what I can gather is that it needs 4 specific ports to be open to the WAN (ISP->Cloud aka server) which are 5600, 5601, 21248 TCP/UDP and 21249 TCP.

Have you tried listing the source IP as your gateway or WAN address?

Are your docker ports configured to pass through? Router is passing to the host but host need to pass those ports on to the container to deal with, the 172.0.0.x is a red herring that is the IP the host talks to container on the router won't see it. You need a docker start -p 21248 specified then get the router to point to 192.168.1.8:21248. Sorry can't offer clearer help am on mobile. Hope that points you in the right direction.

rodders
I think you are correct in that I need them to pass through, but I'm not entirely sure how to do that. I suppose it has to be in the NAS settings? or is that a container setting ?

Link to show both of these settings below:
Imgur

By source IP I assume you mean the IP for the container in question? 172.17.0.2 (AirDC)? I do not think that would work since AirDC is already using that IP.
If you mean 172.17.0.1 or 172.17.0.0. I just tried them both as "External / WAN IP", but still not working.

I think rodders is correct in that I have to pass through the 172.17* addresses to the 192.168* addresses. Not sure how tho :D

Hi yes your looking for a container command like docker run -p 21248:21248 (local host port: container port) only know about setting it up using the run command it may be possible another way.

Think of it router port forward from internet to box then the box needs to put forward into the container. Good luck! FYI the docker documentation is pretty good.

Hey! I just solved it.

You were correct rodders about the ports being same for host and container. That change did it!
Imgur

Thanks everyone for your help!

Great news glad I could help a little.