yourmnbbn / tiny-csgo-server

Tiny csgo server for logging on to steam game servers, basically it's a fake server, not for real server purpose.
GNU General Public License v3.0
34 stars 4 forks source link

Support public_ip #19

Open R1KO opened 1 year ago

R1KO commented 1 year ago

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 commented 1 year ago

You can achieve this by creating iptables rules

R1KO commented 1 year ago

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

yourmnbbn commented 1 year ago

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

saguaro-yerba commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 😀