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

Support public_ip #19

Open
R1KO opened this issue Apr 14, 2023 · 8 comments
Open

Support public_ip #19

R1KO opened this issue Apr 14, 2023 · 8 comments

Comments

@R1KO
Copy link

R1KO commented Apr 14, 2023

Add argument for specify server public ip. Original srcds args: -ip, +net_public_addr

Because when i'm running server in docker container server starts on local container ip and can't receive connects.

@saguaro-yerba
Copy link

You can achieve this by creating iptables rules

@R1KO
Copy link
Author

R1KO commented Apr 14, 2023

Can you elaborate? I do not understand how iptables will help with this

@yourmnbbn
Copy link
Owner

Haven't tested in docker, I'll take a look at this when I have time.

@saguaro-yerba
Copy link

saguaro-yerba commented Apr 20, 2023

Can you elaborate? I do not understand how iptables will help with this

If the container has an internet connection and you just need to forward the udp port.
I also run this on Docker on my local network and all I need is UDP port forwarding:
docker run -p 27015:27015/udp [...]
Your server should be visible from Steam Masterserver API:
http://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=&format=json

@R1KO
Copy link
Author

R1KO commented Apr 26, 2023

Can you elaborate? I do not understand how iptables will help with this

If the container has an internet connection and you just need to forward the udp port. I also run this on Docker on my local network and all I need is UDP port forwarding: docker run -p 27015:27015/udp [...] Your server should be visible from Steam Masterserver API: http://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=&format=json

It works! But it require specify different ports for each container because add to master server with port specified in port option =(

@saguaro-yerba
Copy link

Can you elaborate? I do not understand how iptables will help with this

If the container has an internet connection and you just need to forward the udp port. I also run this on Docker on my local network and all I need is UDP port forwarding: docker run -p 27015:27015/udp [...] Your server should be visible from Steam Masterserver API: http://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=&format=json

It works! But it require specify different ports for each container because add to master server with port specified in port option =(

I'm not sure if I understand correctly, but you can try using host network --network host, then you don't need to do redirect UDP ports on containers

@R1KO
Copy link
Author

R1KO commented Apr 27, 2023

I'm not sure if I understand correctly, but you can try using host network --network host, then you don't need to do redirect UDP ports on containers

i know) I have done so now, but I'm afraid of possible problems associated with it.

Thanks for response)

@saguaro-yerba
Copy link

I'm not sure if I understand correctly, but you can try using host network --network host, then you don't need to do redirect UDP ports on containers

i know) I have done so now, but I'm afraid of possible problems associated with it.

Thanks for response)

Yeah that's true, it can cause some problems, port forwarding on Docker worked better for me 😀

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

3 participants