Author Topic: (Tutorial) Port fowarding [Windows 7/8/8.1/10]  (Read 3812 times)

First of all, what is UPnP?
UPnP (Universal Plug n Play) is a protocol that enables programs running on a host to automatically configure port forwarding on your router. Sadly, this may not work 100% of the time and you sometimes wonder why your friends cannot connect to your server anymore. They report that the server's ping is "---" and you are 100% sure that it had a ping the last time you were hosting. By default, your server tries to connect to your router and attempt to port forward for you.

Manual port forwarding is usually the best way for people to connect to your servers.



Any Windows user from Windows 7 and above is capable of following this tutorial. If you are on a Mac, I am sorry.

Step 1: Find out what your IPv4 and your gateway address is
Find command prompt, ways to find it:
  + Search though the start menu and find "command prompt" under windows accessories/system
  + Combo of Windows key + R, type in cmd, press OK

Once you are on command prompt, type ipconfig, a bunch of stuff should show up (no worries).
On the right side, you'll see 2 things that I am showing to you, and they are the most important to port forward.

(I blocked most of the stuff out for privacy and because it's useless information to know)
  Your IPv4 is your local address to the router which is needed for port forwarding
  Your gateway address is what you need to port forward
  Your subnet mask is used for port forwarding if you want to port forward on your computer

Most routers require a user name and a password. They can be on your router's details. If you cannot find your router user name and password details you can find them on websites using the manufacturer and the model number. I would personally recommend: http://www.routerpasswords.com/[/size]

Be sure to remember (write them down somewhere):
  IPv4
  Gateway address
  User name and password for your router
  Subnet mask

Step 2: Decide what port you want to use
If you have no idea on what port you want to use, you can always check what your server is currently using. To do this:
  1. Open Windows Explorer, go to your Blockland directory (SteamApps/Common/Blockland or Documents/Blockland)
  2. Make sure your Blockland is closed completely so the game does not try to overwrite the prefs
  3. Open config/server/prefs.cs - If you cannot open it, notepad is fine
  4. Find $Pref::Server::Port, you can change the value at the end (only change the numbers, do not remove the quotes if they are there) if you want but remember what the value is

Step 3: Port forward
After finding the port you need to go to your gateway address into your favorite browser. Make sure you enter the same user name and password you got from the router details.
If this worked, find out where your port forwarding page is.


Of course, each manufacturer is different to find the port forwarding page:
  1. Add a 'service' and name it whatever you want
  2. Make sure it's UDP (UDP/TCP selection is OK but make sure UDP is involved)
  3. Use the same port that you gave your server, some routers might have a "range", most likely just put the same port for the min and max range.
      a. If you are confused on this please share what your port forwarding page looks like!
  4. Add the internal IP address (some routers only have the last box editable), use the IPv4.
  5. Make sure the service is added and enabled.
  5. Some routers might have settings to "always port forward", if you have issues with the router not port forwarding this can be your problem. Make sure your ports are forwarding.

If you have tried port forwarding and you believe you did everything you can, try port forwarding your adapter. Although, you need administrator access:
1. First find and open control panel. Then click Network and Internet

2. Go to Network and Sharing Center

3. Go to Change adapter settings

4. Select how you are using the internet (WiFi or Ethernet?), right-click and go to properties (need administrator)

5. Find IPv4, select it and go to properties

6. Check Use the following IP address which will also auto-check Use the following DNS server addresses
  a. Use the following IPv4, subnet mask, and default gateway that you have remembered/written down and put them where they belong
  b. DNS servers, some people recommend just putting 8.8.8.8
  c. Press OK to save changes


Step 4: Host a server
Start your server, and people should be able to connect!
If you have issues with this, find out what you did wrong. If you cannot find out why, it would be helpful if you post what your router manufacturer is, and its model number.



I would like to have some comments on how to make this tutorial better. Please share.
« Last Edit: January 06, 2017, 09:15:33 PM by Kyuande »

reversed

nice job!
« Last Edit: January 06, 2017, 05:22:11 PM by Dragonoid.Slayer »



You should also add the optional extension of setting a static IP to fix issues with port forwarding settings being invalidated by your private IP changing. It goes something like this.

Control panel -> Network and sharing center -> Change adapter settings -> (Select your network adapter) -> Properties -> Internet Protocol v4 settings -> Properties -> Select 'Use the following IP address' -> Enter your currently assigned private IP and enter the default gateway address, maybe just suggest using 8.8.8.8 as the DNS server -> OK everything to save
« Last Edit: January 06, 2017, 05:38:39 PM by Pecon »

Oh yeah I remember doing that 4+ years ago when I first hosted a Blockland server and no one could connect to it and I couldn't access my router. I'll add that soon.

Thanks Pecon!
« Last Edit: January 06, 2017, 06:08:19 PM by Kyuande »



make one for mac?
it's practically the same process if you go with method a except for obtaining your ip and stuff and even then you can just google how to do that on a mac through terminal

FYI viso the process I described isn't 'Method B' so to speak because it doesn't actually port forward anything. It's just an additional step to try if your port forwarding settings don't stick well or aren't working.

ffs i dont have upnp on my router
pls hlep

ffs i dont have upnp on my router
pls hlep

You don't need upnp on your router

FYI viso the process I described isn't 'Method B' so to speak because it doesn't actually port forward anything. It's just an additional step to try if your port forwarding settings don't stick well or aren't working.
My bad.

Edited OP, removed "method", I guess I never knew how that really worked. Thanks.
« Last Edit: January 06, 2017, 09:16:07 PM by Kyuande »

UPNP:

IF YOU ARE DOING MANUAL UPNP FORWARDING PLEASE UNCHECK ENABLE UPNP IN BLOCKLAND
Option A: portmapper (requires java)
Download portmapper

After downloading, make sure you have the JRE/JDK installed

Create a new Port mapping Preset (it'll look like https://vgy.me/fQJcsh.png), fill in Description with whatever name. Unless you have multiple blockland servers (i think..?) on the same connection, you do not want to touch Remote Hosts.
Next, select Add port range (looks like this https://vgy.me/fQJcsh.png), keep everything checked and input in 28000 to 28005, then repeat that, except change the protocol from TCP to UDP.
Next, exit out of the add port range menu, and click save. You should now see a port mapping preset with your description/name show up. Next, press Connect. This will start connecting to the UPNP server on your router. Wait for it to finish (when it's done you should see something like this https://vgy.me/kFH5G7.png if you have any UPnP entries on your router.) Next, highlight the port mapping preset that you created and click Use. You have (maybe) successfully forwarded external ports to internal ports on your local IP. Now, enter blockland and uncheck "Use UPnP" in Options -> Network. Leave PortMapper running while you are running your server, and you should have a reachable server that other people can connect to.


Option B: Albertino Port Mapper (requires c++ redistributable)
This is alot simpler. If your IP isn't showing, or the top says that it could not find your router, UPnP is not supported on your router :(
Otherwise, click the + button at the bottom, and input (for the local and public ports), 28000. Be sure to check the UDP and TCP checkboxes. Again, for the description name it whatever you want. After filling everything out, click Add Mapping, following with "Start Listening". If you don't want your ports to be accessable 100% of the time, check "Remove Mapped Ports on Exit". Otherwise, your PC should be accessable to the outside world. Test with http://www.canyouseeme.org/ to ensure that you have your ports open.
« Last Edit: January 06, 2017, 09:25:01 PM by Metario »

This topic needs more love.

i have your ip im gonna hack you now!!!!!!!!