Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[GUIDE] Solving connection problems when using a router

Newbie Spellweaver
Joined
Jun 9, 2007
Messages
22
Reaction score
0
Hi,

I recently had a problem setting up my servers, where my friends could connect to it, but I couldn't. (Or I could change it so I could connect but they couldn't. Just never both of us at the same time)

I asked a question and got no reply. I managed to solve the problem, and have since been asked how I did it. So I decided to write this. I know there are guides allready written that tell you how to configure the ini's but they all say to use your External/Internet IP address, which doesn't always work. (Atleast it didnt for me)

What You Need To Know

Network IP Address

To get this, press Start > Run, type "cmd" (without the quotes) then press OK.
When the black window opens type "ipconfig" (without the quotes) and press Enter.
Look for the line that says IP Address and write down the number.

External/Internet IP Address (The one your friends use to connect)

The easiest way to get this is to go to a website like

Port Forwarding

Q: WTF is port forwarding??
A: When someone connects to your Internet IP address, they connect to your router; NOT your computer. Port forwarding is what tells your router which computer the KO server is running on. So when your friends connect, the router thinks "Ah! you need to connect to this computer!" and forwards the connections to the computer.

Q: How do I forward the ports??
A: I cant tell you. Every router is different... Google is your friend! Search for the manufacturer of your router and port forwarding. E.g. "DLink port forwarding" or "Netgear port forwarding" etc. There are hundreds of guides out there!

Ports that need forwarding

NOTE: They all need to be forwarded to your Network IP.
NOTE2: You need to make sure you select the right protocol/port type (I.e. TCP, UDP or both). If there's no option for both, enter the same port 2 times. Once with TCP and once with UDP.

TCP/UDP 15100
TCP/UDP 15001
TCP/UDP 15000
TCP/UDP 10040
TCP/UDP 10030
TCP/UDP 10020
UDP 8888

The ini Files

Replace {Network IP} and {Internet IP} with... yep, you guessed it! your network ip and internet ip!

NOTE: Im only showing you how to set the IP addresses in these files, not the database connections or anything else. If you copy and paste these, remember to change your database username and passwords. (Which I obviously removed)

P.S. Those of you who say this wont work, you need your internet IP in the files. Your wrong! Im a network technician.. Dont argue! :p Your router redirects from your internet ip address to your network ip address (if you set up port forwarding as I told you to)

NOTE: I am not at home now, the ini's below were downloaded just for this guide. So Im doing this from memory. Im pretty sure this is how I had them set (IP's only, not other settings), ill double check it when I get home, and edit anything if I made a mistake.

Aujard

Code:
[ODBC]
ACCOUNT_DSN=KN_online
ACCOUNT_UID=
ACCOUNT_PWD=
LOG_DSN=KN_online
LOG_UID=
LOG_PWD=
GAME_DSN=KN_online
GAME_UID=
GAME_PWD=
GAME_DSN2=KN_online
GAME_UID2=
GAME_PWD2=
[ZONE_INFO]
GROUP_INFO=1
ZONE_INFO=1
[SESSION]
IP1={Network IP}
IP2={Network IP}
[BILLING]
IP={Network IP}
PORT=15100
NUM=1
[PREMIUM_ITEM]
ITEM_NUM1=16000
ITEM_NUM2=16001

Ebenzer (gameserver.ini)
Code:
[TIMER]
YEAR=2008
MONTH=3
DATE=9
HOUR=18
WEATHER=2
[LOGIN SERVER]
IP=[COLOR=darkorange]{Network IP}[/COLOR]
[CASTLE]
NATION=1
[ZONE_INFO]
MY_INFO=1
SERVER_COUNT=4
SERVER_00=1
SERVER_IP_00=[COLOR=darkorange]{Network IP}[/COLOR]
SERVER_01=2
SERVER_IP_01=[COLOR=darkorange]{Network IP}[/COLOR]
SERVER_02=3
SERVER_IP_02=[COLOR=darkorange]{Network IP}[/COLOR]
SERVER_03=4
SERVER_IP_03=[COLOR=darkorange]{Network IP}[/COLOR]
SERVER_NUM=1
MAX_USER=2000
[BATTLE]
WEEK=6
START_TIME=20
END_TIME=0
AUTO=0
WEEK2=6
MWEEK=5
LIMITBATTLE=200
[AI_SERVER]
IP=[COLOR=darkorange]{Network IP}[/COLOR]
[DB_SERVER]
IP=[COLOR=darkorange]{Network IP}[/COLOR]
[ODBC]
GAME_DSN=kn_online
GAME_UID=
GAME_PWD=
GAME_DSN3=kn_online
GAME_UID3=
GAME_PWD3=
Account_DSN=kn_online
Account_UID=
Account_PWD=
[VERSION]
VER=1299
[SG_INFO]
GMY_INFO=1
GSERVER_COUNT=1
GSERVER_00=1
GSERVER_IP_00=[COLOR=darkorange]{Network IP}[/COLOR]
SERVER_INDEX=1
[NATION]
NATION_ID=1
[FREE_ZONE]
MAX_USER=1000
[EVENT]
EVENT_NUMBER=0
[MATURE_SETTING]
PK_PERMIT=0
[MONSTER_CHALLENGE]
ACTIVATE=1
LEVEL=1
[BONUS_EVENT]
MONEY=0
EXP=0

