Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 koen@10.168.12.28 -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.

Thanks!

Koen

share|improve this question
    
@IgnacioVazquez-Abrams - Sure but what i can't figure out is how to open up this tunnel for the other 2 interfaces, especially 172.28.28.1. I want to be able to connect from the outside –  Polity Mar 8 '12 at 6:52

1 Answer 1

up vote 1 down vote accepted

You're missing part of an argument.

ssh -L '*':7777:127.0.0.1:3306 ...

share|improve this answer
    
Thanks, that was the problem –  Polity Mar 8 '12 at 6:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.