Topic: Guide to running a D2 server behind a router  (Read 2915 times)

0 Members and 1 Guest are viewing this topic.

Bonk

  • Guest
Guide to running a D2 server behind a router
« on: August 04, 2003, 02:55:23 am »
Guide to running a D2 server behind a router:

1) Use a router capable of port range forwarding like the linksys.
2) Update the router to the latest firmware.
3) Disable UPnP if present.
4) Ensure the router will accept WAN requests (you should be able to ping it from the WAN side).
5) Configure your LAN statically (Disable the DHCP server on the router).
6) Disable the DMZ feature on the router.
7) Disable any firewall or virus scanner present on the router (logging is acceptable).
8) Set up port forwarding as follows:

15101-15300 TCP&UDP --> Server
27100-28900 TCP&UDP --> Server
IRC PORT* TCP&UDP --> Server

2300-3400 TCP&UDP --> Client
47624 TCP&UDP --> Client
(only this client PC will be able to play against others WAN side...)

*IRC PORT: Use the port chosen for your IRC server (usually 6667, community servers irc.sfcx.org and klingon.stasis.ca are on 6999 however, avoid the default of peerchat.gamespy.com as they have taken to banning D2 servers, I recommend running your own IRC server - see http://www.unrealircd.com/  it is another discussion again to set it up for yourself, so I recommend irc.sfcx.org to get started.)

TCP and UDP are not necessarily both required for each range, I'm just lazy and use both to be sure and so that I don't have to remember. The forwarding table above is the config I use, but you can modify it as desired to minimise the number of open ports. These are just the ports for the D2 server, IRC server and SFC2 client. More ports are required for GSA, RW etc... This info is present on other threads but I can post it as well if requested.

As all non business grade ISP accounts are dynamically assigned IP addresses now (and don't usually allow servers... shhhh!) I highly reccomend the use of a dynamic DNS service such as http://www.dydns.com or http://www.dns2go.com - I use the latter, it has been quite reliable. That way, you do not have to change settings and reboot every time your Public IP address changes. But note that this is not required!

I'll skip instructions for running on SQL unless requested (not available in OP anyway... sigh).

OK, now that you have your LAN configured, your IRC server chosen/installed and your dynamic DNS client installed and running on your server, we can move on to configuring the D2 server and starting it.

Download the latest serverkit: 2.0.3.6 for EAW and 2.5.4.12 for OP. Unzip it and copy the subfolder to the location you want to run it from.

Leave the everything in the serverkit at the default to start (to keep things simple) and only change the following: (I edit server files using notepad with wordwrap off and do not add any hard returns or additional formatting.)

In your campaign file (For EAW = \Assets\Scripts\Campaigns\MyCampaign.mct and for OP = Campaign 1.mct) edit the Name="" line and the Descrtiption="" line (Note that using "http://" will truncate the description so reference webpages without it.)

In your ServersSetup.gf file (For EAW = \Assets\ServerProfiles\MyCampaign\ServersSetup.gf and for OP = \Assets\ServerProfiles\_CentralSwitchPlusAllServers\ServersSetup.gf) add the line:
CentralSwitchAddress = "XXX.XXX.XXX.XXX" where XXX.XXX.XXX.XXX is your current public IP address.
Note that the CentralSwitchPort can only be 27100 for EAW but OP will accept 28100 as well.

In your Chat.gf file (For both EAW and OP = \Assets\ServerProfiles\Chat.gf) replace "peerchat.gamespy.com" with "irc.sfcx.org" and change the port to 6999.

Now open a command prompt and cd to the folder where Serverplatform.exe is installed.
Type "Serverplatform.exe -install" and press enter, hopefully you will not get an error.
Press any key and close the command propmt.

Now edit your CentralSwitchAddress = "XXX.XXX.XXX.XXX" line and replace your public IP address with the domain name provided by your Dynamic DNS service. (Note that the Dynamic DNS service is not required but makes everyhing so much easier, especially if your ISP changes your IP address frequently).

Now start the server by double clicking ServerPatform.exe in the windows explorer (do not start from a command prompt), press 1 and hit enter.

If all went well you should now be able to login to your server from the client on your LAN and play! (note that OP will give a gf entry error on first startup every time - I usually just close it and start it again, the error  disappears)

There are different approaches that can be taken, such as using the local IP address of the server in the CentralSwitchAddress line to limit logins to local users only, which does not require the use of a dynamic DNS service either...

This is the way I have done it. I prepared this rather late after many hours of play, hopefully it's not too confusing.

Any questions, additions or input is welcome!      
« Last Edit: December 31, 1969, 06:00:00 pm by Bonk »

Kortez

  • Guest
Re: Guide to running a D2 server behind a router
« Reply #1 on: August 04, 2003, 12:46:19 pm »
Thanks, Bonk.  I actually have all the preliminaries already set up.  I was not away I could get away with splitting some of these port ranges.  I will have to set this up to work and give it a whirl.  My IP IS static.

I appreciate you taking the time  to write this up.  Thanks a lot!
 
« Last Edit: August 04, 2003, 01:33:03 pm by KOTH-Kortez »

DavidN

  • Guest
Re: Guide to running a D2 server behind a router
« Reply #2 on: August 04, 2003, 03:56:38 pm »
Good to have Bonk, Thanks!

Bonk

  • Guest
Re: Guide to running a D2 server behind a router
« Reply #3 on: August 04, 2003, 10:53:53 pm »
I neglected to mention an important point, as I was posting in the wee hours when I should have been asleep...

You can only draft and be drafted by players on the WAN side if the directplay ports are forwarded to the client machine AND you can edit your IP address in the database. The server will see your local IP address, but if runnning on the SQL db you can edit your IP address in the servcharacter table to your public IP address, thus allowing clients on the WAN side to connect to your client machine (through the forwarded ports) for drafting.  I think local clients should still be able to draft you when set up like this as the ports are forwarded back to your machine. (router must support loopback addressing)

If you leave your local IP address in the db, clients on your LAN should still be able to draft and be drafted by you (Though I have not done this, but Goose has done so as posted earlier.) but clients on the WAN side will not be able to draft or be drafted by you, the mission will count down and drop you back to the map or crash.

It may be possible to write an app that could edit your client IP address in the flatfile quickly enough not to corrupt it, but I have never tried to edit a live flatfile, but I have observed it can be opened to write while live... Currently OP does not support SQL, so such an application would be required to play against WAN side clients using this setup.  

Bonk

  • Guest
Re: Guide to running a D2 server behind a router
« Reply #4 on: August 04, 2003, 11:37:33 pm »
OK, it gets more complicated as I have just realised...

1) The OP D2 server sees the local IP address of the router instead of the local IP address of the client machine as EAW does. So this approach will not work for OP other than allowing a single local client to login and play without drafting or being drafted by WAN side clients, unless the client IP can be edited in the flatfile as suggested above. (I'm not sure what would happen with multiple LAN side clients...)

2) Only the client machine with the directplay ports forwarded to it can login to the serverlist (others will get firewall error). One could adjust the port forwarding at the router as each local client logs in to get around this (kind of a pain) or use the proxy solution posted by Goose some time ago and recovered from the old forums here:  LAN Dynaverse -- Is it possible? (I believe this is the answer to Intruder's question: "Is there some reason to use Win2K Server and Proxy?")

Please note that I have only one client PC on my LAN and have not actually tried to connect with multiple local clients so this is pretty much the limit of my knowledge of it.

The following thread with port forwarding configurations may also be handy:  Who Here Knows How To Configure A Router For Online Gaming Through A Cable Modem???

Additionally I have collected the following port info over time (sorry it's not tidier, and some of it is redundant):

Quote:


Minimal DirectPlay Client ports:
TCP 47624
TCP 2300-2400
UDP 2300-2400


additional port info:

2300-2400 (used by DirectPlay)
47624 (used by Directx 7)
6073 (used by Directx 8)
27100 (used by SFC2)
15000-15500 (used by SFC2)
51000 (used by SFC2)


Ports for running a server:

15101
15300
28100
6667
27900


Ports for clients and hosting multiplayer:

47624
2300-2400
6500 (gamespy)


GameSpy Ports:

6667 (IRC)
80 (HTTP)
27900 (Master Server UDP Heartbeat)
28900 (Master Server List Request)
29900 (GP Connection Manager)
29901 (GP Search Manager)
13139 (Custom UDP Pings)
6500 (incoming, UDP and TCP, default roomquery port; can be customized with roomqueryport=<port #> in svc.cfg)


SFC2 Ports:

2300-2400 (TCP & UDP)
47624 (TCP & UDP)
27100 TCP & UDP only applies if you are running a server. Then it gets forwarded to your server IP.
(can be customised in ServersSetup.gf)


Roger Wilco:

3782 TCP & UDP (Channel Management)
3783 UDP (Audio)
27900 UDP (Master Server UDP Heartbeat)
28900 UDP (Master Server List Request).


starfleetcomms

Firewalls

For those of you who have a firewall of some sort, here are the ports you need to open for Starfleet Command:

Running a server


15101
15300
28100
6667
27900
Clients and hosting multiplayer


47624
2300-2400
6500
Gamespy ports


6667 (IRC)
80 (HTTP)
27900 (Master server UDP heartbeat)
28900 (Master Server List Request)
29900 (GP Connection Manager)
29901 (GP Search Manager)
13139 (Custom UDP Pings)
6500 (incoming, UDP and TCP, default roomquery port; can be customized with roomqueryport= in svc.cfg)

 


   
« Last Edit: December 31, 1969, 06:00:00 pm by Bonk »

Bonk

  • Guest
Guide to running a D2 server behind a router
« Reply #5 on: August 04, 2003, 02:55:23 am »
Guide to running a D2 server behind a router:

1) Use a router capable of port range forwarding like the linksys.
2) Update the router to the latest firmware.
3) Disable UPnP if present.
4) Ensure the router will accept WAN requests (you should be able to ping it from the WAN side).
5) Configure your LAN statically (Disable the DHCP server on the router).
6) Disable the DMZ feature on the router.
7) Disable any firewall or virus scanner present on the router (logging is acceptable).
8) Set up port forwarding as follows:

