How to redirect players to new dedicated server (CS:GO) using iptables? I try this iptables rule:
Code:
#!/bin/sh
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -F
iptables -X
iptables -t nat -A PREROUTING -d 1.1.1.1 -p tcp --dport 27015 -j DNAT --to-destination 2.2.2.2:27015
iptables -t nat -A PREROUTING -d 1.1.1.1 -p udp --dport 27015 -j DNAT --to-destination 2.2.2.2:27015
iptables -t nat -A POSTROUTING -j MASQUERADE
1.1.1.1 is old IP, 2.2.2.2 is new IP.
When I add old IP (1.1.1.1) to favorities, then I see new server status (2.2.2.2). But when I try to connect to old IP, I get errors:
Code:
Connecting to public(1.1.1.1:27015) ...
Server using 'public' lobbies, requiring pw no, lobby id ffffffffffffffff
ChangeGameUIState: CSGO_GAME_UI_STATE_LOADINGSCREEN -> CSGO_GAME_UI_STATE_INGAME
**** Unable to localize '#GenericConfirmText_Label' on panel descendant of 'MMStatus'
ChangeGameUIState: CSGO_GAME_UI_STATE_INGAME -> CSGO_GAME_UI_STATE_MAINMENU
__________________