Today, with the shortage of public network IPV4 resources, it is almost impossible for operators to assign public network IP addresses to our home broadband. In daily life, we may need to access some resources in some home devices outside the home network, such as some data on computers or data in home NAS, or need to remotely control computers for some operations. The latter can install third-party remote software, For example, todesk or sunflower software, but accessing the data in NAS is more troublesome. Even though we can use some third-party tools for remote control or access, but after all, it is a third party, which does not rule out the possibility of disclosure, so it is necessary to build an intranet penetration server.
So what is intranet penetration? As shown in the figure below, we need host A and host C to communicate, but neither host A nor host C has a public IP address, so we cannot communicate directly. At this time, we need to use intranet penetration!
Before building an intranet penetration server, you need to have a server with a public IP address. If the traffic used by your business is not very large, you can consider a lightweight server. Generally, there are hundreds of gigabytes to several terabytes of traffic per month, and the price is not expensive. Two meals can buy a year. Alibaba Cloud and Tencent Cloud platforms are available!
Xiaobian has prepared a Tianyi Cloud server here, and the specific purchase process is not much to say. When selecting the system, you can select Windows or CentOS (Xiaobian here uses CentOS to demonstrate), as shown in the figure below, click Remote Connect to connect to the server!
Look at the picture and enter the following command (Windows can download the Windows program to modify the frps.ini file, which is about the same as Windows to modify the client file, which will be discussed later). After entering, press Enter to execute. The download of gitub may be slow in China, pay attention to the space! wgethttps://github.com/fatedier/frp/releases/download/v0.45.0/frp_0.45.0_linux_386.tar.gz
Tar-vxzf filename lscd file directory vimfrps.ini
As shown in the following figure, paste the following configuration: 7001 is the console port, admin is the console account, 123456 is the console password, and 8080 is the http listening port. If it is only used to remotely control the computer, this is optional. The above configuration can be modified according to your needs!
dashboard_ port = 7001dashboard_ user = admin dashboard_ pwd = 123456vhost_ http_ port = 8080
After pasting, press ESC to exit, enter the following command, save and exit!: Wq and then enter the following command. If frps started successfully appears, it means the service is started successfully/ frps -c ./ frps.ini
After the server is configured, configure the client, download the Windows version file, double-click to open the frpc.ini file in the file directory (if the server is a Windows system, double-click frps.ini to configure the file, which is basically similar to Linux)!
Then paste the following configuration. The following is the configuration of Xiaobian. You can modify it according to your own needs. After modification, save it! [common]server_ Addr=server ip (modify) server_ port = 7000authent
ication_ method = tokenauthenticate_ new_ work_ conns = truetoken = 123456[mixkeji]type = tcplocal_ ip = 127.0.0.1
local_ port = 3389remote_ port = 6000
After saving, go to the server console security group to release port 7000700180806000 (if you customize it, release your customized port)!
Then enter CMD in the file path column, or cd to the directory in cmd!
Enter the following command in cmd and press Enter. The prompt “start proxy success” means the operation is successful! frpc.exe-cfrpc.ini
At this time, we can use Microsoft’s own remote software to remotely control your computer. Enter the server’s ip: port number, user name and password to connect successfully (note that the user name and password here are the user name and password of your computer)!
Mobile phones can download a Microsoft remote control tool RD, enter the ip: port, and the user name and password of the computer to connect remotely!
You can access the console by accessing the ip: 7001 port in the browser!
Finally, we can add a startup to frpc, create a TXT text in the frp folder, paste the following command, change the suffix TXT to BAT and create a shortcut after saving@ echo off :home frpc.exe -c frpc.ini goto home
Put the shortcut in the following directory to start the machine automatically! C: Users your user name AppData Roaming Microsoft Windows Start Menu Programs Startup A server can also be installed on multiple computers, as long as the ports are not repeated