Ebenzer (server.ini)
Code:
[TIMER]
YEAR=1
MONTH=1
DATE=1
HOUR=1
WEATHER=1
[VERSION]
VER=1299
[BATTLE]
WEEK=5
START_TIME=20
END_TIME=0
AUTO=0
WEEK2=6
MWEEK=5
LIMITBATTLE=200
[CASTLE]
NATION=1
[ZONE_INFO]
MY_INFO=1
SERVER_NUM=0
SERVER_COUNT=1
SERVER_00=1
SERVER_IP_00=[COLOR=darkorange]{Network IP}[/COLOR]
MAX_USER=2000
[NATION]
NATION_ID=1
[FREE_ZONE]
MAX_USER=5000
[EVENT]
EVENT_NUMBER=0
[MATURE_SETTING]
PK_PERMIT=0
[MONSTER_CHALLENGE]
ACTIVATE=1
LEVEL=1
[BONUS_EVENT]
MONEY=0
EXP=0
[SG_INFO]
SERVER_INDEX=0
[MEMBER]
MEMBER=0
[GO]
THROUGH=0
[WXDZ]
WXDZ=0
[BATTLE2]
WEEK=5
START_TIME=20
END_TIME=0

Login Server
Code:
[DOWNLOAD]
URL=wizgate.nefficient.co.kr
PATH=pub/wizgate2/knight/upgrade
[ODBC]
DSN=kn_online
UID=
PWD=
TABLE=VERSION
[CONFIGURATION]
DEFAULT_PATH=D:\
[SERVER_LIST]
COUNT=1
SERVER_00=[COLOR=red]{Internet IP}[/COLOR]
NAME_00=Server1

Your friends will now be able to connect using your internet IP. But you wont. Yet...

How To Connect To Your Own Server

There are two ways this can be done. (NOTE: You only need to do ONE of the following. Either put the second server in the list, or edit the hosts file. Not both)

The first option is to add another server to the list in KO, which will act as a redirect for yourself. I.e. When you log in to KO you will see 2 servers in the list. One will allow your friends to connect, the second will only allow you to connect. (NOTE: This does NOT mean that you will join a different server. You will still connect to the same server as your friends and be able to see each other etc. It is simply a redirect. i.e. uses network ip instead of internet ip.) You can call the second server GMServer or PrivateServer so your players understand that they are not supposed to connect to it, and its not because the server is down. (They will just think that you have your own private server for testing)

If you dont want to have 2 servers in the list (one of which nobody else can connect to), the second option is to edit your hosts file. The hosts file is located in "C:\WINDOWS\system32\drivers\etc" and is called "hosts". You can open it with notepad, and you need to add the following line at the bottom of the file:

{NetworkIP} {InternetIP}

It should look like this:
Code:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
127.0.0.1       localhost
[COLOR=#ff8c00]{NetworkIP}[/COLOR]   [COLOR=red]{InternetIP}[/COLOR]

NOTE: If your Internet IP changes you will need to change it here every time, or you will not be able to connect. If you have a domain name or sub domain name, you can try putting that here in place of the Internet IP. (In which case you wont have to change it if you IP changes).

NOTE 2: If your network IP changes when you restart your computer, you need to reserve your IP address in your router so that it never changes. You can find guides for this on Google by searching for the manufacturer of your router and "reserve IP" or "DHCP".

WARNING: This could POSIBLY (doesnt mean that it definately will) cause other programs to stop working corectly! IF you find that it does, simply remove the line you added and NOTHING else! Then use the first method (with 2 servers in the list) instead.

IMPORTANT: I will not be held responsible for any damage to your computer or operating system when doing this. MAKE SURE you DO NOT touch anything else in the Windows and System32 folders or any folders/files within them unless you know what you are doing. Also make sure you enter the IP's correctly, as shown above!

Hope this helps :smile:
 
Back
Top