Problem with connection to server. Server behind a router. Read, you can help!

10/02/2011 18:54 TraDeus#1
Hi all, i have problem with my server. Mainly site structure at graph:

Code:
INTERNET ---> Router ---> Server (DMZ)(192.168.1.3)
                         |
                         |---> PC1 (192.168.1.2)
                         |
                         |---> PC2 (192.168.1.4)
                         |
                         |---> PC3 (192.168.1.5)
DMZ - All external connection redirect to internal server ip.

Log from Proxifier:
Code:
[18:37] metin2client.exe - 91.XXX.XXX.XX:11002 open    // OK!
[18:37] metin2client.exe - 91.XXX.XXX.XX:13000 open   // OK!
[18:37] metin2client.exe - 91.XXX.XXX.XX:11002 close, 98 bytes sent, 38 bytes received  // OK!
[18:37] metin2client.exe - 91.XXX.XXX.XX:13000 open  // OK!
[18:37] metin2client.exe - 91.XXX.XXX.XX:13000 close, 345 bytes sent, 73 bytes received  // OK!
[18:37] metin2client.exe - 192.168.1.2:13000 open  // ERROR!
[18:37] metin2client.exe - 91.XXX.XXX.XX:13000 close, 95 bytes sent, 395 bytes received // OK!
AT: [18:37] metin2client.exe - 192.168.1.2:13000 open // ERROR! its error because internal ip cannot be loaded from external site. I think problem is in binary client file or game core. Please help! Gretting

@Reup
10/07/2011 11:02 Mashkin#2
Quote:
Originally Posted by NiiceOne View Post
pushen verboten!

ports opened?
Sind sie:
Code:
[18:37] metin2client.exe - 91.XXX.XXX.XX:13000 open
It looks like the server returns his interface's IP address as target for the client.
However this problem didn't occure on any of my systems yet but there are reports that 2010 files only work on dedicated servers with their own public IP. What files release are you using?
For 2010 files you either need a system with a public IP or a tunneling system like Hamachi (has to be installed on the server)...

Or did you forget to set something in your client's serverinfo file?
07/24/2012 12:28 eddynator#3
Forgive me for posting on so old post, but I thought it was important, since this post helped me to find the solution to this trouble, and now I'm sharing it with you since I have got it working.

Moreover, excuse me for my bad English, and no Germany, I'm from Spain. But at least I changed my windows lenguaje to English, so will be easy to understand the screenshot.

Quote:
It looks like the server returns his interface's IP address as target for the client.
[...]
For 2010 files you either need a system with a public IP or a tunneling system like Hamachi (has to be installed on the server)...
A friend and me were making a private server, and after all the work, we were unable to understand why we couldn't made any external connection although DMZ was enabled for this server.

So after almost a month googling different words, I hit to this thread. And made me know what was happening. So the solution or workaround is so simple, you have to put your server in a subnet, and assign that subnet the same range than your public ip, and of course your public ip to that server NIC.

