2023 latest version FRP+V2ray intranet reverse proxy building tutorial

Original link: https://tstrs.me/result/CJwbIocBHWjmVS7vD5YO

need

I have a very special requirement recently: [I want to use the company’s server to proxy the Internet at home], but, the company’s server is in the intranet, so this requirement is split into two sub-requirements:

1. Reverse proxy the intranet device to make it accessible through the public network.

2. Set up the V2ray server on the internal network device for external network access.

This requirement can actually be achieved through various methods, but because I am familiar with FRP and V2ray, this article will use these two software as examples. Don’t ask what it’s for, it’s for testing ? .

system environment

The two ends of this requirement are the company server and the home computer, both of which are intranet devices that cannot be directly connected to each other, so a cloud server is needed for FRP transfer.

Home: Windows system, V2rayN has been installed.

Cloud: Ubuntu 20.04 system. Used to install FRP server

Company: Ubuntu 20.04 system. Used to install V2ray server and FRP client.

The simple structure is as follows:

solution

Because all the devices are in the mainland, all the links used in this article can be directly accessed from the mainland.

1. Install FRP

1.1. Operation on cloud Ubuntu:

First, you need to deploy the FRP server on the cloud server, and then create a new frp file and copy the files that the server can use to facilitate future calls.

 wget https://ghproxy.com/https://github.com/fatedier/frp/releases/download/v0.48.0/frp_0.48.0_linux_amd64.tar.gz
mkdir /usr/local/frp
tar -zxvf frp_0.48.0_linux_amd64.tar.gz
cd frp_0.48.0_linux_amd64
cp frps frps.ini frps_full.ini /usr/local/frp
cd /usr/local/frp

Then edit the configuration file frps.ini and fill in the following codes, 7000 means the address to contact the client:

 [common]
bind_port = 7000

Finally, use the following code to run the cloud server:

 ./frps -c ./frps.ini

In this way, the cloud server is configured. Don’t forget to open port 7000 on the cloud server firewall.

1.2. Operation on the company’s Ubuntu:

The operation on the company’s server is similar to that on the cloud, but it is configured according to the client.

 wget https://ghproxy.com/https://github.com/fatedier/frp/releases/download/v0.48.0/frp_0.48.0_linux_amd64.tar.gz
mkdir /usr/local/frp
tar -zxvf frp_0.48.0_linux_amd64.tar.gz
cd frp_0.48.0_linux_amd64
cp frpc frpc.ini frpc_full.ini /usr/local/frp
cd /usr/local/frp

Edit the configuration file frpc.ini and fill in the following codes:

 [common]
server_addr = 1.1.1.1
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

[v2]
type = tcp
local_ip = 127.0.0.1
local_port = 11111
remote_port = 11111

I explain the meaning of the following configuration. addr and port in [common] refer to the ip of the cloud server and the port in the configuration. remote-port in [ssh] refers to the port that can be accessed from the remote server to the local server. The local-ip and local-port correspond to the ip and port of the server.

2. Install V2ray

After the reverse proxy is configured, we also need to install V2ray on the company’s Ubuntu to transfer traffic, otherwise we can only access local services.

2.1. Operation on the company’s Ubuntu:

Manually deploy V2ray with the following command:

 wget https://ghproxy.com/https://github.com/v2fly/v2ray-core/releases/download/v4.31.0/v2ray-linux-64.zip
unzip v2ray-linux-64.zip -d ./v2
cd v2
cp v2ray /usr/bin/v2ray/v2ray
cp v2ctl /usr/bin/v2ray/v2ctl
cp geoip.dat /usr/bin/v2ray/geoip.dat
cp geosite.dat /usr/bin/v2ray/geosite.dat
cp vpoint_vmess_freedom.json /etc/v2ray/config.json

Modify the /etc/v2ray/config.json file according to your needs.

Start the command, copy and paste the following command to start v2ray:

 nohup /usr/bin/v2ray/v2ray -config /etc/v2ray/config.json >/dev/null 2>&1 &

postscript

After such an operation, I can finally use the company’s network to surf the Internet at home, and check that the export ip is also the company’s ip. It may seem that this is useless, but isn’t it interesting to toss around.

This article is transferred from: https://tstrs.me/result/CJwbIocBHWjmVS7vD5YO
This site is only for collection, and the copyright belongs to the original author.