内网穿透配置
免责声明:仅供学习计算机网络知识,内网穿透有风险,请谨慎对待。实验室学生有义务保障实验室网络安全,保护实验室设备资产。
云服务器
购买
选择轻量应用服务器
腾讯云45元每月,且买一年以上85折扣。选的这个。
阿里云60元每月。
配置
防火墙配置
在网站上配置,包含后面需要的端口即可
腾讯云界面

阿里云界面

frp配置
下载最新的frp:https://github.com/fatedier/frp
解压frp到/home/ubuntu/,文件夹重命名为frp
创建/home/ubuntu/frp_hjy存放服务器配置
以配置u15为例,在frp_hjy文件夹下创建frps15.ini,内容如下,7025和u15相连,8025是内网http服务,总的配置见附表
[common]bind_port = 7025vhost_http_port = 8025service配置
在/lib/systemd/system/下创建u15的frps15.service
sudo touch /lib/systemd/system/frps15.servicesudo vim /lib/systemd/system/frps15.service
########################################################[Unit]Description=fraps serviceAfter=network.target network-online.target syslog.targetWants=network.target network-online.target
[Service]Type=simple
# 启动服务的命令 第一个是服务器服务 第二个是frp配置ExecStart=/home/ubuntu/frp/frps -c /home/ubuntu/frp_hjy/frps15.iniKillSignal=SIGQUITTimeoutStopSec=5KillMode=processPrivateTmp=trueStandardOutput=syslogStandardError=inherit
[Install]WantedBy=multi-user.target########################################################启动
systemctl enable frps15.servicesystemctl start frps15.servicesystemctl status frps15.service
实验室服务器配置
下载
略
配置
frp配置
以配置u15为例,在/home/ubuntu15/hjy/frp/文件夹下创建frphjy.ini,内容如下,7025和云服务器相连,6025和自己的电脑相连,总的配置见附表
mkdir -p ...sudo touch /home/ubuntu15/hjy/frp/frphjy.inisudo vim /home/ubuntu15/hjy/frp/frphjy.ini
##################################[common]# 云服务器公网ipserver_addr = 我会告诉你?server_port = 7025
[ssh]type = tcplocal_ip = 127.0.0.1local_port = 22remote_port = 6025#################################service配置
在/lib/systemd/system/下创建u15的frps15.service
sudo touch /lib/systemd/system/frphjy.servicesudo vim /lib/systemd/system/frphjy.service
########################################################[Unit]Description=fraps serviceAfter=network.target network-online.target syslog.targetWants=network.target network-online.target
[Service]Type=simple
# 启动服务的命令 第一个是客户端服务(是c) 第二个是frp配置ExecStart=/home/ubuntu15/zzc/frp/frpc -c /home/ubuntu15/hjy/frp/frphjy.iniKillSignal=SIGQUITTimeoutStopSec=5KillMode=processPrivateTmp=trueStandardOutput=syslogStandardError=inherit
[Install]WantedBy=multi-user.target########################################################启动
systemctl enable frphjy.servicesystemctl start frphjy.servicesystemctl status frphjy.service
Comments