L2JMobius

High Five Accessing the server through public IP

asdalf · 13 · 2735

Offline asdalf

  • Vassal
  • *
    • Posts: 6
Hello, I've searched for a while but couldn't find a solution.

Here's the issue, I've managed to setup a high five server and tested the login and game servers both work fine locally, but when I use my public ip address I stop at the server selection. The ports are open I've run port scan on my public IP and they return open.

I've tried to look for logs so find a reason but couldn't find anything, here's my files:





using local subnet ip on l2.ini:


using public ip on l2.ini


Asking you guys here is my last resort, tried everything I could it might be something stupid that I can't figure out.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19656

Offline asdalf

  • Vassal
  • *
    • Posts: 6
127.0.0.1 is not a public IP.

Where should I put the public ip? loginserver and gameserver config?


Online CostyKiller

  • Distinguished King
  • *****
    • Posts: 1274
Quote
# The address on which login will listen for GameServers, use * to bind on all available IPs

Try this:
LoginHostname = *
in loginserver.ini

the external ip you set it in ipconfig.xml


Offline asdalf

  • Vassal
  • *
    • Posts: 6
Try this:
LoginHostname = *
in loginserver.ini

the external ip you set it in ipconfig.xml

it doesn't accept * only 0.0.0.0, I've noticed messing with the NAT rules it's probably something related to the port 7777 which is the gameserver port, they're open but I don't know maybe it's something in the config files.

my server.ini:





I've noticed that on my firewall I tried disabling the rules it might be something related to the 7777 which is the gameserver port


Online CostyKiller

  • Distinguished King
  • *****
    • Posts: 1274
I use it with * for years, it works just fine.
Login host is the local ip of the loginserver in case it is on a different machine, if you have login and gameserver on same machine you should leave it as local host 127.0.0.1.


Online Naker

  • Count
  • *****
    • Posts: 450
  • Coding Dreams
You can try to set the internal Ip on loging and game server.
I mean the 192.168.1.X some routers only like when you config like this


Offline asdalf

  • Vassal
  • *
    • Posts: 6
I use it with * for years, it works just fine.
Login host is the local ip of the loginserver in case it is on a different machine, if you have login and gameserver on same machine you should leave it as local host 127.0.0.1.

You can try to set the internal Ip on loging and game server.
I mean the 192.168.1.X some routers only like when you config like this

Ok, I did the changes you guys mention:

Loginserver:

Code: [Select]
# ---------------------------------------------------------------------------
# Login Server Settings
# ---------------------------------------------------------------------------
# This is the server configuration file. Here you can set up the connection information for your server.
# This was written with the assumption that you are behind a router.
# Dumbed Down Definitions...
# LAN (LOCAL area network) - typically consists of computers connected to the same router as you.
# WAN (WIDE area network) - typically consists of computers OUTSIDE of your router (ie. the internet).
# x.x.x.x - Format of an IP address. Do not include the x'es into settings. Must be real numbers.

# ---------------------------------------------------------------------------
# Networking
# ---------------------------------------------------------------------------

# Enables automatic port mapping for login server.
# If you have a router login server will request for port forwarding.
# Default: True
EnableUPnP = False

# Bind ip of the LoginServer, use 0.0.0.0 to bind on all available IPs
# WARNING: <u><b><font color="red">Please don't change default IPs here if you don't know what are you doing!</font></b></u>
# WARNING: <u><b><font color="red">External/Internal IPs are now inside "ipconfig.xml" file.</font></b></u>
# Default: 0.0.0.0
LoginserverHostname = *

# Default: 2106
LoginserverPort = 2106

# The address on which login will listen for GameServers, use * to bind on all available IPs
# WARNING: <u><b><font color="red">Please don't change default IPs here if you don't know what are you doing!</font></b></u>
# WARNING: <u><b><font color="red">External/Internal IPs are now inside "ipconfig.xml" file.</font></b></u>
# Default: 127.0.0.1
LoginHostname = 10.13.37.51

# The port on which login will listen for GameServers
# Default: 9014
LoginPort = 9014


# ---------------------------------------------------------------------------
# Thread Configuration
# ---------------------------------------------------------------------------

# Defines the number of threads in the scheduled thread pool.
# If set to -1, this will be determined by available processors divided by 2.
ScheduledThreadPoolSize = 2

# Defines the number of threads in the instant thread pool.
# If set to -1, this will be determined by available processors divided by 2.
InstantThreadPoolSize = 2


# ---------------------------------------------------------------------------
# Security
# ---------------------------------------------------------------------------

# How many times you can provide an invalid account/pass before the IP gets banned.
# Default: 5
LoginTryBeforeBan = 5

