Open claflico opened 3 years ago
Hey @claflico! Thanks for the report. I've had similar issues with Docker bridge
networks and phantom.
Your second snippet seems to imply that the client's IP isn't being forwarded past the Docker bridge, so it's being replaced with that 172.17.0.1
IP. That IP needs to actually be the same as your first snippet, which means your Docker container needs to be able to reach out to your LAN. Without this, phantom is receiving the ping but sending a response to the bridge instead of the client, which goes nowhere at all.
This is a shot in the dark but have you tried enabling IP forwarding on your host OS? https://docs.docker.com/network/bridge/#enable-forwarding-from-docker-containers-to-the-outside-world
I've experienced issues like this and adding --network=host
directly after docker run
usually fixes the problem. It makes the docker container piggyback on the network of the host. I think that's also explained in the article @jhead sent.
Correct. When I run it as host it works fine. But I want to be able to run multiple instances at once via bridge mode so the kids can connect to different servers and use manymine to handle the lan detection. Can't run multiple as host unless specifying different host IPs for each.
@claflico Have you tried with macvlan or ipvlan networks? A little extra work in that you have to setup the network, but it puts the containers on the host network subnet. I'm not familiar with the protocol used for proxy here so it may not work on that interface type... but worth a try.
@jhead I finally got a chance to test the change to the iptables config but unfortunately it still didn't work. Even after restarting docker the ping was still seen as coming from 172.17.0.1. instead of my actual client ip.
@cpuguy83 I actually used to use macvlan for my setup and had 3 additional IPs added to my docker host. After I found manymine I was able to do away with the macvlan stuff and just use the default bridge networking.
I'm actually researching/working on a larger minecraft project that I'm hoping will incorporate both manymine and phantom proxy to make it easier for people to connect and play together on private servers from different networks/households.
You can close this if you wish. I wrote a docker image that utilizes Traefik that can act as a proxy to remote Bedrock & Java servers:
https://github.com/cubeworx/cbwxproxy https://hub.docker.com/r/cubeworx/cbwxproxy
I'm experimenting with a Docker image for phantom. When I run the docker container with the network set to
host
everything works well. When I click the Friends tab on my phone, it shows the IP address of my phone as the client and I'm able to connect to the remote server. It shows my docker host's IP address as the LAN server under Friends.When I change it to use bridge networking and expose 19132 it shows the docker hosts bridge network IP when I click on the Friends tab on my phone. The server never shows up under my Friends tab.
I don't think that I can use the
-bind
option and specify my hosts IP address inside the container because it wouldn't be a valid IP address for the application to bind to.I'm hoping to be able to run multiple containers of phantom connecting to different servers via the bridge network with a random port externally exposed and then use manymine (https://github.com/illiteratealliterator/manymine) to announce those servers to the LAN.
Could an argument such as host_ip be added that if present would be used in pong replies when running inside of Docker?