Urban Terror Forums: Setting up a server behind a router - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

Setting up a server behind a router Rate Topic: -----

#1 User is offline   rashly (old) Icon

  • Joined: 08-February 04
  • Posts: 352
  • Locationlong island

Posted 02 April 2004 - 10:57 PM

This is for people who want to run a server behind a router or on a LAN. I personally use this setup for 2v2 matches on OGL. My brother and I connect to the server through our router LAN (we have a 0-7ms ping) and the two people we are playing can connect over the internet. The benefits are that only the two people connecting over the internet are using your home internet bandwidth, while you are enjoying 0 ping freshness. This tutorial covers both Windows and Linux servers and clients.

1) First thing is first, set up your server on a machine connected to your LAN (most home routers have built in LAN functionality).

To set up Quake 3 on Linux, go here to install it: http://linux.omnipot...article_id=6530
To set up an Urban Terror server config file, go here: http://www.forums.ur...topic.php?t=608

Here is my Linux server start up script:

cd /usr/local/games/quake3
quake3 “+set fs_game q3ut3 +set dedicated 1 +set net_port 27961 +set com_hunkmegs 28 +set dedicates 2 +exec server.cfg”


*To start the server, put the above into a text file and do sh filename at the command line. Less processor cycles will be wasted if you start Linux in CLI instead of the X windowing system. The com_hunkmegs is the amount of ram the server will dedicate to each player connected.

On Windows, make a shortcut to quake3.exe in your Quake III Arena folder, and right click on it and change the shortcut target to:

"C:Program FilesQuake III Arenaquake3.exe" +set fs_game q3ut3 +set dedicated 1 +set net_port 27961 +set com_hunkmegs 28 +set dedicates 2 +exec server.cfg


* The com_hunkmegs is the amount of ram the server will dedicate to each player connected.

2) Now you should give your server a static IP.

To set up a static IP in Windows, go here:
http://www.linksysftp.org/tcpip.php
All Linux distributions are different so you’ll have to google for your distribution. For Redhat/Fedora, open up your main menu and go to System Settings->Network. From there, double click on your Ethernet device and select “Statically set IP addresses”. You can fill out your data in there similar to what it says in the Windows link above.

You should pick a static IP address that is in your router’s range, but one that will not already be assigned. So if you have 3 computers and your server connected to your router and your router assigns IP values from 192.168.1.100 to 192.168.1.149, don’t pick anything from 192.168.1.100 to 192.168.1.103. I personally assigned my server IP to 192.168.1.108.

3) Now you have to edit your HOSTS file so local and internet users can connect.

In Linux your hosts file should be: /etc/hosts
In Windows (XP) your hosts file should be: C:WINDOWSsystem32driversetchosts

In your server, add the following line to the end of your HOSTS file (open it with notepad or any other text editor):

127.0.0.1 authorize.quake3arena.com


Now here is the annoying part, all Internet users would be able to connect fine (after doing step 4) but connecting through your LAN you would get a “PB GUID AUTH: UNKN” error while connecting. To connect to your server over the LAN you have to add the above line to your hosts file (on the computers you are playing the game on). When you want to connect to games over the internet again, remove the line. This is a pain in the neck so I made Batch files to do this for me.

In both Windows and Linux client computers, I made a copy of my hosts file called hosts.norm and another copy called hosts.lan. The hosts.lan has the above line in it, the hosts.norm does not. These are both in the same directory as my hosts file.

In Windows client computers I made the following two Batch files (write these in notepad and save the files as before.bat and after.bat).

before.bat:
del C:WINDOWSsystem32driversetchosts
copy C:WINDOWSsystem32driversetchosts.lan C:WINDOWSsystem32driversetchosts


after.bat:
del C:WINDOWSsystem32driversetchosts
copy C:WINDOWSsystem32driversetchosts.norm C:WINDOWSsystem32driversetchosts


In Linux client computers I made two shell scripts before.sh and after.sh.

before.sh:
rm /etc/hosts
cp /etc/hosts.lan /etc/hosts


after.sh:
rm /etc/hosts
cp /etc/hosts.norm /etc/hosts


So, before I connect to my LAN server, I run the before file, and after I finish my match, I run the after file so I can connect to normal internet games again (again, this is on the client computer that you are using to play Urban Terror on).

4) Now you have to set up your router to forward all requests to your server to your server. Go into your router set up (on Linksys routers it is done by typing 192.168.1.1 into a web browser (default is no user name and password is “admin”)) and go to the port forwarding tab. Notice how we set our port number on the server to 27961 instead of the standard 27960? Well this is the port the router will forward all data to, and this way your normal gaming on 27960 will not get screwed up.