Example (I'm using windows server 2008 R2):
Lets think our public ip is 10.0.0.20 so what we want is the same ip in our metin2 server, so when he return the interface ip, it will be the same as the public ip.

Code:
 INTERNET ---> [COLOR="DarkOrchid"]Router[/COLOR] --->  (DMZ)  (192.168.1.3) -(NAT)-> Server (10.0.0.20)
                         |
                         |---> PC1 (192.168.1.2)
                         |
                         |---> PC2 (192.168.1.4)
                         |
                         |---> PC3 (192.168.1.5)
So yes, as you can see, you need 2 network adapters on the DMZ computer. If anyone want to test it, one of the way to try it out is using a virtual machine on a windows environment, and install the Microsoft loopback adapter.

To achieve this you must go to the device manager, right-click on your machine name, add legacy hardware, select the hardware manual from a list (advanced) and there you shall seek for network, and when you got there, just select windows, and his loopback adapter.
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

After that you'll have got one new adapter, the loopback adapter. So, what now? We have to configure this one, with the same range ip than your external IP. Let’s do that.

[Only registered and activated users can see links. Click Here To Register...]

Yes, it’s that simple, you can add your ISP DNS, and if you are on a DNS Server, will add automatically 127.0.0.1. But really, you don't need to put anything more.

So far, what we have got here is a second network in our DMZ, but there are still work left.

Now what we need to do is to Bridge, our virtual machine network interface, to that newly created.

If you are using virtual box, you can do that with right-click on your machine, then settings, and, under the network setting you chose bridged adapter and the Microsoft loopback adapter.

[Only registered and activated users can see links. Click Here To Register...]

Íf you are using Vmware Workstation, you must go to Edit --> Virtual network editor. And there you shall change one of the vmnet to bridged, and choose the loopback adapter, in this example I choose, Vmnet6.

[Only registered and activated users can see links. Click Here To Register...]

Afterwards, you have to configure you virtual machine to use that Vmnet6 connection. If you right-click his network icon, you can select settings, and there you must use "custom: specific virtual network" and use our Vmnet6.

[Only registered and activated users can see links. Click Here To Register...]

If we have followed all the way here, now we have got our virtual machine in a "subnet", so we have got to configure his IP correctly. NOW is when we are going to assign the same public IP. So, if we want to do that, we just need to type "sysinstall" in our FreeBSD, and configure the network adapter something like that -->

[Only registered and activated users can see links. Click Here To Register...]

When using the host and the domain, i don't think that is really very important. but the fact is that I use myself there. What is really important is the "name server", you have to use there some real DNS, at last, youll need that if you want to install from internet things on your FreeBSD, else your will be unable to resolve internet names. I simply use my ISP DNS.

Now we reboot our freebsd.

And now the last steep. What we need to do is simply redirect the incoming traffic from our DMZ from the example, to that other IP. There are some programs if you want to do it. You can use portmaps, you can use Routing and Remote Access (RRAS), or some other software. They all are almost the same, but in my example, since we are working with windows server 2008, I'm using Routing and Remote Access (RRAS). (tested it with portmaps and it does work!)

If you want to install RRAS here is the guide (it’s one of the windows server 2008 features) --> [Only registered and activated users can see links. Click Here To Register...]

After installing that one, you simply right-click on your RRAS server and select configure[...] you do next, and select NAT.

[Only registered and activated users can see links. Click Here To Register...]

Then you must choose what is the network connected directly to the router (the one that give you internet, normally your local area connection)

[Only registered and activated users can see links. Click Here To Register...]

Then you select the virtual loopback that we created before.
[NOTE] if there are no more networks left than the loopback, it could be that RRAS will select automatically your loopback network.

[Only registered and activated users can see links. Click Here To Register...]

After that, you already have got almost ready your tunneling from internet to your metin2 server with the same router IP. What we need to do now is just to redirect those desired ports that you are using in metin2. As you know those ports are into the config files of each channel folder, and auth folder.

We have to go to IPv4 --> NAT --> right-click local area connection --> proprieties, and just add each one of the ports. And of course you chose your "router" IP, since is the one of that metin2 server, from that virtual network.
Code:
 I have changed the name of the loopback adapter, from local network 2, to Virtual Area connection, so it’s more visual for me.
[Only registered and activated users can see links. Click Here To Register...]

once you put all the ports needed there the server will be ready to run, and players from outside your LAN will be able to join. But you could have troubles to join from your LAN, since without making some more networking work, you will not see that metin2 machine from the other LAN computers.

Code:
 As a final note, if you want to make sure, all the traffic to the 10.0.0.20 (our metin2 new ip) is redirected through the loopback network, and not to the router, you can do the next line in CMD:
route add 10.0.0.20 MASK 255.255.255.0 10.0.0.1 METRIC 1 -p

Doing that you are telling your system, that when you are going to the 10.0.0.20 IP you will do it from the 10.0.0.1 interface. and the metric 1 is to tell the system, that have got the most possible priority.
As last thing, remember to change those example IP with your real public ip.

Thanks for your time, Thanks M@shkin, thanks to you, and my partner ArcZero, I could get with this solution.
ArcZero asked me, so you can assign any ip to the server, right? so, can you just assign the router ip? nah forget this, sound foolish...

That just did me to think. Yes you can do it! And yes, it is working now.

Of course, thanks to TraDeus, your question was my answer.

And obviously, to many thanks to elitepvpers for your knowledge and simply this forum.