January 2018

On the XX th of XX month, I started to use raspberry pie 3b and a treasure 300. The list is as follows:

  • Board 199
  • Power 35 (in fact, I have a 5v2a charger and power bank)
  • Spicy chicken wireless keyboard 30
  • Acrylic shell 15
  • About 10 pieces of fan plus hot plate

Very strange point, I bought the domestic board E14, sent to the United Kingdom rs

Of course, there is also a memory card. I have an 8g one, but I still went to goudong to buy the evo of sansang 64g. 130 is OK. Fans and keyboards that don't care about the appearance can be ignored. If you buy a 16g card, it will be done within 300

Come back to the point

Usually I have to go to work. Pai left at home and bought a pile of spicy chicken with 300 and put it at home. At this time, the intranet penetration is needed

As a user who used to use ngrok, ngrok is really spicy

Installation and configuration is quite troublesome. After configuration, there are various problems, such as connection failure, disconnection, XXX problem

Switch to use other people's ngrok free services (this is not advertising), there are also offline problems, poor user experience, give up!

However, after I started the pie, I still chose to watch ngrok. The server problem is OK to say, but there are many problems with the pie that can't be solved. There are too many points to complain about, so I jump to the frp up


The domestic conscience software (I just want to blow it) is simple to configure, easy to use, easy to deploy, and low resource consumption (I didn't collect money (╯━┻┻┻)

The most important thing is to have Chinese documents !!! Chinese!!! chinese!!! Medium!!!

0x0

Here I use the virtual machine. I'm in the company now and I'm at home. If I restart the FRP, I'll drop the line, and then there will be no subsequent operations_ ゝ` )

Virtual machine configuration (equivalent to raspberry pie here)

  • CentOS Linux release 7.4.1708 (Core)
  • Kernel version 3.10.0-693.11.6.el7.x86_ sixty-four
  • Architecture x86_ sixty-four
  • Memory 512M
  • CPU2 core

Server configuration
Goose factory HK $1 machine

  • CentOS Linux release 7.4.1708 (Core)
  • Kernel version 3.10.0-514.21.1.el7.x86_ sixty-four
  • Architecture x86_ sixty-four
  • Memory 1g
  • CPU1 core
  • Bandwidth 1m

In their release Page select the version you want to use

I'll use it here frp_ 0.15.1_ linux_ amd64.tar.gz If you want to use the 3B version of raspberry pie, there is a problem with the official arm package. My pie is archlinux system, The compiled client package is frpc-0.15.1-raspberrypi.zip. If you want to install archlinuxarm, you can see my article

This is the end of the preparatory work

Of course, you can not use these binary files to compile by yourself

0x1

Note: the following operations are performed under the root user. Other users should use the sudo command

 wget --no-check-certificate https://github.com/fatedier/frp/releases/download/v0.15.1/frp_ 0.15.1_ linux_ amd64.tar.gz

tar -xvf frp_ 0.15.1_ linux_ amd64.tar.gz

cd frp_ 0.15.1_ linux_ Amd64
ls - Al / / same as ll command

The extracted file should be the following sauce

 FRP decompression file list

client

Delete the following file

 rm frps frps_ full.ini frps.ini LICENSE

Client reserved files
 Client reserved files

Server

Delete the following file

 rm frpc frpc_ full.ini frpc.ini LICENSE

Server reserved files
 Server reserved files

      • -

reminder

frp x _ full.ini The configuration of is all officially allowed configuration items, frp x .ini For basic configuration( Recommended use Or you don't know where you've made a mistake.)

Where X represents the C of the client and s of the server

0x2

I use it here Basic configuration file

Server Need to open seven thousand Listen to the FRP service, six thousand Monitoring and forwarding client SSH service

The server open port is executed as follows

Pong friends using iptables

 iptables -A INPUT -p tcp --dport 7000 -j ACCEPT
iptables -A INPUT -p tcp --dport 6000 -j ACCEPT
service iptables save

Pong friends using firewalld

 firewall-cmd --zone=public --add-port=7000/tcp --permanent
firewall-cmd --zone=public --add-port=6000/tcp --permanent
firewall-cmd --reload

0x3

The foundation has been set up and FRP can be started

Server

Let's do the following to start running the FRPs server

 ./frps -c ./frps.ini

The operation status is shown in the figure below (if there is any security problem, it will be adjusted after the connection is OK)
 Turn on the FRPs server

client

We need to configure the server IP address to penetrate the Internet, so use the nano , vi , vim In the configuration file server_ addr

 [common]
server_ Addr = your server IP 
 server_ port = 7000

After modification, you can save it. Perform the following operation

 ./frpc -c ./frpc.ini

Look! After the ID is assigned, SSH has successfully proxy (·̀ω ·́) ✧
 Successfully connected

At this time, if you look back at the server console, there will be a success message

0x4

Now we can test whether we can successfully connect to the SSH of the virtual machine

It can be clearly seen that there are two users online at present pts/0 The user is executing our previous listening command
 Happy and nourishing

At this point, FRP has been running successfully

But

We can't have the terminal on all the time. Here I share my start stop script

The script doesn't work. Write one yourself...

0x?

It's been a long time since the last time I sent this kind of tutorial article. I also said that I wanted to send SSH password free login. The public key login on several servers was different. It was a little bit pit. The purpose of sending the article was to solve the problem. It was hot and sauce.

good night Love you