Tuesday, June 8, 2010

Uterine Prolapse Cartoon

Connect to Server Lineage II through an SSH tunnel

Well, first of all thank you very much to Manuel Gulick to read previous entries and interest in the matter and also for taking the time to write and reawakened my interest in this story of tunneling.

As you know these issues and had tried on the blog in these two entries: Jump

just that I will not explain here the details of SSH server configuration and so on. I'll just concentrate on talking about the issue that remained outstanding which is the connection to the game server.

About This entry

This entry is a tutorial that aims in the most graphic possible to illustrate a way to connect to a server to play Lineage II and when you are behind a firewall that does not allow connection ports directly in running the game using an SSH tunnel.

To make use of this technique is to have a relay team outside the firewall that is configured to serve the SSH protocol to a port that is accessible to the computer that is inside the firewall. For more information on this subject read the entry: Jump Firewalls using OpenSSH

One more comment, this technique only works with servers that do not modify the client but altering the hosts file to make the connection. It may work with a server to alter the client but that is not covered in this guide

Preliminary

Well first of all, to use the technique I explain below the computer that is inside the firewall must have an address static IP, so if the computer is receiving an address by DHCP will to take note of the addresses that the DHCP delivery and then set these parameters in the configuration, then we will see how:

we on Start → Control Panel.

There, under "Network and Internet" you click on the link "View network status and network tasks"

and in the window that opens on the panel the left choose "Manage Network Connections"

will now see a window with the network connection that has our team, we are going to click the right mouse button on the use connection and select "Status" in the Start menu:

The sale opens select "Details"

Here we note the following: IPv4 Address IP, IPv4 subnet mask, default gateway IPv4, IPv4 DNS Servers. These data will need them later so that we write down there somewhere and then close all open windows. Server Information

Well, we will also need the server to which we will connect the following information:

  • Address Authentication Server IP Address
  • game server IP
  • authentication server port (usually 2106)
  • game server port (usually 7778)

This information can usually get the hosts file that Most alter servers. The hosts file is in C: \\ windows \\ system32 \\ drivers \\ etc

For this example we are going to connect to server L2TheGame , information from that server is:

  • Authentication Server: 78.46.17.80
  • Game server (Phoenix [500x]): 78.46.17.80
  • authentication server port:
  • 2106 game server port: 7778

Tip:

best for this technique of tunneling is to play the opening directly l2.exe Lineage II (which is in the system folder) to avoid pass through the nProtect server and l2patcher. This is what I recommend and this is how take this guide.

hosts file modification

first thing we do is modify the hosts file. The hosts file is in C: \\ windows \\ system32 \\ drivers \\ etc, as this is a system file for editing will have to run notepad with administrator privileges (Right Click → Run as administrator) and open the file.
In the file you will see three lines like these:

# The patch edited this three lines ... 78.46.17.80 l2authd.lineage2.com

84.246.123.71 l2patcher.lineage2.com
216.107.250.194 nProtect.lineage2.com

only modify the first line, add a # at the beginning and then add another line below it, the then file should look like this: # The patch

edited this three lines ...
# 78.46.17.80 l2authd.lineage2.com
127.0.0.1 l2authd.lineage2.com
84.246.123.71 l2patcher.lineage2.com
216.107.250.194 nProtect.lineage2.com

now prove that the decision DNS for l2authd.lineage2.com server has been changed to localhost (127.0.0.1), so we provide a console window and run: ping

l2authd.lineage2.com

To which the system should respond:

Pinging
l2authd.lineage2.com [127.0.0.1] with 32 bytes of data:

Reply from 127.0.0.1: bytes = 32 time \u0026lt;1ms TTL = 128
Reply from 127.0.0.1: bytes = 32 time \u0026lt;1ms
TTL = 128 Reply from 127.0.0.1: bytes = 32 time \u0026lt;1ms TTL = 128
Reply from 127.0.0.1: bytes = 32 time \u0026lt;1ms TTL = 128

Ping statistics for 127.0.0.1:
Packages: Sent = 4, Received = 4, Lost = 0
(0% loss), Approximate
return in milliseconds: Minimum = 0ms
, Maximum = 0ms, Average = 0ms

Configure the network card

Well, here comes the secret of this post and what differs from previous ones. We will set up a dual IP address in our network card, for this we go back to Start → Control Panel

selecting "View network status and network tasks" under the category "Network and Internet"

and again on the "Manage network connections"

again click the right mouse button on the connection and this time select "Properties" from the Start menu:

We at the list and select the "Internet protoclo version 4 (TCP/IPv4)" and you click on the Properties button

select "Use the following IP address "and you click on the button" Advanced ... "

Top

where it says "IP Addresses" We click "Add"

First add the normal IP address of the computer (which we noted in the "Preliminaries" above), we also introduce the subnet mask and we click OK. Then go back to click on the Add button and add another IP. In this case add the IP address of game server, for example to accompany 78.46.17.80 and subnet mask 255.255.255.0

Ok, now where it says "Default gateways" We click the Add button and add the default gateway of our connection (We scored in the "Trial") let windows handle the metric by which we selected the box

Now we click the DNS tab

then where it says "DNS server addresses in order of use" we click on "Add" and add the DNS servers of our connection:

We click "OK" on all open windows until we get back to the window where network connections appear. Before proceeding we must prove that we can still access the Internet, to make it open the browser and look for any website, if we can see, we are ready to move forward.

