Setting up an OTP (One-Time Password) internet service provider involves configuring secure authentication for network access, typically through a RADIUS server integrated with your ISP’s infrastructure, to add a second layer of security beyond static passwords.

What You'll Need

  • A RADIUS server (such as FreeRADIUS) configured for OTP authentication
  • Access to your ISP’s network authentication system (often via a NAS – Network Access Server)
  • OTP tokens or a software authenticator app (e.g., Google Authenticator, Authy) for end users
  • A shared secret key between the NAS and RADIUS server
  • Basic Linux command-line knowledge (if self-hosting RADIUS)
  • Optional: LDAP or Active Directory integration for user management

Step-by-Step

  1. Install and configure a RADIUS server: On a Linux server, install FreeRADIUS using your package manager (e.g., sudo apt install freeradius on Ubuntu). Edit the /etc/freeradius/3.0/clients.conf file to add your NAS (e.g., router or access controller) with its IP address and a strong shared secret.
  2. Enable OTP authentication module: In /etc/freeradius/3.0/mods-enabled/, ensure the otp module is linked. Edit /etc/freeradius/3.0/mods-available/otp to set the token type (e.g., HOTP or TOTP), token length (usually 6 digits), and time step (30 seconds for TOTP).
  3. Configure user OTP secrets: For each user, generate a base32 secret key (using tools like oathtool or QR code generators) and store it in the users file (/etc/freeradius/3.0/users) or in a backend like LDAP. Example entry: john Cleartext-Password := "mysecret", OTPToken := "JBSWY3DPEHPK3PXP".
  4. Set up the NAS to use RADIUS: On your network access device (e.g., VPN concentrator, firewall, or dial-in server), configure the authentication method to use RADIUS. Enter the RADIUS server IP, shared secret, and authentication port (usually 1812). Ensure the NAS is listed as a client in clients.conf.
  5. Test the authentication flow: From a test device, attempt to connect to the network (e.g., via VPN or dial-up). When prompted for a password, enter your static password (if used) followed immediately by the 6-digit OTP from your authenticator app (or use the OTP alone if configured for OTP-only). Check /var/log/freeradius/radius.log for success or failure messages.
  6. Monitor and maintain: Regularly check logs for authentication failures. Rotate shared secrets periodically. Ensure time synchronization (via NTP) on both the RADIUS server and NAS, as TOTP is time-sensitive.
  7. Common Mistakes

    • Incorrect shared secret: A mismatched secret between NAS and RADIUS server causes authentication to fail silently. Always verify the secret is identical on both ends.
    • Time drift: If the RADIUS server’s clock is not synchronized, TOTP codes will be invalid. Enable NTP on all servers.
    • Wrong OTP format: Entering a space or extra characters between password and OTP, or using the OTP in the wrong field, causes failure. Follow the exact format expected by your NAS.
    • Using outdated token seeds: If you regenerate a user’s secret without updating it in the RADIUS user file, authentication will fail. Always update both the user’s device and the server record.
    • Firewall blocking RADIUS ports: UDP ports 1812 (authentication) and 1813 (accounting) must be open between NAS and RADIUS server.

    Tips

    • Use TOTP over HOTP for better security and usability, as TOTP codes expire quickly and don’t require counter synchronization.
    • Label OTP tokens clearly in authenticator apps (e.g., "ISP-OTP-john") to avoid confusion with other accounts.
    • Test with a single user first before rolling out to all customers or employees.
    • Consider using RADIUS accounting (radacct table) to log login attempts for auditing.
    • If integrating with LDAP, bind the OTP module to check both LDAP password and OTP in sequence.

    Troubleshooting

    • Authentication fails: First, check /var/log/freeradius/radius.log for clues. Common messages include "Invalid user" (wrong username), "Incorrect checksum" (wrong shared secret), or "OTP token invalid" (time drift or wrong seed).
    • No response from RADIUS server: Verify the NAS can reach the RADIUS server IP on UDP 1812 using telnet or nc -u. Check firewalls and ensure freeradius service is running (systemctl status freeradius).
    • OTP codes never work: Confirm the time on the RADIUS server is correct (timedatectl). Compare the OTP generated by oathtool --totp -b "YOURSECRET" with what the user sees.
    • Users locked out after failed attempts: Some NAS devices lock accounts after multiple failures. Check NAS lockout policies and clear locks if needed.
    • Still not working: Temporarily disable OTP and test with a static password to isolate whether the issue is with RADIUS connectivity or the OTP module itself.

    Frequently Asked Questions

    Can I use OTP without a RADIUS server?

    Some VPNs or firewalls have built-in OTP support (e.g., Duo, RSA SecurID via API), but for standard ISP-style RADIUS authentication, a RADIUS server is required to validate OTP tokens against shared secrets.

    What if a user loses their authenticator device?

    You must have a recovery process: issue a new OTP secret, update it in the RADIUS user file, and provide the new seed to the user via a secure channel. Never bypass OTP without re-enrolling.

    Is OTP authentication compliant with ISP regulations?

    Yes, OTP adds strong customer authentication (SCA) and is often recommended or required for secure remote access, especially under frameworks like NIST 800-63B.

    Can I use SMS-based OTP instead of authenticator apps?

    While possible, SMS OTP is less secure due to SIM-swapping risks. Authenticator apps (TOTP) are preferred for higher security.

    Do I need to encrypt RADIUS traffic?

    Basic RADIUS uses shared secrets for obfuscation but not strong encryption. For sensitive deployments, use RADIUS over TLS (RadSec) or IPsec to protect authentication traffic.

    How often should OTP secrets be rotated?

    Rotate user secrets if a device is lost or compromised. There’s no fixed interval, but regular rotation (e.g., annually) is a good practice for high-security environments.