# Time you won't be able to login back again after LoginTryBeforeBan tries to login.
# Default: 900 (15 minutes)
LoginBlockAfterBan = 900

# If set to True any GameServer can register on your login's free slots
# Default: True
AcceptNewGameServer = True

# Flood Protection. All values are in milliseconds.
# Default: True
EnableFloodProtection = True

# Default: 15
FastConnectionLimit = 15

# Default: 700
NormalConnectionTime = 700

# Default: 350
FastConnectionTime = 350

# Default: 50
MaxConnectionPerIP = 50


# ---------------------------------------------------------------------------
# Misc Login Settings
# ---------------------------------------------------------------------------

# If False, the license (after the login) will not be shown.
# Default: True
ShowLicence = True

# Default: True
AutoCreateAccounts = True

# Datapack root directory.
# Defaults to current directory from which the server is started.
DatapackRoot = .


# ---------------------------------------------------------------------------
# Scheduled Login Restart
# ---------------------------------------------------------------------------

# Enable disable scheduled login restart.
# Default: False
LoginRestartSchedule = False
# Time in hours.
# Default: 24
LoginRestartTime = 24

Server.ini:

Code: [Select]
# ---------------------------------------------------------------------------
# Game Server Settings
# ---------------------------------------------------------------------------
# This is the server configuration file. Here you can set up the connection information for your server.
# This was written with the assumption that you are behind a router.
# Dumbed Down Definitions...
# LAN (LOCAL area network) - typically consists of computers connected to the same router as you.
# WAN (WIDE area network) - typically consists of computers OUTSIDE of your router (ie. the internet).
# x.x.x.x - Format of an IP address. Do not include the x'es into settings. Must be real numbers.

# ---------------------------------------------------------------------------
# Networking
# ---------------------------------------------------------------------------

# Enables automatic port mapping for game server.
# If you have a router game server will request for port forwarding.
# Default: True
EnableUPnP = False

# Where's the Login server this gameserver should connect to
# WARNING: <u><b><font color="red">Please don't change default IPs here if you don't know what are you doing!</font></b></u>
# WARNING: <u><b><font color="red">External/Internal IPs are now inside "ipconfig.xml" file.</font></b></u>
# Default: 127.0.0.1
LoginHost = 10.13.37.51

# TCP port the login server listen to for gameserver connection requests
# Default: 9014
LoginPort = 9014

# Bind address for gameserver. You should not need to change it in most cases.
# WARNING: <u><b><font color="red">Please don't change default IPs here if you don't know what are you doing!</font></b></u>
# WARNING: <u><b><font color="red">External/Internal IPs are now inside "ipconfig.xml" file.</font></b></u>
# Default: * (0.0.0.0)
GameserverHostname = *

# Default: 7777
GameserverPort = 7777

# Packet encryption.
# By default packets sent or received are encrypted using the Blowfish algorithm.
# Disabling this reduces the resources needed to process any packets transfered,
# also broadcasted packets do not need to be re-encrypted for each client sent.
# Retail: True
PacketEncryption = False


# ---------------------------------------------------------------------------
# Misc Server Settings
# ---------------------------------------------------------------------------

# This is the server ID that the Game Server will request.
# Example: 1 = Bartz
# Default: 1
RequestServerID = 1

# True = The Login Server will give an other ID to the server if the requested ID is already reserved.
# Default: True
AcceptAlternateID = True

# Datapack root directory.
# Defaults to current directory from which the server is started unless the below line is uncommented.
# WARNING: <u><b><font color="red">If the specified path is invalid, it will lead to multiple errors!</font></b></u>
# Default: .
DatapackRoot = .

# Scripts root directory.
ScriptRoot = ./data/scripts

# Define how many players are allowed to play simultaneously on your server.
# Default: 2000
MaximumOnlineUsers = 2000

# Numbers of protocol revisions that server allows to connect.
# Delimiter is ;
# WARNING: <u><b><font color="red">Changing the protocol revision may result in incompatible communication and many errors in game!</font></b></u>
# Default: 267;268;271;273
AllowedProtocolRevisions = 267;268;271;273

# Displays server type next to the server name on character selection.
# Notes:
# Accepted Values: Normal, Relax, Test, Broad, Restricted, Event, Free, World, New, Classic
# Default: Free
ServerListType = Free

# Displays server minimum age to the server name on character selection.
# Notes:
# Accepted values: 0, 15, 18
# Default: 0
ServerListAge = 0

# Setting for serverList
# Displays [] in front of server name on character selection
# Default: False
ServerListBrackets = False


