So... read on if you like - there's info there on what the error message actually means, and why it's totally stupid - but the solution below is now even dafter than before ;)
(end of update)
Well, last night I finally got sick of that stupid UT3 error message telling me that my NAT was incompatible with hosting games, and that I should check my router's manual about setting up 'port forwarding' and 'DMZ'. Oddly enough, you see, I actually know all about that. You'll also note that at no point does it bother to mention which ports need forwarding, making this particular error doubly crap: it's misleading as well as eroneous.
Anyway, all this malarky started when Patch 1 beta 1 was installed, and one of the things that patch did was to add STUN support for hosting games behind NAT. None of the later betas or the final patch have improved matters in this respect, BTW.
Now, you may well be wondering what STUN is and why it's useful in this context. I know that I was. And, quite frankly, I still am. STUN (more info here) basically just lets an application find out the machine's public IP address (i.e. the address that the NAT results in) and what sort of port-forwarding is in operation. OK - so far, so good.
Where it all goes a bit wrong is that if, like me, you're behind a 'restricted' NAT (and you probably are, if you have any useful sort of NAT at all - especially the type that acts as a very primitive 'firewall') then UT3 throws its chubby little hands up in despair and gives that error message. Even that isn't the real problem, annoying as it is. No, the real problem is that UT3 then will not let you untick the 'LAN' option when creating a game.
STUN might be useful for some things... but in this context, it really doesn't help.
So, like I said way back at the beginning of this entry, I'd had enough. If UT3 wanted to use STUN to annoy me, then I figured that I'd also use STUN to shoot that stupid error down.
I'm on a LAN here, which is why I have NAT in the first place. And on that LAN I have a linux box, ee-i-ee-i-oh. Well, actually I have quite a few linux boxes, but just one will suffice. You can certainly do what I'm about to describe using windows, and even on the same PC as you're running UT3 but, since I haven't tried that yet, I'll stick to describing what I have done.
I've set up a STUN server on the LAN, is what I've done. It's not visible to the outside world, which makes it utterly pointless as a STUN server since the only applications that can query it are also running on machines on the LAN, and thus the result will always be "open internet" (unless some firewall rules on the box(es) interfere, of course). Just for added value, the STUN server isn't even configured quite properly either.
I'm sure you can see where this is going ;)
So now my UT3 is configured to query the local STUN server, which leads it to believe that it has a direct connection to the internet with no NAT. UT3 then quite happily hosts games because, coming back to the original point, I have read my router's manual and set up 'port forwarding' properly (screw using a DMZ - that's way beyond what's actually required).
BTW, hosting games matters to me because the only way to really enjoy the single player campaign is to play it multiplayer. Yeah, I know. But then using a STUN server on the LAN makes no sense either. I'm getting almost used to that with UT3 now.
OK, so here's the juicy details, step by step, of what I did:
- Download the STUN server/client from here
Obviously, I downloaded the source and compiled it. If you're using windows, you'll probably want the precompiled windows binaries.
- The STUN server wants to use two IP addresses on the box it's running on. Luckily, by stretching the point a little, you already have two with no need to muck about: your ethernet interface & the loopback interface. In my case, those IP addresses are 192.168.3.86 and 127.0.0.1, so I run the server like this:
./server -h 192.168.3.86 -a 127.0.0.1 -v
(that -v is just for verbose output so that I can see what's going on).
NB you do NOT need to be root to do this.
- Check that the server is 'working':
That should return "Open".
- Next up is editing UT3's configuration to tell it to use the local server instead of stunserver.org (the default). This is set in UTEngine.ini, which you'll find in My Documents\My Games\Unreal Tournament 3\UTGame\Config (phew). Searching that file for "stunserver.org" is probably the easiest way to find it. Replace stunserver.org with the hostname (or IP address, I guess - I haven't checked that) of the machine your STUN server is now running on.
- Now you need to actually forward the relevant ports from the outside world to the machine that you're playing UT3 on. All the ports are UDP and their numbers are:
7777, 7778, 7787, 6500, 13000, 27900
Disclaimer: I'm not 100% certain that all of those ports are required. Some of them probably aren't. I arrived at that list thanks to enough trial and not enough error, i.e. it works with those ports forwarded, but I haven't tried closing them to see what makes it break ;)
- Enjoy public, non-LAN games! I know that I do :)