Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to FTP via VPN

A client has a web server that can only be accessed when on their network.

For example sake, let's say my login details are:

Server: example.com User: user password: password

for when I am on their company's internet. I use either Cyberduck or FileZilla to connect to their web server.

I'd much rather be able to connect remotely but I just have a lot of trouble setting this up. I have connected to the client's vpn, let's say vpn.example.com, and use Cisco AnyConnect to accomplish this.

Beyond this, my knowledge of VPN is limited. In an FTP client, is there anything I should be doing to ensure that it uses the VPN to connect to example.com rather than my home connection?

Thanks.

-m

like image 786
user1319580 Avatar asked Apr 10 '12 00:04

user1319580


People also ask

Can you use FTP with VPN?

File Transfer Protocol (FTP) is a standard network protocol used to transfer files from one server to another server. FTP is built on a client-server architecture and utilises separate control and data connections between the client and server. Virtual Private Network (VPN) is mandatory together with FTP.

How do I connect to an FTP server using an IP address?

You need to open your Internet browser and start typing the FTP Server's Hostname (or IP Address) and the FTP port number (in case the FTP Server is utilizing a separate port than the actual default port "21" for the FTP connections) in the address box and press Enter.

Does FileZilla work with VPN?

FileZilla supports SFTP, secure file transfer protocol, which you musts use to transfer files into the Engineering network. You can also use the Connect2 VPN to securely transfer files; Connect2 includes the ability to connect to your home directory, file shares, run Remote Desktop, and more.


2 Answers

There two ways around this. I am assuming you are using Windows or a Mac since the AnyConnect client doesn't come in a Linux flavor.

Open a CMD/Terminal and type "route print" or "netstat -r" take note of where example.com is pointing to. Most likely the default route will catch it. In that case you want to add a route to have it go via the VPN interface for any traffic that goes to example.com (After doing this, once you disconnect from the VPN you will not be able to connect to example.com any more unless you connect to the VPN.)

The other way is to connect to the FTP using the local IP of the FTP once connected to the VPN.

like image 163
George Avatar answered Oct 05 '22 11:10

George


As there is no Linux solution I will post my solution. I don't know much about the other side (vpn server side), so this solution might not fit your environment. I'm using vpnc (installable via package manager on Ubuntu, other systems might work too). You can configure it with a .conf file, my values are

IPSec gateway <server address>
IPSec ID <gateway id>
IPSec secret <kind of group password>
Xauth username <your username>
Xauth password <you password>
like image 43
DBX12 Avatar answered Oct 05 '22 12:10

DBX12