2023 The frp Authors 保留所有权利
中文|English
Frp provides a new type of Agent
xtcp
Used to achieve internal network penetration
when a large amount of data needs to be transmitted and
traffic is not desired to pass through the server.
Similar tostcp
, Use
xtcp
FRPC needs to be deployed on both ends to
establish a direct connection.
It should be noted thatxtcp
is not applicable to
all types of NAT If the penetration fails, you can try
usingstcp
Agent.
Configuration needs to be exposed to frpc.toml on machines outside the network File
In frpc.toml Add the following content to the file to
ensure that the correct server address, port, and shared
key are set up (secretKey
), as well as the IP
address and port of the local service:
serverAddr = "x.x.x.x"
serverPort = 7000
# If the default STUN server is not available, you can Configuration a new STUN server
# natHoleStunServer = "xxx"
[[proxies]]
name = "p2p_ssh"
type = "xtcp"
# Only users whose shared key (secretKey) is consistent with the server can access the service.
secretKey = "abcdefg"
localIP = "127.0.0.1"
localPort = 22
Deploy frpc on machines that want to access internal network services
In frpc.toml Add the following content to the file to
ensure that the correct server address and port are set
and the shared key is shared (secretKey
) and
the name of the P2P Agent to be accessed:
serverAddr = "x.x.x.x"
serverPort = 7000
# If the default STUN server is not available, you can configure a new STUN server
# natHoleStunServer = "xxx"
[[visitors]]
name = "p2p_ssh_visitor"
type = "xtcp"
# Name of the P2P Agent to be accessed
serverName = "p2p_ssh"
secretKey = "abcdefg"
# Bind a local port to access the SSH service
bindAddr = "127.0.0.1"
bindPort = 6000
# If you need to keep the tunnel open automatically, set it to true
# keepTunnelOpen = false
Access the private network machine through SSH
The Use SSH command accesses the private network machine,
assuming that the user name is
test
:
ssh -oPort=6000 test@127.0.0.1