Forward PiVPN Client requests to localhost

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
PiOSFan
Posts: 12
Joined: Mon Dec 05, 2016 8:36 am

Forward PiVPN Client requests to localhost

Post by PiOSFan »

Hi,
I set up DietPi on a Raspi 3 running LAMP with MariaDB (hostname: RaspiDB, IP: 192.168.172.30).
I have 3 clients connecting to the database over the internet.
To protect the transferred data, I set up a PiVPN and connect the clients via OpenVPN.
The Clients can surf the internet, but can not access the MariaDB running on the same Raspi.
How can I forward incoming requests from the clients (IP: 10.8.0.x) to the MariaDB or just to 192.168.172.30 or 127.0.0.1? I don't want to make all clients in the LAN available, just this one.

As I also access the MariaDB regularly from the local LAN, I would like to use the IP or the hostname of the Raspi also when connected via VPN.
I read some forums that I have to set up iptables, but as I am new to this and I don't want to create open doors, due to my lack of experience, I would be happy if someone could help me with this or provide an tutorial "iptables guide for dummies". Thank you very much!

The PiVPN is currently a workaround until I solved my issue viewtopic.php?f=11&t=5233&p=15368#p15371 setting up SSL on MariaDB with YaSSL.

Thanks!
Post Reply