I have a docker container with IP running on a host with the docker interface docker0 and the eth0 interface

How can I send packets to the host's specific port from within the container?

From the Ip i want to send TCP traffic to port 10000 of th host with IP When the host receivs the packets on 10000 they will then be forwarded over SSH (which I have covered already) via ssh -NL 10000:ip:10000 username@host -v.

I assume it's not possible to send them directly from within the container over the SSH from the host, tha's why I'd only need a solution for transfering the packets from within the container to the host

  • That is very unclear actually. What do you mean by the host's specific port (what IP and port). What traffic do you want to direct there (coming in to which interface or from which IP)? – Julie Pelletier Feb 2 '17 at 15:56
  • I updated the question – wasp256 Feb 2 '17 at 15:59
  • It's still very unclear. Is the traffic coming from the container or from the Internet? Does the container have access to the network? Do you have administrator access on the host? – Julie Pelletier Feb 3 '17 at 3:21
  • The traffic is produced by the container and needs to be send to the host. Yes I have root on the host! No, the container does not have direct access to the network otherwise i could just send it there... I need to send it from the "docker network" to the "host network" – wasp256 Feb 3 '17 at 6:59
  • Communications have an origin and a destination. Your description does not cover what is the destination of those packets coming from the container. Is it simply to give them Internet access or something else? – Julie Pelletier Feb 3 '17 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.