But there is a good reason VPN clients route all traffic through the VPN. Frequently, the target network has permissions to access stuff out on the web that your host network might not. For instance, universities and libraries often maintain IP-pool-based subscriptions to online digital libraries. So, sitting on the university network, you can access material on the ACM or IEEE website; at home, you cannot. Since all traffic goes through the VPN, when you have established a connection to the university, you can access those materials.
Of course, that slows down all of your Internet browsing, since all requests and replies must pass through the VPN. Futhermore, it means that all of your data is passing through the target network - something you may not want, for privacy reasons. Hence the routing-table fix mentioned above.
So here's a way to get around all that. It assumes you have an account on machine in the target network, that said machine is accessible from the Internet, and that said machine runs SSH and has curl installed. Similarly to using SSH to move things, you can use SSH to fetch Internet resources that from within the target network, sans VPN.
ssh -l name host "curl address" > local_filewill do the trick. "name" is your account name on the machine "host," and "address" is the URL of the resource you want to access from within the target network; "local_file" is the name of the file on your local machine in which the fetched resource will be saved.
Not only does this let you grab things as if you were within the target network avoiding the time-consuming VPN connect/disconnect, it does so without placing any temporary files on the remote machine "host." And, since curl prints its status information to STDERR, you get to see your download's progress, even as curl saves the file to your local disk.
No comments:
Post a Comment