Author Topic: Networking and NAT Type  (Read 7775 times)

Offline Xessive

  • Gold Member
  • *
  • Posts: 9,918
    • XSV @ deviantART
Networking and NAT Type
« on: Thursday, December 31, 2009, 04:46:53 AM »
Hey guys,

Ever since I started playing MW2 online I've been trying to explore ways of resolving the "NAT: Strict" issue. I came upon a strange discovery. For some odd reason on my router (D-Link DIR-628) forwarding the appropriate ports causes the game to have network issues and disabling port mapping makes it work but with a strict NAT type (as opposed to open). Here's the really strange part: I noticed this is only the case with wired connections. When I switched my PC over to wireless suddenly NAT type in MW2 is open and UT3 even stopped nagging me with the "better be on DMZ to host" pop-up.

I have no idea why wired connections seem to be problematic but wireless works perfectly fine. The only thing I could deduce is that it has something to do with UPnP. Can anyone shed any light on this?

Offline scottws

  • Gold Member
  • *
  • Posts: 6,602
    • Facebook Me
Re: Networking and NAT Type
« Reply #1 on: Monday, January 04, 2010, 05:59:26 PM »
Are you using UPnP or not?  If not (suggested), then the ports need to be forwarded to the IP address of the network adapter on the PC that will be used to play the game on the Internet.

Keep in mind that your wireless adapter and wired adapter almost surely have different IP adresses.  Maybe you have the forwarding rules set up for you wireless adapter's IP address?  This would explain why it works fine wireless but not wired.

Offline Xessive

  • Gold Member
  • *
  • Posts: 9,918
    • XSV @ deviantART
Re: Networking and NAT Type
« Reply #2 on: Tuesday, January 05, 2010, 04:53:26 AM »
Are you using UPnP or not?  If not (suggested), then the ports need to be forwarded to the IP address of the network adapter on the PC that will be used to play the game on the Internet.

Keep in mind that your wireless adapter and wired adapter almost surely have different IP adresses.  Maybe you have the forwarding rules set up for you wireless adapter's IP address?  This would explain why it works fine wireless but not wired.
I tried with and without UPnP. The odd part is that when I forwarded the game's ports it stopped working online (wired and wireless). If I have UPnP switched on the router seems to figure out what it needs to do to make it work on the wireless as long as I don't forward any ports manually.

I tried assigning IP addresses by MAC Address, which works fine for manual port forwarding but it still didn't resolve the NAT type problems. I assign IPs by MAC Address for my PS3 and PSP anyway, it just makes it easier to manage my devices. So you might be right about the IP assigned to my wired connection, although it still reports "NAT: Strict" when I let the router generate random IPs for both my connections.

I'm convinced it is a setting in the router because everything goes smoothly when I'm in DMZ mode (which I usually just reserve for the PS3).

I'm gonna try resetting the router and see what happens, thanks anyway Scott.

Offline scottws

  • Gold Member
  • *
  • Posts: 6,602
    • Facebook Me
Re: Networking and NAT Type
« Reply #3 on: Tuesday, January 05, 2010, 06:25:52 AM »
I tried assigning IP addresses by MAC Address, which works fine for manual port forwarding but it still didn't resolve the NAT type problems. I assign IPs by MAC Address for my PS3 and PSP anyway, it just makes it easier to manage my devices. So you might be right about the IP assigned to my wired connection, although it still reports "NAT: Strict" when I let the router generate random IPs for both my connections.
I can't tell if I'm just confused or if you are don't fully understand NAT and port forwarding.  If I seem to insult your intelligence, I apologize.

You can assign IPs by MAC address ("static DHCP" or "DHCP reservation") or let DHCP assign the address dynamically.  That doesn't matter as long as the port you are forwarding forwards packets coming in on those ports to the correct IP address on the LAN.  Obviously in a port forwarding scenario, it makes it easier to use static DHCP so that you don't have to change all your forwarding rules if your IP address changes, though you have to do that anyway if you are switching between wired and wireless because those IP addresses will be different.  More on that later.

Generally, routers only allow you to set a port forward rule to go to one destination (IP address) on the LAN.  This makes sense because if the router would allow the same port to be forwarded to more than one destination, how would it know which destination it really wanted to go to?  Think about it this way.  You have two web servers, A and B, in a LAN behind a small office/home office (SOHO) router.  They are both configured so that their (different) websites were both listening on port 80.  You can't set your SOHO router to forward port 80 to both web servers.  It will not allow you to do that, because it has no way of knowing which website you really want to get to:  the one on server A or the one on server B.  You would have to configure one of the servers, say server B, to listen on another port, like 81.  Or you could set up the router to forward port 81 to port 80 on server B.  Either way would work and you would get to the website on server B as long as you put :81 at the end of the URL in the web browser.  That's not a great example for COD:MW2, but it helps illustrate why you can't have your SOHO router forward the same port or port range to multiple destinations, for example a wired and wireless NIC on the same computer.  The scenario regarding the web servers example and COD:MW2 on a computer with two NICs is different, but the principle is the same.  There are exceptions, such as the TCP and UDP protocols.  You can forward the same port number or port range to two different places if they are two different protocols, like TCP and UDP.

So, let us assume that your wired and wireless NICs are both pulling different IP addresses from your DHCP server.  Whether or not they are dynamically assigned does not matter.  Let's say that you have your port forwarding rules configured to point the COD:MW2 ports at the IP address your wireless NIC gets.  If you decide that you want to try out wired, you would have to change all your port forwarding rules to point to the IP address that your wired NIC gets.

If you are already doing that and it is still not working, check this out:

http://www.mapmodnews.com/article.php/Modern-Warfare-2-Router-Settings-IW

This one has several more ports listed than I've seen some other sites list.  I've put these in my router and I have NAT type Open, but I haven't tried to play online so I don't know if it works.

In regards to UPnP, I think it's a massive security risk and it is one of the first things I disable.  It basically opens ports requested by a UPnP-enabled application.  What's to stop a virus or piece of malware from being UPnP-enabled and doing the same thing?  That's right, nothing.

Offline Xessive

  • Gold Member
  • *
  • Posts: 9,918
    • XSV @ deviantART
Re: Networking and NAT Type
« Reply #4 on: Tuesday, January 05, 2010, 07:02:01 AM »
Oh haha yeah I know that ports have to be forwarded to specific IP addresses! :P No offense taken ;)

I had to readjust the settings each time I switched the connection from wired to wireless (I just changed the IP address in the port forwarding list). I did doubt myself though and did some more online reading, primarily on www.portforward.com, especially since they had my router's config up there too.

All my reading brought to me to the conclusion that either I'm missing one minute detail or something's not working as it should. Hence the OW Help Thread ;D

Thanks for the link, I'll give it a read, it might shed some light on anything game-specific.

Offline Cobra951

  • Gold Member
  • *
  • Posts: 8,934
Re: Networking and NAT Type
« Reply #5 on: Wednesday, January 06, 2010, 06:33:25 PM »
That rule of only forwarding each unique port to a unique IP escaped me the first time I tried to set up a bittorrent client on 2 different PCs on the same LAN.  To make matters worse, the router applet didn't seem to care if I set 2 different rules to forward the same port (to 2 different IPs).  Even worse, BT still works, if at a crippled pace, when ports aren't properly forwarded.  So it took me a long while to understand why things weren't going smoothly.