zzh1996 1. okt. 2016 kl. 6:21
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
< >
Viser 1-14 af 14 kommentarer
Delta 24. nov. 2016 kl. 14:21 
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
Sidst redigeret af Delta; 24. nov. 2016 kl. 14:21
zzh1996 26. nov. 2016 kl. 22:46 
Oprindeligt skrevet af 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. okt. 2017 kl. 8:57 
Did you find any answer? Please help if so, I have exact same problem :(
Stefan Siarzewski 3. jan. 2018 kl. 11:23 
okok
Szoguniasty 4. feb. 2018 kl. 1:58 
kk
Harryo 6. feb. 2018 kl. 3:12 
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 kl. 6:08 
Oprindeligt skrevet af 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 kl. 11:19 
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 kl. 3:20 
qqqq
Mr. Haticus 28. jan. 2019 kl. 19:18 
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.
Sidst redigeret af Mr. Haticus; 28. jan. 2019 kl. 19:19
Blaquicat 29. jan. 2019 kl. 2:32 
Oprindeligt skrevet af =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 kl. 9:06 
bhnjm,njmbhjkhjkhjhkhjkjkhkhjhjkkhjkhj
Llama Queen 26. nov. 2019 kl. 5:26 
:3
Metal_Warrior 28. nov. 2019 kl. 8:45 
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.
< >
Viser 1-14 af 14 kommentarer
Per side: 1530 50