banner
繁星

繁星

你已经那么聪明,别在乎公不公平。

Connect to Server via Intranet Penetration

Intranet Penetration#

RFC1918 defines three private address ranges for intranet segments:

  1. 10.0.0.0 to 10.255.255.255
  2. 172.16.0.0 to 172.31.255.255
  3. 192.168.0.0 to 192.168.255.255

Use ifconfig to query the local IP address.

image

The IP address 120.200.14.71 belongs to the intranet. To allow external access, you need to use intranet penetration.

Method 1: Using cpolar for intranet penetration#

Here, only the connection method is provided. You can search the internet for specific deployment methods.

Visit the website: https://dashboard.cpolar.com/get-started

Enter your account credentials to log in.

Click on the left side for status.

image

In the image below, the text after tcp:// and before : is our remote host.
The text after : is our port.

image

Open an SSH software and enter the corresponding host and port to connect and log in.

Since the account is using a free package, the host and port are dynamic and will be refreshed periodically. If you can't connect, log in to your account again and copy the new ones.

Method 2: Using cloud servers for intranet penetration#

The bandwidth provided by the cpolar free package is low, so it takes a long time to transmit large data and files. Therefore, we can use cloud servers to establish P2P connections.

The configuration of the server-side and client-side is not detailed here.

Connection method#
  • Click the link to download frp Click to download

  • Edit the frpc.toml file in the folder and fill in the server's public IP address after serverAddr.

  • Type cmd in the folder address bar.
    image

  • Enter the command frpc -c frpc.toml

  • Successful connection
    image

  • Use SSH client to enter 127.0.0.1:7000 to connect and log in.
    image

Local VSCode SSH Connection for Remote Development#

In addition to using MobaXterm to connect via SSH, you can also directly use programming software (VSCode, PyCharm) to connect via SSH for development. This avoids the impact of multiple users logging in with the same account and prevents development difficulties caused by server lag.

Here, we take VSCode as an example.

Open the VSCode software and click on Extensions.
image

Search for Remote-SSH and install it.
image

After installation, restart the client.

Once you enter again, press Ctrl+Shift+P to open the command palette, type Remote-SSH, and select Connect to Host.
image

Then, in the new window, type user@host (the host obtained earlier), press Enter to confirm the connection, and enter the password again. You will be successfully connected.
image

Now, you can enjoy the process of looking at code and daydreaming.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.