当前位置:网站首页>FRP intranet penetration, reverse proxy
FRP intranet penetration, reverse proxy
2022-07-04 05:47:00 【GoCoding】
frp It is a high performance reverse proxy application focusing on Intranet penetration , Support TCP、UDP、HTTP、HTTPS Other protocols . You can make intranet services secure 、 Convenient way through the public network IP Node transfer is exposed to the public network .
This article will expose the intranet Web Service as an example , practice frp Installation and deployment of . More scenarios , so frp Example .
install
frp Mainly by client (frpc) and Server side (frps) form , The server is usually deployed in a network with a public network IP On the machine , The client is usually deployed on the machine where the intranet service needs to be penetrated .
Can be in Github Of Release Page to download the latest version of the client and server binary files .
Article public network 、 Intranet machines are Linux x86_64
, So I chose frp_0.39.0_linux_amd64.tar.gz
. decompression :
$ tar xzvf frp_0.39.0_linux_amd64.tar.gz
frp_0.39.0_linux_amd64/
frp_0.39.0_linux_amd64/frps
frp_0.39.0_linux_amd64/frps_full.ini
frp_0.39.0_linux_amd64/systemd/
frp_0.39.0_linux_amd64/systemd/[email protected]
frp_0.39.0_linux_amd64/systemd/[email protected]
frp_0.39.0_linux_amd64/systemd/frpc.service
frp_0.39.0_linux_amd64/systemd/frps.service
frp_0.39.0_linux_amd64/LICENSE
frp_0.39.0_linux_amd64/frpc.ini
frp_0.39.0_linux_amd64/frpc_full.ini
frp_0.39.0_linux_amd64/frps.ini
frp_0.39.0_linux_amd64/frpc
Public network
Copy frps
File into the public network machine , Assume that IP by x.x.x.x
:
scp frps* [email protected]:
modify frps.ini
file , Set listening HTTP The request port is 8080:
cat <<-EOF > ~/frps.ini
[common]
bind_port = 7000
vhost_http_port = 8080
EOF
install supervisor
Deployment , The backstage runs for a long time :
# install supervisor
sudo apt install supervisor -y
# Add the configuration
sudo -i
cat <<-EOF >> /etc/supervisor/supervisord.conf
[program:frps]
directory=/home/ubuntu
command=/home/ubuntu/frps -c /home/ubuntu/frps.ini
priority=999
autostart=true
autorestart=true
startsecs=10
startretries=3
stdout_logfile=/var/log/frps_out.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile=/var/log/frps_err.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
environment=
nocleanup=false
EOF
exit
# Update service
sudo supervisorctl update all
# View service
sudo supervisorctl status all
Intranet
Copy frpc
File into intranet machine , Assume that IP by 192.168.1.100
:
scp frpc* [email protected]:
modify frpc.ini
file , hypothesis frps
Of the server IP by x.x.x.x
,local_port
On the local machine Web The port the service listens on , Bind custom domain name as custom_domains
.
cat <<-EOF > ~/frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[web]
type = http
local_port = 8000
custom_domains = www.yourdomain.com
EOF
take www.yourdomain.com
Domain name of A The record resolves to IP x.x.x.x
.
If the server already has a corresponding domain name , Can also be CNAME The record resolves to the original domain name of the server . Or you can modify HTTP Requested Host Field to achieve the same effect .
Simple operation service , To test :
# function HTTP service
python3 -m http.server 8000
# function frpc service
./frpc -c ./frpc.ini
# Access test
curl http://www.yourdomain.com:8080/
With systemd
Deployment , The backstage runs for a long time :
# Copy files
sudo cp frpc /usr/bin/frpc
sudo mkdir -p /etc/frp
sudo cp frpc.ini /etc/frp/frpc.ini
# Add the configuration (frp Given systemd To configure )
sudo -i
cat <<-EOF > /etc/systemd/system/frpc.service
[Unit]
Description=Frp Client Service
After=network.target
[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/frpc -c /etc/frp/frpc.ini
ExecReload=/usr/bin/frpc reload -c /etc/frp/frpc.ini
LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
EOF
exit
# Overload configuration
sudo systemctl daemon-reload
# Boot up
sudo systemctl enable frpc.service
# Start the service
sudo systemctl start frpc.service
# Check the status
sudo systemctl status frpc.service
GoCoding Personal experience sharing , We can pay attention to the official account !
边栏推荐
- [QT] create mycombobox click event
- Basic concept of bus
- Etcd database source code analysis - initialization overview
- 力扣(LeetCode)184. 部门工资最高的员工(2022.07.03)
- 每周小结(*63):关于正能量
- BUU-Crypto-[GUET-CTF2019]BabyRSA
- BUU-Crypto-[HDCTF2019]basic rsa
- LM small programmable controller software (based on CoDeSys) note 22: error 4268/4052
- Viewing and using binary log of MySQL
- [MySQL practice of massive data with high concurrency, high performance and high availability -8] - transaction isolation mechanism of InnoDB
猜你喜欢
一键过滤选择百度网盘文件
APScheduler如何设置任务不并发(即第一个任务执行完再执行下一个)?
Grounding relay dd-1/60
[Excel] 数据透视图
接地继电器DD-1/60
724. Find the central subscript of the array
Introduction to AMBA
配置交叉编译工具链和环境变量
[high concurrency, high performance and high availability of massive data MySQL practice-7] - memory data drop disk
BUU-Crypto-[HDCTF2019]basic rsa
随机推荐
ansys命令
Design and implementation of tcp/ip series overview
19. Framebuffer application programming
Flink1.13 SQL basic syntax (I) DDL, DML
APScheduler如何设置任务不并发(即第一个任务执行完再执行下一个)?
tutle时钟改进版
Leakage detection relay jy82-2p
JS扁平化数形结构的数组
Halcon图片标定,使得后续图片处理过后变成与模板图片一样
Grounding relay dd-1/60
JS arguments parameter usage and explanation
Configure cross compilation tool chain and environment variables
Zzulioj:1201: mode problem
The data mark is a piece of fat meat, and it is not only China Manfu technology that focuses on this meat
Enterprise level log analysis system elk (if things backfire, there must be other arrangements)
js如何将秒转换成时分秒显示
BUU-Crypto-[GUET-CTF2019]BabyRSA
Arc135 C (the proof is not very clear)
Upper computer software development - log information is stored in the database based on log4net
Signification des lettres du module optique et abréviation des paramètres Daquan