Setting port forwarding to client (dynamic ip)

Business solution to host your own OpenVPN server with web management interface and bundled clients.
Post Reply
agente
OpenVpn Newbie
Posts: 4
Joined: Mon Sep 26, 2022 9:33 pm

Setting port forwarding to client (dynamic ip)

Post by agente » Mon Sep 26, 2022 9:39 pm

I installed OpenVPN on a remote vps. I need to port forward one port to a client (in a different network) with dynamic ip. This is a service that I use with commercial VPN services but I cannot undersatand how to do with openvpn.

Thanks

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1332
Joined: Tue Feb 16, 2021 10:41 am

Re: Setting port forwarding to client (dynamic ip)

Post by openvpn_inc » Tue Sep 27, 2022 8:25 am

Hello agente,

See this documentation item:
https://openvpn.net/vpn-server-resource ... ss-server/

This assumes you're using OpenVPN Access Server. With Access Server it's easy to do this.

Kind regards,
Johan
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

agente
OpenVpn Newbie
Posts: 4
Joined: Mon Sep 26, 2022 9:33 pm

Re: Setting port forwarding to client (dynamic ip)

Post by agente » Tue Sep 27, 2022 11:02 am

I can add DMZ with a specific IP but my client have dynamic ip and connect with a specific user of course. I just need that every request on one specific port will forward to that user profile (without knowing the ip).
My client connect from remote network.

agente
OpenVpn Newbie
Posts: 4
Joined: Mon Sep 26, 2022 9:33 pm

Re: Setting port forwarding to client (dynamic ip)

Post by agente » Tue Sep 27, 2022 11:58 am

UPDATE: I configured static ip for a client following this steps:

Static IP Address Network (Optional): Added 10.0.10.0/24
Routing: Yes, using Routing and added line 10.0.10.0/24
User permission: Ip addressing use static and set 10.0.10.5
DMZ: setting YES added two lines 10.0.10.5:tcp/myneededport 10.0.10.5:udp/myneededport

Saved.

I connected with my client but "myneededport" still close. I missed something?

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1332
Joined: Tue Feb 16, 2021 10:41 am

Re: Setting port forwarding to client (dynamic ip)

Post by openvpn_inc » Tue Sep 27, 2022 12:19 pm

Hello agente,

It is not necessary for the VPN client to have a static IP, either on the Internet or on the VPN. It is irrelevant. Access Server will know where to send the request to once the VPN client is connected. The documentation also mentions the following: "A DMZ IP address works with a VPN client that uses either a static or dynamic VPN IP address".

The documentation also shows in the example that you have to specify the public IP of the Access Server for the DMZ rule, not the private IP of the VPN client. Once you've corrected this mistake it should work. If it then still doesn't work for you, you may need to look into firewalls on the server side and on the VPN client side, and on the VPN client side you need to also ensure that the service you're offering is actually listening on the VPN interface.

Kind regards,
Johan
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

agente
OpenVpn Newbie
Posts: 4
Joined: Mon Sep 26, 2022 9:33 pm

Re: Setting port forwarding to client (dynamic ip)

Post by agente » Tue Sep 27, 2022 8:23 pm

my fault. everything working now.. thanks!

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1332
Joined: Tue Feb 16, 2021 10:41 am

Re: Setting port forwarding to client (dynamic ip)

Post by openvpn_inc » Wed Sep 28, 2022 5:31 pm

Hello agente,

Glad to hear it.

Have a nice day,
Johan
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

Post Reply