would also be good to verify that the network card was with both IP addresses. For that we open a console and run: ipconfig

and verify that the connection has two IP addresses:

Wireless LAN adapter Wireless Network Connection:

specific DNS Suffix for connection. . :
Link-local IPv6 Address. . . : Fe80:: thereof 389d: 74c8: 67ee:
f52c% 11 IPv4 Address. . . . . . . . . . . . . . :
78.46.17.80 Subnet Mask. . . . . . . . . . . . : 255.255.255.0 IPv4 Address
. . . . . . . . . . . . . . : 192.168.0.174 Subnet Mask
. . . . . . . . . . . . : 255.255.255.0 Default Gateway
. . . . . : 192.168.0.1

Create the tunnel

Well, now it was time to create the SSH tunnel that will make us jump the firewall. For this example we will use the Putty GUI that is but would like the normal SSH console.

Open

Putty:

For "Host Name (or IP Address)" write the IP address of the relay team (the team that is outside the firewall). If the relay team is serving on a port other than 22 (for example, 80 as discussed in previous entries) must specify that port in the box beside it.

Then in the tree on the left we Connection → SSH → Tunnels

primroses we make sure the checkbox "Local ports accepts connections from hosts Other" is checked and then under where it says Add new forwarded port we write the following:

Source port: 2106 Destination
: 78.46.17.80:2106

We look to "Local" and "Auto" are selected and we click on "Add"
In this step we just make the tunnel to the authentication server, so you should replace 78.46.17.80 with the IP address of the server's authentication server where you play.

then add the forwarding to the server of the game:

Source port: 7778 Destination
: 78.46.17.80:7778

We look to "Local" and "Auto" are selected and we click on "Add"

Al Putty finished window should look something well.

Note:

In the case of L2 Phoenix server TheGame both the authentication server and the server of the game are on the same machine (have the same IP), however for many Lineage II servers this is not true. Notice that you did the forwarding to the correct addresses or the connection fails.

Well, now I recommend you save the session of Putty for use whenever you want to play and if something fails to be able to correct errors without having to retype everything. In the tree on the left selects the first Item (Session) and where it says "Saved sessions" enter a name for the session, such as "L2" and then click "Save."
The next time you open Putty you can click on the entry in the list and click "Load" and Putty charged again all parameters (including the tunnels). Connect and test

Ok. It seems everything is ready to connect and have fun. Click the button "Open" from Putty to connect, Loge with a user name and a valid constraseña. Before starting

Lineage notice that Putty is ready to do the Port Forwarding. To do so open a console and run: ipconfig

-N-a-p tcp

should see two ports open on listening, the 2106 and 7778: TCP 0.0.0.0:2106 0.0.0.0:0

; LISTENING TCP 0.0.0.0:7778 0.0.0.0:0 LISTENING

If all goes well so far subtracted just open the client of Lineage II and connect and you should be able to play normal. Congratulations! Technical Details

I'll explain in a bit because it works above. As you've noticed that you use the Windows feature to allow more than one IP address on the same network card (although it could have done with two NICs if that feature is unavailable).

What we did was to put the IP address of game server in the network card with a subnet mask of 255.255.255.0 and that is where lies the secret of this matter

When a system is to establish a connection with another system the first thing is to do a binary AND between its own IP address and subnet mask, in our case:


078.046.017.80 255.255.255.0
---------------
78.46.17.0

Then take the direction which will connect and make a binary AND the subnet mask, in our case:

078,046. ---------------

017.80
78.46.17.0 255.255.255.0

If the two addresses resulting from previous operations are different, the system knows to try to send the connection request through the gateway to the destination address is on another network, most, if they are equal (which happens in this example) the system knows that the destination address is within your own network so it is not send the request through the gateway, but through the network local.

As we stated that our IP address is 78.46.17.80 when the request is sent through the local network the recipient is again our own network card.

So what we have done here is to trick the system in a way to send a request normally sent through the gateway back to our system and we have made Putty listen for incoming connections on port 7778 ( as if a Lineage II server running on the local machine)

What happens in short is:

  1. Open Client Lineage and write our data access
  2. Lineage
  3. l2authd.lineage2.com resolves the address, as we have added an entry to the hosts file that says that address is 127.0.0.1 Lineage II sends an access request to localhost on port 2106
  4. Putty is listening on port 2106 when he forwards the request using Putty relay team to the real server authentication Lineage II (the client does not notice the difference)
  5. authentication happens and Lineage II The list of servers that the authentication server sent back.
  6. select a server to connect
  7. Lineage II in this case is not resolved any direction but to establish a direct connection to the server. Puts a request in which network the IP address of game server (for example 78.46.17.80)
  8. Windows binary makes operation mentioned above and concluded that that address is within the local network. Puts the request and it returns back to the network card.
  9. Putty is listening on port 7778 so that it receives the request and forwards with the help of the relay team to the real game server. Establishing the connection and Lineage II shows the characters that appear in our account.

While we play Putty, and SSH server running on the relay team will keep the connection permanently. Lineage II client will not notice Firewall difference and think that the connection is admitted to a port.

Note that there may be extra lag:

Remember that SSH connections are encrypted, so your computer must encrypt the data before sending the team, washed and then this in turn must decrypt it to send the game server you are adding an additional node to the connection. All this can cause extra lag so the experience will never be the same as you would with a direct connection.

0 comments:

Post a Comment