1. Current Location: Home >  NAS >  No public IP, FRP intranet penetration connects to the home NAS, with over thirty servers being relayed

No public IP, FRP intranet penetration connects to the home NAS, with over thirty servers being relayed

FRP intranet penetration link diagram: cloud server runs FRPS, home NAS is attached to FRPC container, external network access to server IP high-level ports via tunnel to home NAS, with configuration comparison for frps.toml and frpc.toml

My

cousin sent me a screenshot on WeChat: the company computer connected to Synology at home, with a transfer speed of 480KB per second, and three words added—lagging again. I bear half the responsibility for this. Their mobile broadband line is CGNAT starting with 100.64, so don't even think about a public IP address; Last year, I helped him < a href="https://www.shunot.com/en/lybk/1277.html"> and smoothed out IPv6 direct connection. The phone's traffic could reach 5MB per second right at the edge. He was happy but only discovered a new problem for two months: he was at the office during the day, and the company's WiFi was an old four-grid network with no V6 at all. The direct connection was cut off at the office. If the data gets cut off, it's returned to Synology's official relay. The free is only around 500KB per second, and there are discounts during evening rush hour. There are only a few routes for remote access. I've written about all three routes in this article in my ledger, but the only one left for him was to set up a transit station himself.

FRP does just one thing: rent a machine with a public IP to transmit messages for you

The principle is very simple. You can rent a cloud server for a few dozen yuan, which has a fixed public IP address—something your home broadband can't provide. On the server, a program called frps runs (server), and on the home NAS, a program called frpc (client). FRPC actively connects to FRPS—pay attention to this direction, as the home connects externally. Jiakuan can connect freely when leaving the station, no one can stop it, so the optical modem doesn't need to change a single character, and the router port forwarding one port doesn't need to be installed.

Once connected, people outside access the "server IP:18088," data drills through the server tunnel, and then out from your NAS's port 5000. For NAS, FRPC is like a messenger sending outward signals; all traffic goes through this ready-made channel, so there's no such thing as whether the punching is successful or not—the FRP doesn't punch holes at all, just relays throughout, so it's stable. The cost is clear: the ceiling for speed is the server's bandwidth, which will be explained later.

Compared to the manufacturer's official relay, FRP wins in three words: not picky. The official relay only follows its own app's protocol, so if you use Synology's QuickConnect, you can only do what Synology allows you to do; FRP forwards to bare TCP ports, NAS backend, SMB, monitoring RTSP, Remote Desktop 3389—whatever you want to transfer, one server handles it all.

Before paying, three accounts are laid out

Money: Lightweight application server with 2 cores and 2GB, new users flash sale price of 38 yuan per year, both Alibaba Cloud and Tencent Cloud offer this tier; If you missed the promotion, existing users can renew at the same price for around 100 yuan. There's a pitfall I mentioned last time, so I'll repeat it again: the first-year price is usually limited to one purchase for new users, and in the second year, renewals can get you up to 200-300 yuan. Check the renewal price before deciding. FRP only gets a few gigabytes of traffic per week, so even the lowest specs are more than enough. Don't buy a big machine just to run FRP.

Speed Account: This is the easiest point to be fooled by tutorials. The speed limit for relay is the outbound bandwidth of your server. 3M bandwidth is about 375KB per second, and 4M is about 500KB per second—on the same level as the official free relay. No one should laugh at each other. Its real advantage is exclusivity: public relays have tens of millions lining up, and you get discounts during peak hours; Your server only runs your own data, always at this rate, with stable latency because you can choose your own data center location—pick one close to you. If you want to be fast, there's a way—pay extra for a high-bandwidth or peak-based billing model—that's another matter. My cousin's requirements were actually very simple: a stable, internet-friendly connection that could connect him home from the office, 500KB per second, enough to drag documents and photos—enough.

Secure account: This server will now scan your NAS across the entire internet. There are three key gatekeeping tasks that must not be skipped—set a long token list, use all remote ports in high positions, and prevent the NAS management page from being exposed with HTTP bare on the NAS management page. I'll explain exactly how to do it in the last section.

Server-side frps: Download, write a file, and get it running

frp is open-sourced on GitHub. The releases page is selected by server architecture. On x86 machines, you just download linux_amd64 package, extract two executable files and two sample configurations, but there's no mention of installation. I'll post the full text of the configuration files, that's all

there is to it:

bindPort = 7000
auth.token = "Change to your own long password, up to sixteen"
webServer.port = 7500
webServer.user = "admin"
webServer.password = "Also replaced"

bindPort is the port used by frpc to connect to, with 7000 as the default value; auth.token is a cipher at both ends—the longer the better; the three lines on webServer open the management panel. Clicking "Server IP: 7500" in your browser lets you see real-time traffic for each tunnel. Here's a detail I've tested: the panel only monitors 127.0.0.1 by default. To open it remotely, you need to add another line to webServer.addr = "0.0.0.0". When running, just nohup ./frps -c frps.toml &, and for the more sophisticated type, write a systemd service that starts automatically after booting. The last step is most easily missed: the cloud vendor console's security group allows TCP for 7000 and the remote port you plan to use (like 18088). I got stuck for ten minutes during my first test, completely forgetting about it.

