2

I am trying to configure a server to automatically copy some files to a remote machine. In order to make the copy work, I need to establish a VPN connection to the remote network. I can use rasdial.exe to establish the connection.

To avoid interfering with anyone else using the server, I would like to specify that only certain traffic should flow through the VPN. Ideally, this would be traffic to specific IP addresses.

A similar question exists for Cisco VPN. The answers to this question make me suspect that this may only be possible with actual hardware rather than software.

Is it possible to set up my machine to send traffic through a VPN opened using rasdial.exe? If so, how can I accomplish it?

1 Answer 1

1

If you're looking to send traffic through an IP for only a specific range of IP addresses, then you've got a relatively easy task that network routing was designed for.

Most consumer VPN connections set the default route to be the VPN's endpoint when it is activated. What you want to do is leave the default route entry pointing where it was. You'll then add specific entries for the subnet ranges that you're interested in accessing over the VPN.

Microsoft documentation for the Windows routing table is a good reference point. I'm not sure if you can setup the routes with rasdial beforehand, but you can definitely script the appropriate add / remove commands to trigger when the interface comes online.

Update from @graveyface's comment

Connection Manager Administration Toolkit has a way to define routing tables in your connection besides the default routing entry that a connection would otherwise have.

1
  • 1
    if you roll a connection with the CMAK kit, you can specify routes, etc. Then all he would need to do is call the connection after installing it (CMAK creates an executable installer) with rasdial and terminate when he's done.
    – gravyface
    Aug 20, 2012 at 18:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .