This is the setup: I have 1 debian server deep within the network running a mysql server. I have a second debian server who is exclusively allowed to access the mysql server of the first server. I have a windows machine that talks over a openvpn connection with the second server and has full control over that server.
What i want to do is to be able to connect to mysql from my windows machine. I established an SSH tunnel from the second server to the mysql server running on the first server with:
ssh -L 7777:127.0.0.1:3306 email@example.com -N
This allows me to connect on the second server with mysql using the following lines:
mysql --host=127.0.0.1 --port=7777 --protocol=TCP -u username -p mysql --host=localhost --port=7777 --protocol=TCP -u username -p
but not with
mysql --host=10.168.32.11 --port=7777 --protocol=TCP -u username -p <-- local ip mysql --host=172.28.28.1--port=7777 --protocol=TCP -u username -p <-- openvpn tun ip (also used when connecting from my windows machine)
This has probably something to do with network traffic not being routed from the openvpn interface to the local loopback interface. My networking knowledge is limited at best, perhaps someone here can point me in the right direction.