zzh1996 1 Oct, 2016 @ 6:21am
cannot connect to server using another IP
I have public IP address A on my linux cs:go dedicated server (computer A, port 27015).
But I want my friends to connect to my server using IP B through computer B (port 5000).

I have set up port forwarding:
sudo iptables -t nat -A PREROUTING -p udp --dport 5000 -j DNAT --to-destination A:27015
and I am sure that the port is successfully forwarded (tested by nc)

When I start the server, I can see the following log
Connection to Steam servers successful.
Public IP is A.
And then my friends can connect to my server by IP A.
But they cannot connect to my server by IP B(port 5000).

When my friends type 'connect B:5000' in csgo console, it shows 'searching... joining game' and soon failed.
In his console:
Connecting to public(B:5000) ...
Server using 'public' lobbies, requiring pw no, lobby id ffffffffffffffff

I think csgo server refuses the connections using an IP which is different from the IP it registers on the official server.
How can I solve the problem?

I have tried +net_public_adr B +ip B +login anonymous
but not working
< >
Showing 1-14 of 14 comments
Delta 24 Nov, 2016 @ 2:21pm 
So you are trying to redirect incoming connections from computer B to server A, basically trying to recreate a Proxy CS:GO server ? Or did I got you wrong, explain in more detail please
Last edited by Delta; 24 Nov, 2016 @ 2:21pm
zzh1996 26 Nov, 2016 @ 10:46pm 
Originally posted by Little Devil:
So you are trying to redirect incoming connections from computer B to server A, basically trying to recreate a Proxy CS:GO server ? Or did I got you wrong, explain in more detail please

yes, I am going to set up a proxy. I have different IPs from different ISP. My friends' ISP is the same as computer B, so they can have a lower delay. But I have to run CS:GO server on A which has another IP.

B is the reverse proxy server.
Chomiciak 13 Oct, 2017 @ 8:57am 
Did you find any answer? Please help if so, I have exact same problem :(
Stefan Siarzewski 3 Jan, 2018 @ 11:23am 
okok
Szoguniasty 4 Feb, 2018 @ 1:58am 
kk
Harryo 6 Feb, 2018 @ 3:12am 
I also have this problem, the iptables forward works perfectly fine on Garry's Mod and Minecraft servers, but not CS:GO.
I hope there will soon be a fix for this.
Svarrogh 6 Feb, 2018 @ 6:08am 
Originally posted by Harryo:
I also have this problem, the iptables forward works perfectly fine on Garry's Mod and Minecraft servers, but not CS:GO.
I hope there will soon be a fix for this.
Do you forward only UDP like the example above? I am pretty sure that 27015 port is TCP : )
Harryo 6 Feb, 2018 @ 11:19am 
I forward all traffic from one IP to another, I want to use it as a type of reverse proxy for all traffic, and I get exactly the same problem as above.
Commands:
iptables -t nat -A PREROUTING -d (FROM_IP) -j DNAT --to-destination (TO_IP)
iptables -t nat -A POSTROUTING -s (TO_IP) -j SNAT --to-source (FROM_IP)
iptables -t nat -A POSTROUTING -j MASQUERADE
阿斯顿马丁 12 Feb, 2018 @ 3:20am 
qqqq
Mr. Haticus 28 Jan, 2019 @ 7:18pm 
I know this quite the bump, but I am still having the same issue. Anyone have a fix? I have been searching for the last 12 days and can't find ANYTHING.
Last edited by Mr. Haticus; 28 Jan, 2019 @ 7:19pm
Blaquicat 29 Jan, 2019 @ 2:32am 
Originally posted by =F= Ryan:
I know this quite the bump, but I am still having the same issue. Anyone have a fix? I have been searching for the last 12 days and can't find ANYTHING.
Not sure, but i think you will need the -A FORWARD..
Truciu 22 Nov, 2019 @ 9:06am 
bhnjm,njmbhjkhjkhjhkhjkjkhkhjhjkkhjkhj
Llama Queen 26 Nov, 2019 @ 5:26am 
:3
Metal_Warrior 28 Nov, 2019 @ 8:45am 
For NAT to work you need to enable Forwarding on the adapters, which is done by

echo "1" > /proc/sys/net/ipv4/ip_forward

BEWARE: Afterwards all networks are bridged, you have to control all packet flow with iptables or nftables (do not mix both!) and set NATing rules as Harryo posted previously.

I strongly recommend not doing that if you have not idea what you are doing, as it's basically killing all network related security with the smallest change possible.
< >
Showing 1-14 of 14 comments
Per page: 1530 50