Here's what the scheme of things probably looks like:
┌───────────┐ ┌────────┐ ┌────────┐ ┌──────────┐
│ Your │192.168.0.2 │ Your │82.15.X.Y │ Friend │192.168.0.1 │ Friend │
│ computer ├─────────────┤ router ├───────────┤ router ├─────────────┤ computer │
├───────────┤ 192.168.0.1└────────┘ 78.13.Z.T└────────┘ 192.168.0.2└──────────┘
│ Minecraft ├ Port 25565
└───────────────────────────┘ └───────────────────┘ └────────────────────────────┘
Your home network Teh Internets Friend home network
Your minecraft server is listening on port 25565 of your home computer, 192.168.0.2. However, this is a private address that only makes sense when connected to your router. Each router has its own private addresses, which means that your computer can be on 192.168.0.2, your friend computer can also be on 192.168.0.2 and everything is still okay.
To connect to you, your friend needs the IP address your router is connected to the internet with. Your ISP (more or less) dynamically assigns this number to you and it's what those "what is my ip" sites show to you. So, to your friend, you're 82.15.X.Y, and that's what he will enter on Minecraft.
However, 82.15.X.Y is not your computer, but your router. Your router doesn't know what to do with connections to that port and rejects the connection. What now?
Your router needs to know that, if he sees attempts to connect to port 25565 (Minecraft servers' default listening port), he should forward those connections to the computer on address 192.168.0.2 — this is port forwarding.
To make port forwarding work, you need two things:
- A static IP address in your home network. You can get this by configuring static allocation DHCP, so that your computer* always gets the same IP address (say, 192.168.0.200).
- The port forwarding information (forward all connections to port 25565 to 192.168.0.200).
The exact configuration process depends by your router make and model. Sites like portforward.com have extended
guides to get this working.
* or, more accurately, the MAC address of your computer's network card.