You will now set up your router to forward all TCP and UDP traffic from port 27961 to port 27961 to the IP address you set your server up on earlier (192.168.1.108). Look in your router manual if you have trouble finding the place where you do this.

5) I find it easier to make a shortcut to play on my LAN server (you can also connect to it by doing
/connect 192.168.1.108:27961
in your Urban Terror console).

In Windows (client computer), make a shortcut to quake3.exe, right click on it and go to properties, and where it says “target” type:

"C:Program FilesQuake III Arenaquake3.exe" +set fs_game q3ut3 +connect 192.168.1.108:27961


For Linux clients, make a shell script (in a text editor) and type in:

cd /usr/local/games/quake3
quake3 “+set fs_game q3ut3 +connect 192.168.1.108:27961”



////////////////////////////////

So, in conclusion, when you want to play a game on your LAN, you will have to:

1) Turn on your server and execute the shell script / shortcut we made in step 1.
2) On the client computers run your before shell script / batch file that we made in step 3.
3) Connect to your server (from the client computer) using the shell script / shortcut we made in step 5.
4) After you are done playing, run (on the client computer) your after shell script / batch file that we made in step 3.

The people who want to play on your server over the internet do not have to worry about the hosts file or anything. They just connect to your IP (to find out your IP, go to http://www.whatismyip.com) like they would a regular server with the port 27961. So if your IP is 24.192.67.156 they would type
/connect 24.192.67.156:27961
into their Urban Terror console.

You can now shut down the server if you’d like or keep it up for a public server. It may seem like a lot to set up, but once it is done, it takes very little time to run and it is very worth it to have less than a 10ms ping in a match.

#2 Guest_g00ch

Posted 10 May 2004 - 07:38 PM

OR you could just map a port from the router to you comps lan ip
and then start the server with +set net_port whatever in the command line

#3 User is offline   rashly (old) Icon

  • Joined: 08-February 04
  • Posts: 352
  • Locationlong island

Posted 12 May 2004 - 03:09 AM

yes, but that is only part of it (as explained above). you will have trouble connecting in your lan due to the quake 3 authorization.

#4 User is offline   Aarsbuds0r (old) Icon

  • Joined: 21-January 04
  • Posts: 1,334
  • LocationNetherlands, The

Posted 12 May 2004 - 12:12 PM

For real?? Just connect locally to the server shouldn't cause problems I think??

#5 User is offline   HoboHumpinSlut (old) Icon

  • Joined: 07-February 04
  • Posts: 2,308

Posted 12 May 2004 - 03:59 PM

there is...cause the q3 server will report your local ip to the auth server...and you contact it with your external ip...therefore auth will always fail

bullet_loaderAdvertisement

#6 User is offline   Aarsbuds0r (old) Icon

  • Joined: 21-January 04
  • Posts: 1,334
  • LocationNetherlands, The

Posted 12 May 2004 - 09:55 PM

Ah, so then you can only play using sv_strictauth 0. Hmmmmm.

#7 User is offline   HoboHumpinSlut (old) Icon

  • Joined: 07-February 04
  • Posts: 2,308

Posted 13 May 2004 - 12:24 AM

or you connect from the outside ;)

#8 User is offline   rashly (old) Icon

  • Joined: 08-February 04
  • Posts: 352
  • Locationlong island

Posted 13 May 2004 - 04:13 AM

you can connect internally, you hust have to manipulate your hosts file on both the server and the client. the only thing is that when this is done on the client, that client cant play on any internet servers so the setting has to be removed when not playing through the lan. thats why i wrote those little shell scripts / batch files to do it for you. just double click on them when you want it to change and blam!.

#9 User is offline   Aarsbuds0r (old) Icon

  • Joined: 21-January 04
  • Posts: 1,334
  • LocationNetherlands, The

Posted 13 May 2004 - 11:41 AM

Hmkay, thats cool =]

#10 User is offline   Alpha-Slayer (old) Icon

  • Joined: 13-May 04
  • Posts: 352

Posted 18 May 2004 - 01:32 AM

I have everything together, I forwarded a port from my Linksys router...my ip address is in the trusted zone and all the masters are in the trusted zone for my firewall. The only thing I couldn't find in WIN 98 was the Windowssystem32driveretchosts file to edit. The server starts up but when it gets to resolving the master servers addresses, it states that it cannot resolve the master servers addresses and does not proceed. Where am I failing? This is also version 2.6a.

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

Advertisement


Copyright © 1999-2024 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942