Static VPN Routes not applied via Windows login screen

TassieTrooper 16 Reputation points
2022-03-15T21:57:01.127+00:00

Hi,

Can someone confirm that this commandlet works when using an '-AllUsersConnection' VPN via Windows 10 login screen?
<SNIPPET>
Foreach ($Destination in $RouteList)
{
Add-Vpnconnectionroute -Connectionname $ConnectionName -AllUserConnection -DestinationPrefix $Destination
}
*This is the Meraki VPN split tunnel script.

The routing works fine when VPN is connected during a current user's login session, and that is also true for any user that is currently logged in, yet the routes are not being applied when connected via the Remote Connections login from Windows Login screen.

Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,274 questions
{count} vote

15 answers

Sort by: Newest
  1. imennodenis 1 Reputation point
    2023-03-22T09:13:06.54+00:00

    It seems I have found a solution.

    Try to set DeviceTunnel=1 in alluser's rasphone.pbk file. I'm using sstp (not l2tp) but I think it should work too.

    I have noticed a small drawback of that - a user does not see that vpn connection is actually connected, but that's ok for me.


  2. IT Trev 11 Reputation points
    2023-01-09T23:23:27.537+00:00

    at the end of the day, it looks like the issue is device vpn profile vs user vpn profile

    device vpn profile does NOT load routes. when using L2TP VPNs with 'alluserconnection', during the control-alt-delete screen when you connect to this vpn it will use a device vpn profile.
    after the user profile loads, it will use a user vpn profile, and this does use (and loads) the routes.

    I don't fully understand the details of how that transition works.

    Microsoft said one solution is to not use L2TP. Also, PROPERLY use device VPN profiles (i.e. in your VPN architecture design) will prevent this issue. Using additional routes with L2TP vpns in the pre-logon environment (which is a device VPN profile) is not supported.
    At least - this is my current understanding.

    Again, here's the link I was given. This is more specific to always on VPN, but it's not ONLY for always on vpn. The info for device vs user vpn is still very relevant.
    https://learn.microsoft.com/en-us/windows-server/remote/remote-access/vpn/vpn-device-tunnel-config

    1 person found this answer helpful.
    0 comments No comments

  3. IT Trev 11 Reputation points
    2022-12-22T20:54:46.17+00:00

    Microsoft has said this is expected behavior. The issue is the "VPN profile". There is 'device' profile, and 'user' profile.
    They gave me an article that describes this, but it is specific to 'always on vpn'. I'm not using always on VPN.
    Despite not using always on vpn, I believe the issue is likely the same. VPN operates in a different way when it's in 'device' mode vs 'user' mode. In the pre-logon environement, or if you are using the computer/system account to initiate the vpn, it uses the 'device' VPN profile.

    The problem I have is there's no reference or understanding of these 2 different modes of operation, when they're used, how they're used, or how the interact.

    https://learn.microsoft.com/en-us/windows-server/remote/remote-access/vpn/vpn-device-tunnel-config

    I'm going to have a call and try to understand this better.

    0 comments No comments

  4. TassieTrooper 16 Reputation points
    2022-11-30T07:17:47.027+00:00

    This sound 100% like a furfy! Using IKEV2 makes no sense as to why there would be a difference with the way a global address book connection it is meant to work as per the purpose of the AllUserConnection parameter. Further, nowhere in any literature says that L2TP is not supported. This 100% is a bug within the OS and should be fixed, not worked around.

    0 comments No comments

  5. IT Trev 11 Reputation points
    2022-11-29T05:40:04.35+00:00

    Possible way to deal with this issue, per Microsoft:

    Use a IKEv2 tunnel, not L2TP. MS said they can see the issue with L2TP, but the issue seems to NOT be a problem with IKEv2. Using powershell to create the vpn connection, you would use the paramenter "-tunneltype ikev2" instead of "-tunneltype l2tp"

    https://learn.microsoft.com/en-us/powershell/module/vpnclient/add-vpnconnection?view=windowsserver2022-ps

    Unfortunately, in my current environment, I can't use ikev2 for my client VPNs.