I want to connect to a remote AzureDB server (which has ip address ip2 and hostname "abc.database.windows.net" ) from my local computer(which has ip address ip1). However, my local host can't directly access to DB server, so I had to use SSH Tunnel via a jump server (which has ip3 and able to access to AzureDB server) for connecting. Here is what i was doing:
1, Create SSH Tunnel:
ssh -v -g -N -C -L local-port:**ip2**:1433 ssh-user@**ip3** -p 22
2, Connect to to DB server
sqlcmd -S 127.0.0.1,local-port -U db-user@**abc**.database.windows.net -P password -d db-name
But i got the error:
Cannot open server 'abc' requested by the login. Client with IP address 'ip1' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect.
I checked the tunnel connection with telnet and no error has been showed up. Can anyone tell me what's wrong with my work?