# ---------------------------------------------------------------------------
# Thread Configuration
# ---------------------------------------------------------------------------

# Defines the number of threads in the scheduled thread pool.
# If set to -1, this will be determined by available processors multiplied by 4.
# You can specify a positive integer to manually set the pool size.
# Additionally, a high priority pool is created, sized at one quarter of the scheduled pool.
# Note that higher values can improve task handling under heavy load but may increase CPU and memory usage.
ScheduledThreadPoolSize = -1

# Defines the number of threads in the instant thread pool.
# If set to -1, this will be determined by available processors multiplied by 2.
# You can specify a positive integer to manually set the pool size.
# Note that higher values can improve task handling under heavy load but may increase CPU and memory usage.
InstantThreadPoolSize = -1

# Use threads to decrease startup time.
# Default: False
ThreadsForLoading = False


# ---------------------------------------------------------------------------
# Dead Lock Detector (separate thread for detecting deadlocks)
# ---------------------------------------------------------------------------
# For improved crash logs and automatic restart in deadlock case if enabled.
# Check interval is in seconds.
# Default: True
DeadLockDetector = True

# Default: 20
DeadLockCheckInterval = 20

# Default: False
RestartOnDeadlock = False


# ---------------------------------------------------------------------------
# Player HWID settings
# ---------------------------------------------------------------------------

# Check if hardware information is sent upon login.
# WARNING: To receive hardware information client needs a modified
# system for setting GameClient HWID via the setHardwareInfo method.
# Default: False
EnableHardwareInfo = False

# Players without hardware information are kicked from the game.
# Automatically set to True when MaxPlayersPerHWID > 0.
# Default: False
KickMissingHWID = False

# Maximum number of players per HWID allowed to enter game.
# Default: 0 (unlimited)
MaxPlayersPerHWID = 0


# ---------------------------------------------------------------------------
# Misc Player Settings
# ---------------------------------------------------------------------------

# Character name template.
# Examples:
# CnameTemplate = [A-Z][a-z]{3,3}[A-Za-z0-9]*
# The above setting will allow names with first capital letter, next three small letters,
# and any letter (case insensitive) or number, like OmfgWTF1
# CnameTemplate = [A-Z][a-z]*
# The above setting will allow names only of letters with first one capital, like Omfgwtf
# Default .* (allows any symbol)
CnameTemplate = .*

# This setting restricts names players can give to their pets.
# See CnameTemplate for details
PetNameTemplate = .*

# This setting restricts clan/subpledge names players can set.
# See CnameTemplate for details
ClanNameTemplate = .*

# Maximum number of characters per account.
# Default: 7 (client limit)
CharMaxNumber = 7


# ---------------------------------------------------------------------------
# Precautionary Server Restart
# ---------------------------------------------------------------------------

# Enable server restart when CPU or memory usage is too high.
# Default: False
PrecautionaryRestartEnabled = False

# Enable monitoring system CPU usage.
# Default: True
PrecautionaryRestartCpu = True

# Enable monitoring process memory usage.
# Default: False
PrecautionaryRestartMemory = False

# Check if sieges are in progress
# or players are in olympiad, events, instances
# or have targeted raidbosses.
# Default: True
PrecautionaryRestartChecks = True

# Percentage of used resources.
# Default: 95
PrecautionaryRestartPercentage = 95

# Delay in seconds between each check.
# Default: 60
PrecautionaryRestartDelay = 60


# ---------------------------------------------------------------------------
# Scheduled Server Restart
# ---------------------------------------------------------------------------

# Enable scheduled server restart.
# Default: False
ServerRestartScheduleEnabled = False

# Send a message when player enters the game.
# Default: False
ServerRestartScheduleMessage = False

# Restart time countdown (in seconds).
# Default: 600 (10 minutes)
ServerRestartScheduleCountdown = 600

# Scheduled restart schedule.
# You can put more than one value separated by commas (,).
# Example: 12:00, 00:00
ServerRestartSchedule = 08:00

# Specify days that the restart will occur. Values separated by commas (,).
# Example: 1,2,3,4,5,6,7 (SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY)
# Default: 4 (WEDNESDAY)
ServerRestartDays = 4

