Re: Iptables routing via SSH tunnel
Vipul Agarwal <[email protected]>
| Newsgroups | gmane.user-groups.linux.london.gllug |
|---|---|
| Message-ID | <CADK2VQwN7z3QgaqW9eAiyeGpPhKFvhZgJfVtumdUU0EZ9SMcZw@mail.gmail.com> |
Hi guys, thanks for the replies. Alain, I took your advise and worked like a charm. Thanks a lot! :) Cheers, Vip On Wed, Apr 18, 2012 at 12:19 PM, Alain Williams <[email protected]> wrote: > On Wed, Apr 18, 2012 at 01:19:25AM +0100, Vipul Agarwal wrote: > > Hi guys, > > > > I have two linux servers with root access and an external database server > > which is managed by someone else. > > Initially, only one of my server can access this external database server > > while the other can't due to IP restriction. > > > > I want to enable access to this external database server to my other > linux > > server temporarily as it'll take few days to get the IP added to the > > firewall. > > I think this can be done using a SSH tunnel. Please help me writing the > > correct iptables rules to route all the traffic to a specific IP/port via > > the SSH tunnel. > > If this is for a couple of days you may be able to do it via ssh. > Reconfigure the database client to connect to localhost. If the server > that you > are connecting to is mysql it will listen on port 3306. > > On the client machine run: > > ssh -L 3306:0:3306 database_server_machine > > ssh will carry (forward/tunnel) requests on the client machine port 3306 > to port > 3306 on the server. > > A hack - but might be easier for a couple of days. > > -- > Alain Williams > Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT > Lecturer. > +44 (0) 787 668 0256 http://www.phcomp.co.uk/ > Parliament Hill Computers Ltd. Registration Information: > http://www.phcomp.co.uk/contact.php > #include <std_disclaimer.h> > -- > Gllug mailing list - [email protected] > http://lists.gllug.org.uk/mailman/listinfo/gllug > -- Thanks and Regards, Vipul Agarwal -- Gllug mailing list - [email protected] http://lists.gllug.org.uk/mailman/listinfo/gllug