zzh1996 2016 年 10 月 1 日 上午 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
< >
正在显示第 1 - 14 条,共 14 条留言
Delta 2016 年 11 月 24 日 下午 2: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
最后由 Delta 编辑于; 2016 年 11 月 24 日 下午 2:21
zzh1996 2016 年 11 月 26 日 下午 10:46 
引用自 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 2017 年 10 月 13 日 上午 8:57 
Did you find any answer? Please help if so, I have exact same problem :(
Van Liden 2018 年 1 月 3 日 上午 11:23 
okok
Szoguniasty 2018 年 2 月 4 日 上午 1:58 
kk
Harryo 2018 年 2 月 6 日 上午 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 2018 年 2 月 6 日 上午 6:08 
引用自 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 2018 年 2 月 6 日 上午 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
阿斯顿马丁 2018 年 2 月 12 日 上午 3:20 
qqqq
Mr. Haticus 2019 年 1 月 28 日 下午 7: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.
最后由 Mr. Haticus 编辑于; 2019 年 1 月 28 日 下午 7:19
Blaquicat 2019 年 1 月 29 日 上午 2:32 
引用自 =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 2019 年 11 月 22 日 上午 9:06 
bhnjm,njmbhjkhjkhjhkhjkjkhkhjhjkkhjkhj
Llama Queen 2019 年 11 月 26 日 上午 5:26 
:3
Metal_Warrior 2019 年 11 月 28 日 上午 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.
< >
正在显示第 1 - 14 条,共 14 条留言
每页显示数: 1530 50