15101-15300 TCP&UDP --> Server
27100-28900 TCP&UDP --> Server
IRC PORT* TCP&UDP --> Server

2300-3400 TCP&UDP --> Client
47624 TCP&UDP --> Client
(only this client PC will be able to play against others WAN side...)

*IRC PORT: Use the port chosen for your IRC server (usually 6667, community servers irc.sfcx.org and klingon.stasis.ca are on 6999 however, avoid the default of peerchat.gamespy.com as they have taken to banning D2 servers, I recommend running your own IRC server - see http://www.unrealircd.com/  it is another discussion again to set it up for yourself, so I recommend irc.sfcx.org to get started.)

TCP and UDP are not necessarily both required for each range, I'm just lazy and use both to be sure and so that I don't have to remember. The forwarding table above is the config I use, but you can modify it as desired to minimise the number of open ports. These are just the ports for the D2 server, IRC server and SFC2 client. More ports are required for GSA, RW etc... This info is present on other threads but I can post it as well if requested.

As all non business grade ISP accounts are dynamically assigned IP addresses now (and don't usually allow servers... shhhh!) I highly reccomend the use of a dynamic DNS service such as http://www.dydns.com or http://www.dns2go.com - I use the latter, it has been quite reliable. That way, you do not have to change settings and reboot every time your Public IP address changes. But note that this is not required!

I'll skip instructions for running on SQL unless requested (not available in OP anyway... sigh).

OK, now that you have your LAN configured, your IRC server chosen/installed and your dynamic DNS client installed and running on your server, we can move on to configuring the D2 server and starting it.

Download the latest serverkit: 2.0.3.6 for EAW and 2.5.4.12 for OP. Unzip it and copy the subfolder to the location you want to run it from.

Leave the everything in the serverkit at the default to start (to keep things simple) and only change the following: (I edit server files using notepad with wordwrap off and do not add any hard returns or additional formatting.)

In your campaign file (For EAW = \Assets\Scripts\Campaigns\MyCampaign.mct and for OP = Campaign 1.mct) edit the Name="" line and the Descrtiption="" line (Note that using "http://" will truncate the description so reference webpages without it.)

In your ServersSetup.gf file (For EAW = \Assets\ServerProfiles\MyCampaign\ServersSetup.gf and for OP = \Assets\ServerProfiles\_CentralSwitchPlusAllServers\ServersSetup.gf) add the line:
CentralSwitchAddress = "XXX.XXX.XXX.XXX" where XXX.XXX.XXX.XXX is your current public IP address.
Note that the CentralSwitchPort can only be 27100 for EAW but OP will accept 28100 as well.

In your Chat.gf file (For both EAW and OP = \Assets\ServerProfiles\Chat.gf) replace "peerchat.gamespy.com" with "irc.sfcx.org" and change the port to 6999.

Now open a command prompt and cd to the folder where Serverplatform.exe is installed.
Type "Serverplatform.exe -install" and press enter, hopefully you will not get an error.
Press any key and close the command propmt.

Now edit your CentralSwitchAddress = "XXX.XXX.XXX.XXX" line and replace your public IP address with the domain name provided by your Dynamic DNS service. (Note that the Dynamic DNS service is not required but makes everyhing so much easier, especially if your ISP changes your IP address frequently).

Now start the server by double clicking ServerPatform.exe in the windows explorer (do not start from a command prompt), press 1 and hit enter.

If all went well you should now be able to login to your server from the client on your LAN and play! (note that OP will give a gf entry error on first startup every time - I usually just close it and start it again, the error  disappears)

There are different approaches that can be taken, such as using the local IP address of the server in the CentralSwitchAddress line to limit logins to local users only, which does not require the use of a dynamic DNS service either...

This is the way I have done it. I prepared this rather late after many hours of play, hopefully it's not too confusing.

Any questions, additions or input is welcome!      
« Last Edit: December 31, 1969, 06:00:00 pm by Bonk »

Kortez

  • Guest
Re: Guide to running a D2 server behind a router
« Reply #6 on: August 04, 2003, 12:46:19 pm »
Thanks, Bonk.  I actually have all the preliminaries already set up.  I was not away I could get away with splitting some of these port ranges.  I will have to set this up to work and give it a whirl.  My IP IS static.

I appreciate you taking the time  to write this up.  Thanks a lot!
 
« Last Edit: August 04, 2003, 01:33:03 pm by KOTH-Kortez »

DavidN

  • Guest
Re: Guide to running a D2 server behind a router
« Reply #7 on: August 04, 2003, 03:56:38 pm »
Good to have Bonk, Thanks!

Bonk

  • Guest
Re: Guide to running a D2 server behind a router
« Reply #8 on: August 04, 2003, 10:53:53 pm »
I neglected to mention an important point, as I was posting in the wee hours when I should have been asleep...

You can only draft and be drafted by players on the WAN side if the directplay ports are forwarded to the client machine AND you can edit your IP address in the database. The server will see your local IP address, but if runnning on the SQL db you can edit your IP address in the servcharacter table to your public IP address, thus allowing clients on the WAN side to connect to your client machine (through the forwarded ports) for drafting.  I think local clients should still be able to draft you when set up like this as the ports are forwarded back to your machine. (router must support loopback addressing)

If you leave your local IP address in the db, clients on your LAN should still be able to draft and be drafted by you (Though I have not done this, but Goose has done so as posted earlier.) but clients on the WAN side will not be able to draft or be drafted by you, the mission will count down and drop you back to the map or crash.

It may be possible to write an app that could edit your client IP address in the flatfile quickly enough not to corrupt it, but I have never tried to edit a live flatfile, but I have observed it can be opened to write while live... Currently OP does not support SQL, so such an application would be required to play against WAN side clients using this setup.  

Bonk

  • Guest
Re: Guide to running a D2 server behind a router
« Reply #9 on: August 04, 2003, 11:37:33 pm »
OK, it gets more complicated as I have just realised...

1) The OP D2 server sees the local IP address of the router instead of the local IP address of the client machine as EAW does. So this approach will not work for OP other than allowing a single local client to login and play without drafting or being drafted by WAN side clients, unless the client IP can be edited in the flatfile as suggested above. (I'm not sure what would happen with multiple LAN side clients...)

2) Only the client machine with the directplay ports forwarded to it can login to the serverlist (others will get firewall error). One could adjust the port forwarding at the router as each local client logs in to get around this (kind of a pain) or use the proxy solution posted by Goose some time ago and recovered from the old forums here:  LAN Dynaverse -- Is it possible? (I believe this is the answer to Intruder's question: "Is there some reason to use Win2K Server and Proxy?")

Please note that I have only one client PC on my LAN and have not actually tried to connect with multiple local clients so this is pretty much the limit of my knowledge of it.

The following thread with port forwarding configurations may also be handy:  Who Here Knows How To Configure A Router For Online Gaming Through A Cable Modem???

Additionally I have collected the following port info over time (sorry it's not tidier, and some of it is redundant):

Quote:


Minimal DirectPlay Client ports:
TCP 47624
TCP 2300-2400
UDP 2300-2400


additional port info:

2300-2400 (used by DirectPlay)
47624 (used by Directx 7)
6073 (used by Directx 8)
27100 (used by SFC2)
15000-15500 (used by SFC2)
51000 (used by SFC2)


Ports for running a server:

15101
15300
28100
6667
27900


Ports for clients and hosting multiplayer:

47624
2300-2400
6500 (gamespy)


GameSpy Ports:

6667 (IRC)
80 (HTTP)
27900 (Master Server UDP Heartbeat)
28900 (Master Server List Request)
29900 (GP Connection Manager)
29901 (GP Search Manager)
13139 (Custom UDP Pings)
6500 (incoming, UDP and TCP, default roomquery port; can be customized with roomqueryport=<port #> in svc.cfg)


SFC2 Ports:

2300-2400 (TCP & UDP)
47624 (TCP & UDP)
27100 TCP & UDP only applies if you are running a server. Then it gets forwarded to your server IP.
(can be customised in ServersSetup.gf)


Roger Wilco:

3782 TCP & UDP (Channel Management)
3783 UDP (Audio)
27900 UDP (Master Server UDP Heartbeat)
28900 UDP (Master Server List Request).


starfleetcomms

Firewalls

For those of you who have a firewall of some sort, here are the ports you need to open for Starfleet Command:

Running a server


15101
15300
28100
6667
27900
Clients and hosting multiplayer


47624
2300-2400
6500
Gamespy ports


6667 (IRC)
80 (HTTP)
27900 (Master server UDP heartbeat)
28900 (Master Server List Request)
29900 (GP Connection Manager)
29901 (GP Search Manager)
13139 (Custom UDP Pings)
6500 (incoming, UDP and TCP, default roomquery port; can be customized with roomqueryport= in svc.cfg)

 


   
« Last Edit: December 31, 1969, 06:00:00 pm by Bonk »