How to access a VPN client directly from VPN server via IP address
0
votes
0
answers
226
views
I am running a **MariaDB server and an OpenVPN server** (SoftEther in this case) on an **Ubuntu 20.04 LTS** machine.
On my **Raspberry Pi**, I am running a **MariaDB** server aswell.
My goal is to enable a **Master-Slave-Replication of the MariaDB**, whereby the **Raspi acts as master** and the **Ubuntu server as slave** *(as described in this well-done article https://www.linuxbabe.com/mariadb/master-slave-replication-ubuntu-18-04-18-10).*
Therefore, I need the Raspi to have a **static or at least known IP address** so that the slave DB-server knows where to get the data from (IP address needs to be hardcoded in config file). The tricky part is that due to the desired application of the Raspi it will be plugged in into multiple networks from time to time so that a "normal" procedure with DynDNS at a single router etc. will obviously not work sufficiently.
Hence, my idea is to configure the **Raspi as a VPN client**, which automatically connects to the VPN server (which runs on the same machine as the MariaDB-slave) on startup. This way I can read the IP address of the Raspi in the VPN from the server log and use it for the SQL replication config.
**Connecting the Raspi as client to the VPN server works sufficiently, *BUT* if I try to connect the MariaDB slave (server) to the MariaDB master (Raspi) by using the Raspi's IP address in the VPN (adapter tun0), the slave cannot reach the master.**
How is that possible, given that the Raspi is successfully connected to the VPN server **running on the same machine** as the MariaDB slave server?
Is there a **need to "connect"** the MariaDB application (on the server) into the same VPN as the MariaDB master (Raspi)?
Every help is greatly appreciated.
Asked by cmoe
Mar 31, 2022, 04:18 PM
Last activity: Mar 31, 2022, 07:37 PM
Last activity: Mar 31, 2022, 07:37 PM