PDA

View Full Version : HOWTO: Play on your own server behind NAT


Doodman
09-22-2004, 06:27 AM
The reason that this does not normally work, is that most routers will not forward packets to through the external address when coming from inside the router. To get around this you can do a DNS "trick".

First, you will need a DNS name for your external IP. Either use the one your ISP gives you or go register one at dyndns.org or somesuch place.

Let's use these numbers for this example:
External IP: 1.2.3.4
External DNS name: 1-2-3-4.myisp.com
Internal IP of EQEMu server host: 192.168.1.100

In you servers LoginServer.ini, use the external DNS name for your world address:
...
worldaddress=1-2-3-4.myisp.com
...
boot5zones.bat (or whatever)

zone.exe . 1-2-3-4.myisp.com 7001 192.168.1.100


That takes care of the server, nothing out of the ordinary there. Here comes the "trick" part:

On the machine you play eq from, put a hosts file (\windows\system32\drivers\etc\hosts) entry that points your external DNS name to the internal IP address of your server.
192.168.1.100 1-2-3-4.myisp.com

Then, when the loginserver and world tell your client to connect to 1-2-3-4.myisp.com, it will look up the address (first trying the hosts file and -then- using DNS) and will find the address of 192.168.1.100 instead of 1.2.3.4.

All should be fine from then.

NOTE: This does NOT work with the 5996 loginserver. It has some code in it that uses the IP as part of the hand off to world. And because one is behind your router and one is not, the loginserver and world will see you coming from different IP addresses and world will not let you log in. The fix? Use the 5994 loginserver.

onejessman
10-06-2004, 08:53 AM
That takes care of the server, nothing out of the ordinary there. Here comes the "trick" part:

On the machine you play eq from, put a hosts file (\windows\system32\drivers\etc\hosts) entry that points your external DNS name to the internal IP address of your server.

whats a host file and how to u create it like eqhost.ini or w/e it says[/quote]

Derision
10-06-2004, 09:46 AM
whats a host file and how to u create it like eqhost.ini or w/e it says

http://www.rama.demon.co.uk/edithosts.JPG

In Doodman's example, assuming you have added no other entries, your host file would look something like this:

# 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
192.168.1.100 1-2-3-4.myisp.com

bobby15
10-09-2004, 01:59 PM
So lets say my external ip is 222.333.444.555? and lets say my isp is blabla.net? Would i put 222.333.444.555.blabla.net then 192.168.100 (internal ip) as the host.?

EDIT: And in my loginserver.ini and boot5zones would i put just 222.333.444.555.blabla.net?

Laviathon
11-06-2004, 05:49 PM
ok when i altered this file i was unable to overwrite it so i have to make a host.txt file is this what i am to do ?

or is there a way to overwrite it that way i know the altered one is getting read

thank you

lordkazan
11-13-2004, 03:06 AM
ok when i altered this file i was unable to overwrite it so i have to make a host.txt file is this what i am to do ?

or is there a way to overwrite it that way i know the altered one is getting read

thank you

you have to edit the hosts file - [windir]\system32\drivers\etc\hosts - otherwise it has no effect

if you cannot overwrite this file you're not logged in under an administrator account - and you must be because this is a administrative settings file