NAS side: a Docker container matter

My cousin's Synology already had a Docker environment, concepts like images and containersThey had already disclosed everything before. NAS containerized deployment is much easier than manually working on servers. Search for snowdreamtech/frpc in Feiniu's application center or Synology's Container Manager—these are the most frequently updated frpc images in the community. First, create a directory on the NAS, for example /docker/frpc, and place a frpc.toml folder. The full text is as follows:

serverAddr = "Your server's public IP" serverPort
= 7000
auth.token = "Exactly the same string as the server" [
[proxies]]]
name = "nas-web"
type = "tcp"
localIP = "127.0.0.1"
localPort = 5000
remotePort = 18088

The

top three lines are for connecting to the server, and the middle layer [[proxies]] is a tunnel: name random, type is tcp, localPort 5000 is the Synology backend port (Feiniu is 5666), remotePort 18088 is the port you need to tap into on the external network. If a NAS wants to transfer multiple services, just copy the entire [[proxies]] section and continue writing. SMB 445 and monitoring 554 run like this. When creating a container, mount the configuration file, select always for the restart policy, then upgrade the container and rebuild according to the parameters. If Feiniu users find the graphical interface directory troublesome, SSH and just two lines of command will solve it.

If it doesn't work, check the log: the pitfall I hit on my local machine

When configuring for my cousin, I was cautious: I hadn't bought a server yet, so I ran both configuration files on my own computer—frps listener 7000, then set up a web service on the local machine to pretend as NAS, and frpc connected with the configuration. The first trip went badly, I copied the last two tokens from the wrong place, and the log immediately got embarrassed:

[E] token in login doesn't match token from configuration
login to the server failed: ... With loginFailExit enabled, no additional retries will be attempted

Translated, it means the code doesn't match, and frpc defaults to a single failure and exits immediately, without even retrying. Change the token and run again, and the log changes to another face: login to server success, followed by a line of [nas-web] start proxy success, and the tunnel is open. The browser goes through the 18088 portal, and the page impersonating the NAS appears as is; I dragged in another 2.7MB file, and in the management panel, todayTrafficOut jumped to 2702182 bytes, with no deviation of a single byte.

This step may seem redundant, but it's actually the most time-saving habit. When it comes to the production environment, on one end is an unfamiliar server, on the other is the NAS at home, separated by an entire internet. If you report an error, you don't even know which side to suspect; If the local machine runs first, it's like verifying the authenticity of both configuration files. When problems arise, there are only two possibilities—the security team didn't allow it, or the IP was copied incorrectly. Another thing that the local experiment couldn't measure was: speed. Running FRP on localhost is so fast it's not worth considering; actual speed depends on server bandwidth. Don't forget that previous point.

After the above, three important matters are set aside

First, tokens and ports. Tokens start at 16 bits, and all remotePorts at both ends use high-level ports above 10,000. Don't use 80 or 8080 numbers from the first page of the scanner dictionary. Second, don't let your NAS run naked in the background. If frp exports plaintext HTTP, it's like pasting your NAS's login page onto the public internet, getting scanned and stuffed is common, or you can add HTTPS to the backend. encryption is unavoidable; A more refined approach is to convert the frp into just one VPN port, connect to the VPN and then access the NAS, adding another layer of doors. Third, don't run other services on that server. It's now your housekeeper's guard, and the less clutter there is in the security room, the better.

: . You all good enough for occasionally remote status it. daily
My suggestion for your situation
Telecom broadband, get public IPDDNS plus port forwarding, zero cost, don't make a fuss
and your usual places have IPv6direct connection, no cost at
CGNAT ischecks and vendor free relays. Just endure
CGNAT often accesses networks without V6FRP self-built, costs a few dozen yuan a year for stable
use, and if you need to switch to SMB and monitor multiple services FRP, it's best suited. One server covers everything

The final configuration for my cousin was just one tunnel to the backend and one to SMB. In the evening, he tested it at the office, and it was still around 500KB per second—the bandwidth was only 3M, the numbers didn't change, but the line didn't drop even once all afternoon, and peak hours weren't discounted. What he said was: the speed hasn't increased, but the heart is calm. If you ask me, this is the meaning of FRP: it's not about speed, but about making the final decisions for yourself. Here's the step: first, check the local machine for the run-test configuration, buy the server and run FRPS, release the security group, put the NAS container at the end. If any problem occurs at the next step, go back and check the logs from that section.

Read More


Copyright Notice Scan to read on mobile
All Rights Reserved: 《SHUNOT》 => 《No public IP, FRP intranet penetration connects to the home NAS, with over thirty servers being relayed》
Article URL: https://www.shunot.com/en/nas/1281.html
Unless otherwise stated, all articles are original by 《SHUNOT》. Reposting is welcome! Please indicate the original URL when reposting, thank you.

Contact Us

Online Consultation: Click here to send me a message

WeChat ID: master_135

Scan to follow