Hello there,
Some of you might know this already and maybe have read the original guide for it. But for those who doesn't know it yet, see below.
Note: I’m sharing the steps on how to do it using CentOS7 for the proxy server/VM while the main server/VM will be anything you like as long as rAthena supports it.
Before everything else, I would like you to know that this guide will only work on CentOS7 and this doesn’t guarantee that it will provide low latency to your players since its main function is to HIDE the IP of your MAIN VPS to avoid being bombarded with unwanted traffic. In the event, you received lots of traffic on your proxy, you can just reject it on your main VPS via firewall rules/iptables.
Requirements
Spare VPS to configure the proxy
Patch your client using updated "Enable Proxy Support" patch provided by 4144's NEMO & Functor
DO NOT patch "Skip Service Select" since you need it to choose from the multiple connections.
Add multiple connection on your clientinfo.xml/sclientinfo.xml
Configure subnet_athena.conf to prevent sending real IP in network packets from login and char servers. (Functor)
(Optional) Enable "Cancel to Select Service" Patch
VPS Configuration (IMPORTANT)
Note: Again, make sure that your VPS is using CentOS7 since this was tested under the said OS and working 100%
Follow the commands provided below.
/* Port Forwarding CentOS 7 FirewallD */
// ========================================================================
// Please read the comments per line it is self-explanatory.
// Important Parameters:
// INSERT_ZONE = output of the get default zone
// INSERT_IP = is the public IP of your main VPS or server
// If you like the guide give it a thumbs up!
// ========================================================================
// This command is to get the default zone being used by your VM.
firewall-cmd --get-default-zone
// This command is to check all rules applied to your VM by the current active zone.
firewall-cmd --zone=INSERT_ZONE --list-all
// Enabling Masquerade Status (IP Forwarding).
// This is the important configuration else below won't work
firewall-cmd --zone=INSERT_ZONE --add-masquerade --permanent
// IP/Traffic forwarding
// Make sure you have configured masquerade
firewall-cmd --zone="INSERT_ZONE" --add-forward-port=port=6900:proto=tcp:toport=6900:toaddr=INSERT_IP --permanent
firewall-cmd --zone="INSERT_ZONE" --add-forward-port=port=6121:proto=tcp:toport=6121:toaddr=INSERT_IP --permanent
firewall-cmd --zone="INSERT_ZONE" --add-forward-port=port=5121:proto=tcp:toport=5121:toaddr=INSERT_IP --permanent
// Add rules for ro-ports (assuming that you didn't change the port)
firewall-cmd --zone=INSERT_ZONE --add-port=6900/tcp --permanent
firewall-cmd --zone=INSERT_ZONE --add-port=6121/tcp --permanent
firewall-cmd --zone=INSERT_ZONE --add-port=5121/tcp --permanent
// Reload rules to take effect
firewall-cmd --reload
clientinfo.xml/sclientinfo.xml Configuration (IMPORTANT)
The example below shows how to configure multiple connections/tunnel to your VPS. (P.S. I'm not quite sure how many connection is the limit that can be defined on the xml)
<?xml version="1.0" encoding="euc-kr" ?>
<clientinfo>
<desc>Ragnarok Online Client Information</desc>
<servicetype>america</servicetype>
<servertype>primary</servertype>
<connection>
<display>^FF0000[ SE Asia ]^000000 - Connection Tunnel</display>
<balloon>This server is dedicated to SEA Region to possibly reduce latency.</balloon>
<address>INSERT_IP_HERE</address>
<port>6900</port>
<version>46</version>
<langtype>1</langtype>
<registrationweb>https://rathena.org/board</registrationweb>
<loading>
<image>loading00.jpg</image>
<image>loading01.jpg</image>
</loading>
<yellow>
<admin>2000000</admin>
</yellow>
</connection>
<connection>
<display>^FF0000[ US Central ]^000000 - Connection Tunnel</display>
<balloon>This server is dedicated to US Central Region to possibly reduce latency.</balloon>
<address>INSERT_IP_HERE</address>
<port>6900</port>
<version>46</version>
<langtype>1</langtype>
<registrationweb>https://rathena.org/board</registrationweb>
<loading>
<image>loading00.jpg</image>
<image>loading01.jpg</image>
</loading>
<yellow>
<admin>2000000</admin>
</yellow>
</connection>
<connection>
<display>^FF0000[ US West ]^000000 - Connection Tunnel</display>
<balloon>This server is dedicated to US West Region to possibly reduce latency.</balloon>
<address>INSERT_IP_HERE</address>
<port>6900</port>
<version>46</version>
<langtype>1</langtype>
<registrationweb>https://rathena.org/board</registrationweb>
<loading>
<image>loading00.jpg</image>
<image>loading01.jpg</image>
</loading>
<yellow>
<admin>2000000</admin>
</yellow>
</connection>
</clientinfo>
subnet_athena.conf (IMPORTANT)
Change the default value (shown below)
subnet: 255.0.0.0:127.0.0.1:127.0.0.1
TO
subnet: 0.0.0.0:127.0.0.1:127.0.0.1
As per Functor, "If you will just apply the patch of EXE - game client will not use these IPs from network packets. But players will be able to find real IP by using any network sniffer.".
That's it. If you have question, drop by a comment. ROK On!
Original Links: Ragnarok Proxy Setup (Hide your VPS IP)
Other: Setting up 2020 rAthena Server | Setting up 2020 Client - rAthena based