1.公网服务器(服务端s端) 1.1设置开机自启system 2.内网服务器(客户端c端) 2.1设置开机自启 3.测试…
内网穿透
1.公网服务器(服务端s端)
1 2 3 4 5 6 7 8 9 10 11 12
| [common] bindPort = 7000 vhostHTTPPort = 8080 [ssh] type = tcp remote_port = 6001 local_ip = 127.0.0.1 local_port = 22
nohup ./frps -c frps.ini &
|
1.1设置开机自启system
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| [Unit] Description=FRP Client After=network.target
[Service] Type=simple ExecStart=/root/frp/frps -c /root/frp/frps.ini Restart=on-failure
[Install] WantedBy=multi-user.target
port 22 port 6001
|
2.内网服务器(客户端c端)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| [common] server_addr = 115.120.199.168 server_port = 7000
[http] type = tcp local_ip = 127.0.0.1 local_port = 80 remote_port = 8080
[ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6001
nohup ./frps -c frps.ini &
|
2.1设置开机自启
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| [Unit] Description=FRP Client After=network.target
[Service] Type=simple ExecStart=/root/frp/frps -c /root/frp/frps.ini Restart=on-failure
[Install] WantedBy=multi-user.target
|
3.测试
1 2 3 4
| curl curl 115.120.199.168:8080 跳转到内网的80 ssh -p 6001 root@115.120.199.168 密码是内网的密码 跳转到内网的机子上
|