frp内网穿透

先将压缩包上传至根目录后解压

tar -xzvf frp_0.38.0_linux_386.tar.gz

编辑服务端配置文件

vi frps.ini

[common] bind_port = 7000 dashboard_port = 7500 dashboard_user = admin dashoard_pwd = admin enable_prometheus = true authentication_method = token token = 123456

vi /etc/systemd/system/frps.service

[Unit] Description=frpc daemon After=syslog.target network.target Wants=network.target [Service] Type=simple ExecStart=/frp/frps -c /frps.ini [Install] WantedBy=multi-user.target

systemctl enable frps

systemctl start frps

编辑客户端配置

vi frpc.ini

[common] server_addr = 服务端公网IP或域名 server_port = 7000 token = 123456 [1http] type = tcp local_ip = 127.0.0.1 local_port = 80 remote_port = 8080 [1ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 2222

vi /etc/systemd/system/frpc.service

[Unit] Description=frpc daemon After=syslog.target network.target Wants=network.target [Service] Type=simple ExecStart=/root/frp/frpc -c /root/frp/frpc.ini [Install] WantedBy=multi-user.target

添加端口

sudo firewall-cmd –permanent –add-port=8080/tcp

重启防火墙

sudo firewall-cmd –reload

查看端口

firewall-cmd –list-port

移除端口

firewall-cmd –permanent –remove-port=8080/tcp

原文链接:https://blog.csdn.net/qq_36439042/article/details/126716851

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享