Raised This Month: $ Target: $400
 0% 

Use iptables to redirect players to new IP


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
live4net
AlliedModders Donor
Join Date: Jul 2014
Old 01-27-2019 , 11:49   Use iptables to redirect players to new IP
Reply With Quote #1

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
__________________

live4net is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode