Through intranet penetration, build a personal "Minecraft" server on the public network under Windows 10 system

Today I would like to share with you how you can set up a Minecraft server on the Windows system in just a few simple steps, and use the cpolar intranet penetration tool to expose local services to the public network connection, so that you can play online games with your friends.

1. Java environment setup

Take the Windows 10 system as an example, configure the Java environment, build a Minecraft server, and download the latest Java version.

https://www.oracle.com/java/technologies/downloads/#jdk17-windows

Select exethe file, and after the download is complete, double-click the installation package to install it by default.

20230106114635

After the java installation is completed, open the folder, find java, and copy the jdk installation path. In this example, it isC:\Program Files\Java\jdk-17.0.5

20230106115401

高级系统设置Search and open System Properties in the Start menu bar and click环境变量

20230106115042

Click新建一个系统环境变量

20230106115738

  • Variable name: JAVA_HOME
  • Variable value: JDK installation path, in this exampleC:\Program Files\Java\jdk-17.0.5

20230106115915

In the system variables list, double-clickPath变量

20230106120755

Click New on the right, add in front of the variable name and value %JAVA_HOME%\bin, and click OK

20230106123303

Verify whether it is successful: Search cmd in the Start menu bar, open the command prompt, and enter java -version. If the version information appears, the configuration is successful.

image-20230401233557828

2. Install the Minecraft service

Download the MC server. The latest version of the server can be downloaded from the official website.

https://www.minecraft.net/zh-hans/download/server/

20230106133906

3. Start the Minecraft service

Enter the Minecraft service jar package download directory and click on the file in the upper left corner

image-20230401234113614

Open powershell and open it as administrator

image-20230401234852919

Execute the java run command to run the jar package service

java -jar server.jar --nogui

After running, an error is prompted. The error means that it is subject to EULA. One is automatically generated when you run the server for the first time eula.txt. Open it with a text editor (such as Notepad) eula.txtand change the file eula=falseto eula=true. This means that you have read and understood the EULA and will abide by it when using the server. If you don't do this, the server will shut down as soon as you try to start it.

image-20230401235223955

We can see this eula.txt file under the directory of the jar package
image-20230402113514171

Open the file, change eula的值it trueto
image-20230401235417205

Then we use the above command again to start and run the jar package service, and we can see that the port is25565

image-20230401235640804

4. LAN test connection to Minecraft server

Open the Minecraft launcher, click to enter the game, and select多人游戏

20230105164215

Click添加服务器

20230105164407

  • name of server
  • Server address: fill in the local ip address + mc port number (default is 25565), such as127.0.0.1:25565

Click完成

20230105164535

After selecting the server you just created, click加入服务器

20230105165431

Then there will be a connection failure, because the genuine verification requires verification of the genuine account, we need to turn off the verification.

image-20230402113417967

Looking at powershell, I also saw related errors. Next, I need to modify the relevant configuration files. First, close powershell.
image-20230401235503928

Find the server.properties file in the installation directory and edit it
image-20230402114309235

Then make the following changes: online-mode=false (turn off genuine verification), and save after making the changes.

image-20230402113816013

Then start the server.jar service again. You can see the following prompt, indicating that the modification is successful.
image-20230402113702085

Then we connected again and successfully entered the game

image-20230402114503803

5. Install cpolar intranet penetration

cpolar official website: https://www.cpolar.com/

For Windows systems, you can directly download the zip package suitable for the Windows platform from the official website. After decompression, you will get the cpolar installation package, and then double-click the installation package to install it by default.

6. Create a tunnel to map the intranet port

After the successful installation of cpolar intranet penetration, access the cpolar web UI management interface on the browser (default is local port 9200), access it in the form of [http://local ip address:9200], such as http://127.0.0.1 :9200/, and log in using cpolar account

20230106104443

After successfully logging in, click Tunnel Management on the left - Create Tunnel:

  • 隧道名称: The name can be customized. Be careful not to duplicate the existing tunnel name.
  • 协议:Select tcp protocol
  • 本地地址:25565 (Minecraft default port number)
  • 端口类型: Random temporary TCP port
  • 地区:China vip

Click创建

20230105184838

After the tunnel is successfully created, the page automatically jumps to the tunnel list page. You can see that the status is normally displayed as active, which is the normal online status.

20230105184901

状态Click - on the left dashboard 在线隧道列表, you can see that the tunnel just created successfully has generated the corresponding public network address. We will copy it. Note that tcp://there is no need to copy it. In this example, it is3.tcp.vip.cpolar.cn:10786

20230105184936

7. Test public network remote connection

Start Minecraft, you can add a new server directly, or edit the local server you just added

20230105185016

In the server address bar, enter the public network address generated by cpolar 3.tcp.vip.cpolar.cn:10786and click Finish.

20230105185052

Join the server and the public network remote connection is successful.

20230105185139

8. Configure fixed TCP port address

It should be noted that the above steps use a random temporary TCP port address, and the generated public network address is a random temporary address, which will change randomly within 24 hours. In order to facilitate our friends to connect remotely, we will configure a fixed TCP port address for them. This address will not change, making it easier for our friends to connect remotely without having to repeatedly modify the server address every day.

Configuring a fixed TCP port address requires upgrading cpolar to the Professional Edition package or above.

8.1 Reserve a fixed tcp address

Log in to the cpolar official website, click Reserve on the left, and find the reserved TCP address. Let’s reserve a fixed TCP address for Minecraft:

  • 地区:Select China vip
  • 描述:Remarks, can be customized

Click保留

20230105185311

After the address is successfully reserved, the system will generate the corresponding fixed public network address. In this case 5.tcp.vip.cpolar.cn:12637, copy it.

20230105185336

8.2 Configure fixed tcp address

Access port 9200 on the browser, http://127.0.0.1:9200/, log in to the cpolar web ui management interface, click Tunnel Management - Tunnel List on the left dashboard, find the Minecraft Tunnel, and click on the right编辑

20230105185409

Modify the tunnel information and configure the successfully reserved fixed tcp address into the tunnel.

  • 端口类型: Modify to fixed tcp port
  • 预留的tcp地址: Fill in the successfully reserved address, in this example:5.tcp.vip.cpolar.cn:12637

Click更新

20230105185445

After the tunnel is successfully updated, click the status on the left dashboard - Online Tunnel List, find the Minecraft Tunnel, and you can see that the public network address has been updated to a fixed TCP address.

20230105185503

9. Use a fixed public address to connect remotely

Next, we test the remote connection using a fixed public network TCP port address.

20230105185542

Public network remote connection successful!

Now, the public address no longer changes randomly.

20230105185616

Reprinted from cpolar pole cloud article: Build a Minecraft Java version server, public network remote connection [intranet penetration]

Guess you like

Origin blog.csdn.net/qq_25749749/article/details/133134012