ipconfig.xml:
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<!-- Note: If file is named "ipconfig.xml" this data will be used as network configuration, otherwise server will configure it automatically! -->
<!-- Externalhost here (Internet IP) or Localhost IP for local test -->
<gameserver address="140.238.134.102" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./ipconfig.xsd">
<!-- Localhost here -->
<define subnet="127.0.0.0/8" address="127.0.0.1" />
<!-- Internalhosts here (LANs IPs) -->
<define subnet="10.0.0.0/8" address="10.0.0.0" />
<define subnet="172.16.0.0/12" address="172.16.0.0" />
<define subnet="192.168.0.0/16" address="192.168.0.0" />
<define subnet="192.168.56.0/24" address="192.168.56.1" />
<define subnet="10.13.37.0/24" address="10.13.37.0" />
<define subnet="10.13.37.0/24" address="10.13.37.51" />
<define subnet="10.69.69.0/24" address="10.69.69.0" />
<define subnet="10.69.69.0/24" address="10.69.69.1" />
<define subnet="10.69.69.0/24" address="10.69.69.2" />
</gameserver>

I've noticed that when I use ipconfig.xml I can only login with the server machine, other machine in the same LAN subnet doesn't work.

If I delete ipconfig.xml it starts using the default one and the machines on LAN subnet goes back to normal.


Online Naker

  • Count
  • *****
    • Posts: 450
  • Coding Dreams
What ip you use on l2.ini on the other lan pc? The internal ip of the server I guess


Offline asdalf

  • Vassal
  • *
    • Posts: 6
What ip you use on l2.ini on the other lan pc? The internal ip of the server I guess

I tried both on the second computer:

ipconfig.xml with public ip = l2.ini with public ip on ip.addr (doesn't work)

ipconfig.xml with local ip = l2.ini with local ip on ip.addr (doesn't work)

default-ipconfig.xml with automatic setup = l2.ini with local ip on ip.addr (works locally)

default-ipconfig.xml with automatic setup = l2.ini with public ip on ip.addr (doesn't work)


Online CostyKiller

  • Distinguished King
  • *****
    • Posts: 1274
I tried both on the second computer:

ipconfig.xml with public ip = l2.ini with public ip on ip.addr (doesn't work)

ipconfig.xml with local ip = l2.ini with local ip on ip.addr (doesn't work)

default-ipconfig.xml with automatic setup = l2.ini with local ip on ip.addr (works locally)

default-ipconfig.xml with automatic setup = l2.ini with public ip on ip.addr (doesn't work)

you can leave the default-ipconfig.xml with auto setup and use l2.ini with local ip for local network pc's and l2.ini with public ip for the friends pc's, some routers don't work with that scenario (connecting with public ip in l2.ini from a local network pc)


Online Naker

  • Count
  • *****
    • Posts: 450
  • Coding Dreams
From the same pc as server ip 127.0.0.1, from other PC on the same lan 192.168.1.X or whatever your internal ip is and from any PC out of local the external ip.
Tha's what is work usually. If people from out of your red can't connect is router config problem not server.
As costikiller say


Offline asdalf

  • Vassal
  • *
    • Posts: 6
you can leave the default-ipconfig.xml with auto setup and use l2.ini with local ip for local network pc's and l2.ini with public ip for the friends pc's, some routers don't work with that scenario (connecting with public ip in l2.ini from a local network pc)

What if the external IP that the default-ipconfig.xml is not the public IP I want to use it?

My scenario is that I'm using a public IP from a VPS through a wireguard tunnel to my pfsense firewall.

Public IP on VPS: The VPS has a public IPv4.
WireGuard Tunnel: A WireGuard tunnel is set up between the VPS and your firewall (pfSense). The tunnel securely carries the traffic from the VPS to your internal network.
Firewall (pfSense): This device is responsible for NAT (port forwarding) and routing traffic from the VPS to the internal GameServer and LoginServer.
Game Server: The internal Lineage 2 GameServer, listening on port 7777.
Login Server: The internal Lineage 2 LoginServer, listening on port 2106.
Client: The Lineage 2 client (your gaming machine or external client) that connects to the public IP of the VPS.


Code: [Select]
             +--------------------+
             |       Internet      |
             +--------------------+
                       |
                   VPS (Public IP) [e.g., 203.0.113.100]
                       |
           +----------------------------+
           |      WireGuard Tunnel       |
           |  (Private IP Subnet)        |
           +----------------------------+
                       |
             +------------------------+
             |    pfSense (Firewall)  |
             | (Public IP Interface)   |
             +------------------------+
                       |
       +---------------+---------------+
       |                               |
  +-----------+                  +-----------+
  | LoginServer|                  | GameServer|
  | 2106       |                  | 7777      |
  +-----------+                  +-----------+
       |                               |
Internal IP of                 Internal IP of
Login Server (LAN)             Game Server (LAN)



This is the topology I'm using, it works for the loginserver but I think because the default-ipconfig.xml uses my home public ip which is a CGNAT address I think that might be stopping the users accessing the server from the VPS Public IP going further after the server selection screen.