[Also see the NWC Multiplayer Connection and Hosting Guide: https://neverwinterconnections.org/pages/mp_connection_and_hosting]
(Originally posted by Urk)
You can use one of the guides listed at Portforwarding.com if you're using a router:
This is a post found at the Bioware NWN forums:
How can I play through a Firewall?
If you are trying to play through a firewall of some sort, here is some information for you to help you get connected. Neverwinter Nights uses UDP, not TCP for its connections. If you think that your firewall is preventing you from connecting to the game servers, please make sure that the following ports are open:
* Ports 5120 through 5300
* Port 6500
* Port 27900
* Port 28900
In addition to opening the ports listed above, you may need to allow incoming connections on the port you are running your server on (5121 by default) and forward those connections to the computer running the server.
If you have multiple computers behind a firewall and you want to play multiplayer with 2 or more of them at the same time, you must ensure the Client Port setting for each computer is set to a different value. You will find this entry in the file nwnplayer.ini Simply double click on it to open it, and look for the Client Port= line in the [Profile] section. Change this from the default value of 5120 on each machine. You have to stay in a certain range, so use numbers like 5121, 5122, 5123, etc.
If your server does not appear on the GameSpy game list:
1. Verify that it is does not appear for other users. It may not be appearing for you because your game is published by your external IP address, this address may not be valid from inside your firewall.
2. Verify that the server is accessible from the Internet, have a friend Direct Connect using your external IP address (ie not 127.0.0.1 or 192.168.*.*, these are local addresses).
3. If you are starting your module from the command line of the Windows or Linux dedicated server, try starting it from within the application.
4. If your module is very large or contains very large areas, try breaking it up into smaller pieces.
If you are wanting to make sure that your NAT is set up to allow the game to play here are some details.
* Source port: 5120-5129
* Destination port: 5121-5300
* Source port: 5121-5300
* Destination port: 5120-5129
On the Game Client side, here are some changes to make things go better. Go to your nwnplayer.ini file in your Neverwinter Nights install directory, and find the following section:
Our suggestion is to change XXXX to 5120.
Hope that helps.
Also, if you are using DHCP in your Router, to give dynamic IPs to your computers in the network, then turn that off. It often has problems with port forwarding. Instead, do static IPs for your computers in the network, all in the same range as your standard gateway (the Router's internal IP address i.e. for a Siemens router it is usually the 192.168.2.1). You will need to put this as the standard gateway and you will need the IPs for the DNS servers from your ISP.
Thanks Deathchild and Gulfwulf for this info