Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run in 'Bridge' network mode. Only runs in 'Host'. #63

Open
shoodidagen opened this issue Apr 6, 2024 · 2 comments
Open

Unable to run in 'Bridge' network mode. Only runs in 'Host'. #63

shoodidagen opened this issue Apr 6, 2024 · 2 comments

Comments

@shoodidagen
Copy link

I'm trying to run a Counter Strike Source game server, but I can only connect to the server when running --net=host.
This is a security compromise for the Host.

When I look at the LinuxGSM logs in the container, it shows the following ports are used;
image

i'm using a bridge network called 'containers' which is 172.20.0.0/16 and this works well.
image

So, I run the docker container with the following CLI;

docker run -d \
  --name cssserver \
  --net=containers \
  --ip=172.20.0.10 \
  -p 27015:27015 \
  -p 27020:27020/udp \
  -p 27005:27005/udp \
  -v cssserver_data:/data \
  --restart unless-stopped \
  -e TZ=Europe/London \
  gameservermanagers/gameserver:css

I have also tried exposing other various ports I've found in other forums showing what ports i should be forwarding for this game to work.
image

I have my Host Firewall disabled when testing here, too, as to not get in the way. And the client i'm running the Game on is within the same local network as the game server, so no port forwarding required on internet router, etc.

Please help!
Documentation says that ports may vary depending on the server, and takes me to the GitHub repository with the compose files - but all of the compose files use Host mode and therefore no port publishing.

image
image

There is also talk of future plans to auto generate ports in the examples, but i'm not sure when this is planned.
image

Appreciate any help here please - I miss Counter Strike Source and would love to get a docker container running so i can build a Gun Game server for me and my friends.

Thank you!

@Z3r01mPact
Copy link

Z3r01mPact commented Apr 16, 2024

so i had the same problem.
i wanted to run a rust server locally on my lan.
set up barebones docker server controlled via portainer
in portainer i set a macvlan to my local network range
then create a macvlan-rust as a local network

then add in two docker compose files:

DOCKER-COMPOSE.YML
services: linuxgsm: build: context: . dockerfile: dockerfiles/Dockerfile.rust container_name: rustserver restart: unless-stopped ports: - "27015:27015/tcp" - "27015:27015/udp" - "27020:27020/udp" - "27005:27005/udp" networks: - macvlan-rust networks: macvlan-rust: external: true

And also DOCKER-COMPOSE-RUST.YML

`
version: "3.8"
services:

linuxgsm-rust-bind:
image: gameservermanagers/gameserver:rust
# image: ghcr.io/gameservermanagers/gameserver:rust
container_name: rustserver
restart: unless-stopped
volumes:
- /path/to/linuxgsm/rustserver:/data
networks:
- macvlan-rust

linuxgsm-rust-volume:
image: gameservermanagers/gameserver:rust
# image: ghcr.io/gameservermanagers/gameserver:rust
container_name: rustserver
restart: unless-stopped
volumes:
- linuxgsm-rust:/data
networks:
- macvlan-rust

volumes:
linuxgsm-rust:
networks:
macvlan-rust:
external: true
`
image

this allowed the rust server to participate in the local lan.. or any lan you choose as long as you set it up in the macvlan range.
i did it this way as i have several internal network ranges and i want to assign reserved ip address via dhcp reservation via mac address.

hope this helps

@shoodidagen
Copy link
Author

Appreciate your reply.
I'm trying to access my game server externally but via my bridge network, so i can keep my host network detached from the container network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants