Solved

Setting up Red hat linux VPN

Posted on 2013-11-01
5
546 Views
Last Modified: 2013-12-05
I am trying to setup a red hat Linux server to connect to a windows server running sql server; I want to establish a vpn so DBAs can remotely connect to the windows machine.

Can you help me determine the right VPN client to use and also provide me with the right configuration steps and correct commands to use to set this up.

Thanks,
0
Comment
Question by:redkasote
  • 2
  • 2
5 Comments
 
LVL 34

Expert Comment

by:Seth Simmons
ID: 39618211
what are you trying to connect to?  do you have rras setup somewhere or do you have some other software/appliance?
0
 

Author Comment

by:redkasote
ID: 39618228
I don't have any software setup or rras. I attempted to intall pptp as a VPN client but wasn't successfull. I am trying to connect to a windows server from a red hat box.
0
 
LVL 13

Expert Comment

by:Daniel Helgenberger
ID: 39618651
Please note, you do not necessarily need a VPN for your setup but can do the same thing maybe better and much easier with ssh port redirection:
1. the client connects to the ssh server
2. the client opens a random port on its own loopback terminated on the servers SQL port
3. access to the loopback port is forwarded through the ssh tunnel to the server's SQL port.
4. the SQL client accesses the the SQL server via its own loopback interface

If you cannot achieve this, for instance because you have no terminated/direct connection to the windows server from your redhat client, I would recommend OpenVPN. This is quite easy to setup and very secure. Binaries are readily available for both OS's.
0
 

Author Comment

by:redkasote
ID: 39618675
I am able to ping the sql server from the red hat machine, is that a direct connection? I started to setup openVPN but there aren't any properly put together steps online. I wasn't sure if I had to setup the openVPN server steps as well or just skip to the client. The steps I was referring to went through server configuration and then client setup.

Are you able to give me the steps to setup both solutions or direct me to where I can see good instructions.  Thanks.
0
 
LVL 13

Accepted Solution

by:
Daniel Helgenberger earned 500 total points
ID: 39619885
Please have a look at this tutorial, to setup OpenSSH on windows:
http://comptb.cects.com/1264-install-configure-ssh-on-windows

If this is configured and setup correctly, then initialize an SSH port forward on your linux client like this example (please change it to your needs):
ssh -N -L31433:localhost:1433 user@winserver &
# Lets test this:
telnet localhost:31433

Open in new window

Explanation:
This assumes, you have a valid user named 'user' on your windows server named 'winserver' and MS SQL running on tcp/1433 on 'winserver'. Please change these settings to your needs.

The port I used, 31433, is random, you can use any other port you like. High port numbers are used commonly (since they require no su rights and do not interfere with other services).

Then, change your connection settings in your Linux application to access the SQL server via localhost:31433
Further, I use -N, this prohibits remote command execution, and & to run this process in the background. The telnet command is just a quick test if the tunnel is up. You should not get a timeout, though any other error is fine in this case.

Note, if this works, you can easily setup xinetd to establish the connection on demand or use a custom service to have it always open. Also, use ssh-keys so services can connect to your windows SSH server, as covered in the HowTo. Also, as a security precaution, you should setup a port forward/guest only user with no remote command execution permissions on your windows server.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now