Hi guys, thanks for the replies.<br><br>Alain, I took your advise and worked like a charm. Thanks a lot! :)<br><br>Cheers,<br>Vip<br><br><div class="gmail_quote">On Wed, Apr 18, 2012 at 12:19 PM, Alain Williams <span dir="ltr"><<a href="mailto:addw@phcomp.co.uk">addw@phcomp.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, Apr 18, 2012 at 01:19:25AM +0100, Vipul Agarwal wrote:<br>
> Hi guys,<br>
><br>
> I have two linux servers with root access and an external database server<br>
> which is managed by someone else.<br>
> Initially, only one of my server can access this external database server<br>
> while the other can't due to IP restriction.<br>
><br>
> I want to enable access to this external database server to my other linux<br>
> server temporarily as it'll take few days to get the IP added to the<br>
> firewall.<br>
> I think this can be done using a SSH tunnel. Please help me writing the<br>
> correct iptables rules to route all the traffic to a specific IP/port via<br>
> the SSH tunnel.<br>
<br>
</div></div>If this is for a couple of days you may be able to do it via ssh.<br>
Reconfigure the database client to connect to localhost. If the server that you<br>
are connecting to is mysql it will listen on port 3306.<br>
<br>
On the client machine run:<br>
<br>
ssh -L 3306:0:3306 database_server_machine<br>
<br>
ssh will carry (forward/tunnel) requests on the client machine port 3306 to port<br>
3306 on the server.<br>
<br>
A hack - but might be easier for a couple of days.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Alain Williams<br>
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.<br>
<a href="tel:%2B44%20%280%29%20787%20668%200256" value="+447876680256">+44 (0) 787 668 0256</a> <a href="http://www.phcomp.co.uk/" target="_blank">http://www.phcomp.co.uk/</a><br>
Parliament Hill Computers Ltd. Registration Information: <a href="http://www.phcomp.co.uk/contact.php" target="_blank">http://www.phcomp.co.uk/contact.php</a><br>
#include <std_disclaimer.h><br>
</font></span><div class="HOEnZb"><div class="h5">--<br>
Gllug mailing list - <a href="mailto:Gllug@gllug.org.uk">Gllug@gllug.org.uk</a><br>
<a href="http://lists.gllug.org.uk/mailman/listinfo/gllug" target="_blank">http://lists.gllug.org.uk/mailman/listinfo/gllug</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Thanks and Regards,<br>Vipul Agarwal<br>