Forum / Remote Desktop Manager - Feature Request

Microsoft VPN - Custom Routes

  • Create an Issue
  • Cancel

I have an idea about a new AddOn/New Feature.

I have created a utility what I use on a daily base. It builds Microsoft VPN tunnels and afterwards creates predefined custom routes to known networks behind the initial VPN's network. You would think, why not check the default gateway box, but that would mean I sent all my internet requests over that VPN. I only want to reach my custom routes (my customers).


What would be great is if I had the ability in RDM to define a VPN session, set it to dial a specific VPN and define additional custom routes after connecting the VPN.

I could build a new AddOn for this, but that would mean I have to build code to be able to use the RAS API from Windows (that what I did in my own util). Since RDM already has a complete routine to dial Microsoft VPN sessions, it would be great if, I would be able to call a method (provided by the SDK) that connects a Microsoft VPN session and returns the IP address the PPP adapter has been given. Then all I would have to do in the custom AddOn is build an interface to define custom routes to different existing (from a enumerating method in the API) VPN sessions.


What do you think?


Regards,

Sjoerd

Cheers!

Sjoerd

Clock9 yrs

Hi,
I was about to respond you to this in email. RDM does not use the RAS API, it's only call rasdial in command line. So I think that your add-on could be nice, but I think that you should use your own tool for that. What do you think ?

David Hervieux

signaturesignature

Clock9 yrs

I use the DotRas library (dotras.codeplex.com) in my current build. They have updated there library very recently to address Windows 7. I just downloaded this library to see what new and update my tool. When I have reviewed this I will try to see what would be the best setup.
I will let you know what the outcome will be. To be continued...wink

Cheers!

Sjoerd

Clock9 yrs

Hi,
This could be very interesting to create an add-on? I will gladly contribute if you are interested. Thank you

David Hervieux

signaturesignature

Clock7 yrs

Hi
I would also like to be able to add custom routes after the microsoft vpn has connected.
Se attached file for a suggested feature for the MS VPN session type.
Basically, wait for the vpn to connect, then get the adapter-ip by its name and assign that ip to a session variable $IP$

system.net.networkinformation.networkinterface]::GetAllNetworkInterfaces()|Where-Object {$_.name -eq $InterfaceName}
if ($local:nic.OperationalStatus -eq ‘Up’) {
$local:interfaceIP = ($local:nic.GetIPProperties().unicastaddresses|where {$_.ipv4Mask -ne ’0.0.0.0′}).Address.IPAddressToString

Then call CMD.EXE for each line in the textfields with the "route" commands.
Same after disconnect.
Also check this webpage
http://www.webboise.com/windows-powershell-script-for-adding-ip-routes-across-a-vpn/

Thank You
Magnus Pettersson

RDM_Suggestion_Custom_Routes.png
Clock7 yrs

Hi,
It's very interesting. Could you explain to my the Powershell script? From what I understand, you want me to find the VPN by name but if I verify the adapter, I can't find it by name. If you could provide me a VPN access for the test, I would appreciate. I no longer have access to a Microsoft VPN

David Hervieux

signaturesignature

Clock7 yrs

Hi David
I have recreated the script in vb as a function. See attached file.
As far as I can tell it will look for an adapter with the name = vpnname and status = up. Then it will get the first unicast adress assigned to that adapter and with ipv4mask <> 0.0.0.0 and return it.
I'm not an ip-expert but it seems to work.
After vpn launch, call it until it returns Ip.

Wouldnt it be pretty easy to setup a RAS-server to test ms-vpn?
I could pm you a temporary msvpn if you need it.
/Magnus

VPN_IpByName.vb
Clock7 yrs

Hi,
I would appreciate if you could setup a VPN for me. Thank you

David Hervieux

signaturesignature

Clock7 yrs