OPNsense Forum

English Forums => Virtual private networks => Topic started by: atom on March 17, 2022, 02:30:18 PM

Title: Mobile IPsec with TOTP
Post by: atom on March 17, 2022, 02:30:18 PM
Hello,

I would like to know if anyone has got Mobile IPsec working with TOTP (Windows 10 native vpn client)

- TOTP for login (ssh/GUI)                             -> works
- Mobile IPsec with Mutual RSA                     -> works
- Mobile IPsec with EAP-MSCHAPv2               -> works

Only Mobile IPsec with EAP-MSCHAPv2 + TOTP does not work.
Can it be because the "IPsec Pre-Shared Key" at the user can only be PSK and not EAP ?

Greetings,
atom
Title: Re: Mobile IPsec with TOTP
Post by: atom on March 17, 2022, 05:05:47 PM
Update:

I've manually created the ipsec.secrets file in /usr/local/etc/ipsec.secrets.opnsense.d .
The possibility to select TOTP as "backend for authentication" is just fake. Only the password from the /usr/local/etc/ipsec.secrets.opnsense.d/ ipsec.secrets is sufficient to authenticate on the Windows.
Title: Re: Mobile IPsec with TOTP
Post by: mimugmail on March 17, 2022, 07:01:14 PM
This only works with an external solution capable of EAP
Title: Re: Mobile IPsec with TOTP
Post by: atom on March 17, 2022, 07:09:07 PM
Do you have an example of an external solution ?
Title: Re: Mobile IPsec with TOTP
Post by: mimugmail on March 17, 2022, 07:18:55 PM
You need to set EAP Radius and use an otp solution offering radius.
Title: Re: Mobile IPsec with TOTP
Post by: atom on March 18, 2022, 09:38:25 AM
Do you know an OTP solution that radius offers ?
Title: Re: Mobile IPsec with TOTP
Post by: Patrick M. Hausen on March 18, 2022, 11:18:46 AM
FreeRADIUS can do that.
Title: Re: Mobile IPsec with TOTP
Post by: mimugmail on March 18, 2022, 04:42:50 PM
Quote from: pmhausen on March 18, 2022, 11:18:46 AM
FreeRADIUS can do that.

With TOTP?  :o
Title: Re: Mobile IPsec with TOTP
Post by: Patrick M. Hausen on March 18, 2022, 06:35:52 PM
Quote from: mimugmail on March 18, 2022, 04:42:50 PM
Quote from: pmhausen on March 18, 2022, 11:18:46 AM
FreeRADIUS can do that.

With TOTP?  :o
Sure - there are a couple of possible plugins. I only implemented HOTP in production, but the process was not that complicated if you know your way around FreeRADIUS.

Take for example: https://github.com/lark/vpn-otp

Note that I claimed neither "out of the box" nor "on OPNsense". But certainly with OPNsense connected to an external RADIUS instance.

Alternatively in a corporate environment you might want to look into Microsoft's Internet Authentication Server and possibly plugins for that.

HTH,
Patrick