[GH-ISSUE #3851] Running OpenVPN Server behind NAT using frp #3058

Closed
opened 2026-05-05 13:58:45 -06:00 by gitea-mirror · 8 comments
Owner

Originally created by @thinkpeach-ho on GitHub (Dec 15, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3851

Bug Description

I am currently accessing the internal OpenVPN server through the port using frp.
But while checking the related logs of OpenVPN server . I found that the client addresses of these logs were internal IP addresses, not client‘s public IP addresses.
I tried to using HAproxy between frp to OpenVPN , But it make me can't access OpenVPN via frp .
How should I do if I want to show the client's public IP address in the log?

frpc Version

0.52.3

frps Version

0.52.3

System Architecture

CentOS Stream release 8

Configurations

frpc.ini
[common]
server_addr = 192.168.101.15
server_port = 7000
token = NyFut8qo

[openvpn]
type = tcp
remote_port = 41194
local_port = 41194
local_ip = 192.168.100.10

frps.ini
[common]
bind_port = 7000
token = NyFut8qo
enable_prometheus = true

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @thinkpeach-ho on GitHub (Dec 15, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3851 ### Bug Description I am currently accessing the internal OpenVPN server through the port using frp. But while checking the related logs of OpenVPN server . I found that the client addresses of these logs were internal IP addresses, not client‘s public IP addresses. I tried to using HAproxy between frp to OpenVPN , But it make me can't access OpenVPN via frp . How should I do if I want to show the client's public IP address in the log? ### frpc Version 0.52.3 ### frps Version 0.52.3 ### System Architecture CentOS Stream release 8 ### Configurations frpc.ini [common] server_addr = 192.168.101.15 server_port = 7000 token = NyFut8qo [openvpn] type = tcp remote_port = 41194 local_port = 41194 local_ip = 192.168.100.10 frps.ini [common] bind_port = 7000 token = NyFut8qo enable_prometheus = true ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [X] Others
gitea-mirror 2026-05-05 13:58:46 -06:00
Author
Owner
<!-- gh-comment-id:1858449664 --> @xqzr commented on GitHub (Dec 15, 2023): https://gofrp.org/zh-cn/docs/features/common/realip/#proxy-protocol
Author
Owner

@thinkpeach-ho commented on GitHub (Dec 16, 2023):

I tried it , but not work

<!-- gh-comment-id:1858730306 --> @thinkpeach-ho commented on GitHub (Dec 16, 2023): I tried it , but not work
Author
Owner

@eebssk1 commented on GitHub (Dec 22, 2023):

I tried it , but not work

That's means OpenVPN do not support that method. You should raise the issue to OpenVPN.
But I remember there IS a tool that works and uses linux tricks to turn internal IP to real IP,But I can not remember the name.

<!-- gh-comment-id:1867573464 --> @eebssk1 commented on GitHub (Dec 22, 2023): > I tried it , but not work That's means OpenVPN do not support that method. You should raise the issue to OpenVPN. But I remember there IS a tool that works and uses linux tricks to turn internal IP to real IP,But I can not remember the name.
Author
Owner

@freecode505 commented on GitHub (Jan 2, 2024):

Hello, I also tried to link this tunnel with ovpn but it was not possible.

@thinkpeach-ho
@eebssk1
@fatedier

try
serverAddr="216.189.154.18"
serverPort = 80

proxies
name = "ovpn"
type = "tcp"
localIP="127.0.0.1"
localPort = 4545
remotePort = 2323

my configuration in ovpn is

remote 127.0.0.1 2323

route 216.189.154.18 255.255.255.255 net_gateway

I also tried using http as a listener with socks5 and http in ovpn so that the tunnel connection was achieved and the connection was not made either.

socks-proxy 127.0.0.1 6004
route 216.189.154.18 255.255.255.255 net_gateway

socks-proxy 127.0.0.1 6003
route 216.189.154.18 255.255.255.255 net_gateway

I would like this tool to be compatible with ovpn

<!-- gh-comment-id:1874514617 --> @freecode505 commented on GitHub (Jan 2, 2024): Hello, I also tried to link this tunnel with ovpn but it was not possible. @thinkpeach-ho @eebssk1 @fatedier try serverAddr="216.189.154.18" serverPort = 80 [[proxies]] name = "ovpn" type = "tcp" localIP="127.0.0.1" localPort = 4545 remotePort = 2323 my configuration in ovpn is remote 127.0.0.1 2323 route 216.189.154.18 255.255.255.255 net_gateway I also tried using http as a listener with socks5 and http in ovpn so that the tunnel connection was achieved and the connection was not made either. socks-proxy 127.0.0.1 6004 route 216.189.154.18 255.255.255.255 net_gateway socks-proxy 127.0.0.1 6003 route 216.189.154.18 255.255.255.255 net_gateway I would like this tool to be compatible with ovpn
Author
Owner

@eebssk1 commented on GitHub (Jan 3, 2024):

Hello, I also tried to link this tunnel with ovpn but it was not possible.

@thinkpeach-ho
@eebssk1
@fatedier

try
serverAddr="216.189.154.18"
serverPort = 80

proxies
name = "ovpn"
type = "tcp"
localIP="127.0.0.1"
localPort = 4545
remotePort = 2323

my configuration in ovpn is

remote 127.0.0.1 2323

route 216.189.154.18 255.255.255.255 net_gateway

I also tried using http as a listener with socks5 and http in ovpn so that the tunnel connection was achieved and the connection was not made either.

socks-proxy 127.0.0.1 6004
route 216.189.154.18 255.255.255.255 net_gateway

socks-proxy 127.0.0.1 6003
route 216.189.154.18 255.255.255.255 net_gateway

I would like this tool to be compatible with ovpn

OpenVPN uses UDP by default。

<!-- gh-comment-id:1874721250 --> @eebssk1 commented on GitHub (Jan 3, 2024): > Hello, I also tried to link this tunnel with ovpn but it was not possible. > > @thinkpeach-ho > @eebssk1 > @fatedier > > > try > serverAddr="216.189.154.18" > serverPort = 80 > > [[proxies]] > name = "ovpn" > type = "tcp" > localIP="127.0.0.1" > localPort = 4545 > remotePort = 2323 > > > my configuration in ovpn is > > remote 127.0.0.1 2323 > > route 216.189.154.18 255.255.255.255 net_gateway > > > I also tried using http as a listener with socks5 and http in ovpn so that the tunnel connection was achieved and the connection was not made either. > > socks-proxy 127.0.0.1 6004 > route 216.189.154.18 255.255.255.255 net_gateway > > > socks-proxy 127.0.0.1 6003 > route 216.189.154.18 255.255.255.255 net_gateway > > > I would like this tool to be compatible with ovpn > > > OpenVPN uses UDP by default。
Author
Owner

@freecode505 commented on GitHub (Jan 3, 2024):

@eebssk1 frpc and frps how should the configuration be?

And what port to use in the ovpn UDP client to make a connection, I tried it and still couldn't make a connection.

<!-- gh-comment-id:1875597851 --> @freecode505 commented on GitHub (Jan 3, 2024): @eebssk1 frpc and frps how should the configuration be? And what port to use in the ovpn UDP client to make a connection, I tried it and still couldn't make a connection.
Author
Owner

@freecode505 commented on GitHub (Jan 5, 2024):

??

<!-- gh-comment-id:1878682390 --> @freecode505 commented on GitHub (Jan 5, 2024): ??
Author
Owner

@github-actions[bot] commented on GitHub (Jan 27, 2024):

Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1912870178 --> @github-actions[bot] commented on GitHub (Jan 27, 2024): Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#3058
No description provided.