How To Set Up 802.1X Network Authentication on Ubuntu

Learn how to connect your Linux Ubuntu device to an enterprise 802.1X network using RADIUS authentication.

Note: While this guide is written for Ubuntu, these set of instructions should be the same with any other Linux distribution that runs GNOME with NetworkManager.

Note: While you can manually configure your Ubuntu device to connect to an enterprise 802.1X network, we highly recommend using a Mobile Device Management (MDM) solution like Microsoft Intune to push the necessary network profiles and certificates to your devices. This ensures that all devices are consistently configured and reduces the risk of misconfiguration.

Overview - What is 802.1X Network Authentication and How Do I Set It Up on Ubuntu?

At home, you probably just plug your computer into an ethernet cable or connect to a Wi-Fi network using a single password. It’s easy and convenient because at home you (usually) trust everyone who can connect to your network. However, in an enterprise environment, you want to make sure that only authorized users and devices can connect to your network. This is where 802.1X network authentication comes in. 802.1X is a network protocol that provides an authentication mechanism to devices wishing to attach to a LAN or WLAN. It is commonly used in enterprise networks to provide secure access to network resources.

Step-by-Step Guide: How to Manually Connect Ubuntu to an Enterprise 802.1X Network with EZRADIUS

Follow these steps to manually configure your Ubuntu device to connect to your enterprise network with EZRADIUS Cloud RADIUS.

Prerequisites for Connecting Ubuntu to an 802.1X Network with EZRADIUS

Prerequisites for Connecting Ubuntu to an 802.1X Network

Make sure you have the following before you configure your device.

How to Create an EZRADIUS Certificate Access Policy

Follow these steps to create a Cloud RADIUS network policy in EZRADIUS that uses certificates for authentication. If you already have a policy that trusts your certificate authority and has a certificate access policy, you can mark this item complete. More information can be found on our dedicated EZRADIUS Certificate Policy guide.

Step 1: Name Your RADIUS Server Policy

Begin by entering a friendly name for your RADIUS server policy. This name is for your records to help you identify the policy later. Behind the scenes, EZRADIUS will create a unique identifier for the policy, so feel free to choose a name that makes sense to you.

Input field to name your RADIUS server policy in EZRADIUS

Step 2: Enable RadSec and/or Classic RADIUS

Next we have to enable which authentication methods you are going to use, you can use RadSec, Classic RADIUS, or both.

EZRADIUS Cloud RADIUS RADIUS Server Policy form showing Enable RadSec and Enable Classic RADIUS checkboxes both checked
How to Set Up Classic RADIUS for Cloud RADIUS

Classic RADIUS uses the public IP address of your RADIUS client (access point, switch, etc.) and a shared secret to authenticate incoming requests. In this section, you will add your public IP addresses and create a shared secret so we know which requests are coming from your authorized network devices.

There are two ways to add IP addresses to your RADIUS policy: either manually adding them one by one or uploading a CSV file for multiple IP addresses.

How To Manually Add Your IP Address(es)

To manually add your IP address(es) to the RADIUS policy, follow these steps:

  1. Select Manual from the dropdown.

  2. Enter the public IP address of your router or VPN server.

  3. Provide a friendly name for the IP address (for your records).

  4. Click Add to add the IP address to the list of allowed RADIUS clients.

  5. A randomly generated shared secret will be created for the IP address. You can change this shared secret if needed.

  6. Repeat the process for each additional public IP address that will connect to EZRADIUS. Make sure to include any backup/failover IP addresses as well.

    EZRADIUS Cloud RADIUS Network Policy IP Addresses

If you have multiple IP Addresses you can add them using a CSV file (if you have a CIDR range and want to convert it to IP range, use this site).

How To Create a CSV File for Uploading IP Addresses

Before uploading, you need to prepare a CSV file containing all the IP addresses you want to add. Follow the instructions below to create and upload the CSV file.

  1. Create a new file named ip_addresses.csv on your computer.
  2. Open the file in a text editor or spreadsheet application and enter your IP addresses, friendly names, and shared secrets following the format IP Address,Friendly Name,Shared Secret. Don’t include headers in the file.

For example, a CSV file with two IP addresses would look like this:

12.12.12.12,First Name,SharedSecret1
12.12.12.13,Second Name,SharedSecret2

Make sure to save your CSV file before proceeding to the upload steps.

How to Upload the CSV File

Now that you have your CSV file, follow these steps to upload it:

  1. Drop down the Add IP Addresses menu and select CSV File Upload.

  2. Either drag-and-drop your CSV file into the upload area or click on the area to browse and select your CSV file.

    Cloud RADIUS Multiple IP Addresses Network Policy For EAP-TLS
How to Configure RadSec for Cloud RADIUS

RadSec (RADIUS over TLS) uses the incoming RadSec client certificate to authenticate the connecting device and associate it with your network profile. To configure RadSec for your network, you need to add a trusted CA which issues your RadSec client certificates (recommended), or specific certificate thumbprints (ok for testing/troubleshooting).

How to Add an EZCA CA as a Trusted Certificate Authority for RadSec

If your RadSec certificate is issued by your EZCA Certificate Authority, then you can easily add the CA to the cloud RADIUS server by:

  1. From the Certificate Source dropdown, select EZCA.

  2. Under the EZCA Instance URL dropdown, select your EZCA instance.

  3. Under the EZCA CA dropdown, select the CA you want to add.

  4. Click Add CA to add the CA to the RADIUS server.

  5. If you have a 2 tier hierarchy, add both your Root CA and your Issuing CA.

  6. Your CA will now be listed under the Trusted Certificate Authorities section.

    EZRADIUS Cloud RADIUS Network Policy add EZCA Cloud Certificate Authority CA for RadSec
How to Add Certificate Authorities to RadSec Using 3rd Party CA

If your device uses a certificate from a 3rd party CA, you can add the CA to the cloud RADIUS server by following these steps:

  1. From the Certificate Source dropdown, select Local CA.

  2. Upload your CA certificate in PEM format.

  3. Your CA will now be listed under the Trusted Certificate Authorities section.

    EZRADIUS Cloud RADIUS Network Policy add CA from Microsoft Cloud PKI, SCEPMAN, or ADCS for RadSec
How to Add a Self-Signed Certificate as a Trusted Certificate for RadSec

If your networking device only supports self-signed certificates for RadSec, you can upload the single certificate to your cloud RADIUS policy by following these steps:

  1. Leave the Authorized Certificate Authorities section empty. You don’t need to add any CAs for self-signed certificates.

  2. Under Authorized Certificate Thumbprints, enter a certificate Friendly Name (This is just for your records, useful if you have multiple locations).

  3. Upload the certificate in PEM format.

  4. Your certificate will now be listed under the Trusted Certificates section.

    EZRADIUS Cloud RADIUS Network Policy add Self-Signed Certificate for RadSec

Step 3: Add Certificate Authorities to RADIUS for Certificate Authentication

A Trusted Certificate Authority (CA) is the CA which issues your user and/or device certificates which are used for network authentication. You can add one or more CAs in this section to control which certificates can authenticate to your network.

How to Add an EZCA Certificate Authority as a Trusted CA

To add an EZCA Certificate Authority as a trusted CA in your network profile, follow these steps:

  1. From the Certificate Source dropdown, select EZCA.

  2. Under the EZCA Instance URL dropdown, select the EZCA instance where your CA lives (for example https://portal.ezca.io/, https://eu.ezca.io/, or https://au.ezca.io/). Your CAs will only appear in the list if you select the right instance.

  3. If you are using a private EZCA instance, check the Private Instance checkbox and enter your EZCA URL.

  4. Under the EZCA CA dropdown, select your EZCA CA.

    EZRADIUS RADIUS network policy Accepted Certificate Authorities section with EZCA selected as the certificate source, the EZCA instance URL, and the Add CA button
  5. Click the Add button to add the CA.

  6. If you have a 2 tier hierarchy, add both your Root CA and your Issuing CA.

  7. You should now see your CA(s) listed under your Trusted Certificate Authorities:

    EZRADIUS Cloud RADIUS Network Policy add EZCA Cloud Certificate Authority CA

How to Add a Third-Party Certificate Authority as a Trusted CA

To add a third-party Certificate Authority as a trusted CA in your network profile, follow these steps:

  1. From the Certificate Source dropdown, select Local CA.

  2. If you are uploading a Root CA, check the Is Root CA checkbox. If you are uploading an Intermediate/Issuing CA, leave the checkbox unchecked.

  3. Click on the Upload Certificate button and select your CA certificate file.

    EZRADIUS Cloud RADIUS Network Policy add CA from Microsoft Cloud PKI, SCEPMAN, or ADCS
  4. If you have a multi-tier hierarchy, make sure to add both your Root CA and your Intermediate/Issuing CA(s).

  5. Repeat the process for each additional CA chain you need to add.

Step 4: Add Server Certificate to RADIUS

A certificate is required to uniquely identify the RADIUS server to the devices connecting to the network. Without it, your clients will not be able to connect and will return errors. There are three ways to add a server certificate:

  1. Use a free, auto-generated certificate
  2. Use EZCA to create and manage the certificate
  3. Upload a certificate from a 3rd party CA.

Create a Free Certificate with Certificate Authority in EZRADIUS

If you do not have your own CA, you can use the EZRADIUS integrated CA to create a free certificate. The certificate will be automatically created and renewed by EZRADIUS.

  1. From the Certificate Source dropdown, select Auto-Generated Certificate.

    Automatic Certificate Creation For RADIUS

Add Server Certificate to RADIUS Using EZCA

If you are already an EZCA customer, you can leverage your existing EZCA CA to issue a RADIUS server certificate.

  1. From the Certificate Source dropdown, select EZCA.

  2. Under the EZCA Instance URL dropdown, select the EZCA instance where your CA lives (for example https://portal.ezca.io/, https://eu.ezca.io/, or https://au.ezca.io/).

  3. If you are using an EZCA private instance, select the Private Instance checkbox and enter your EZCA Issuance URL.

  4. From the EZCA CA dropdown with the certificate authorities you have in your EZCA instance, select the CA you want to use.

  5. Click Request Certificate to create a new RADIUS server certificate. EZRADIUS will automatically create the certificate for you. You do not need to specify an existing certificate or create a CSR. The certificate will be automatically renewed before it expires.

    EZRADIUS RADIUS network policy requesting a RADIUS server certificate from an EZCA CA with the Request Certificate button
  6. You should now see the certificate in the list of certificates:

    EZRADIUS Cloud RADIUS Network Policy add RADIUS Certificate for EAP-TLS
Add Server Certificate to RADIUS Using 3rd Party CA

If you are using a 3rd party CA, you can generate a CSR in EZRADIUS, submit it to your CA, and then upload the signed certificate back to EZRADIUS.

  1. From the Certificate Source dropdown, select Local CA.

  2. Click the Create CSR button.

    EZRADIUS Cloud RADIUS Network Policy add RADIUS Certificate for EAP-TLS
  3. Download the CSR by clicking the Save CSR button.

    EZRADIUS Cloud RADIUS Network Policy add RADIUS Certificate for EAP-TLS
  4. Submit the CSR to your CA and download the certificate.

  5. Also download the certificate of your root CA.

  6. Once you have the certificate, scroll down and either copy and paste the certificate PEM content or click on Upload Certificate and select the certificate in PEM format.

    EZRADIUS Cloud RADIUS Network Policy add RADIUS Certificate for EAP-TLS
  7. After you upload your certificate, you must upload the certificate of the Root CA that signed the certificate. Scroll down and either copy and paste the certificate PEM content or click on Upload Root CA Certificate and select the certificate in PEM format.

    EZRADIUS Cloud RADIUS Network Policy add RADIUS Certificate for EAP-TLS
  8. You will now have both the RADIUS server certificate and the Root CA certificate listed under your certificates.

    EZRADIUS Cloud RADIUS Network Policy add RADIUS Certificate for EAP-TLS

Step 5: Add Certificate Access Policy to RADIUS Network Policy

Now that you have configured Classic RADIUS and/or RadSec, set up your CAs, and added the server certificate, you can add your access policies. Access policies define the conditions under which a user or device can connect to your network. Each policy can have multiple access policies and they are evaluated in the order they are sorted.

  1. Begin in the Access Policies section of the RADIUS network policy. By default, there will be no access policies listed.

    EZRADIUS Cloud RADIUS Access Policies section showing 'No access policies have been added' message with New Access Policy form below
  2. Enter the friendly name of the access policy which is used for your records to easily identify the policy. In this example we’ll configure the RADIUS server as if it was for a school, so we will name the access policy “Students”. Replace this with a name that makes sense for your use case.

    EZRADIUS Cloud RADIUS New Access Policy form with Policy Name field filled in as 'Students'
  3. For this policy we only want to enable EAP-TLS, so we will leave the Enable Password Authentication checkbox unchecked.

Configure Certificate Matching Options for Cloud RADIUS Policies

There are a few different ways you can match the certificate presented by the user or device to the access policy. In this guide we will focus on the four most common methods:

  • CA Matching: If you only issue certificates for students from these CAs, then you can leave everything unchecked and just assign the VLAN if required.
  • Entra ID User Matching: EZRADIUS can extract the user UPN or user ID from a field of the certificate and validate with Entra ID that the user exists and even assign VLAN based on the groups the user is a member of.
  • Entra ID Device Matching: EZRADIUS can extract the Entra ID device ID from a field of the certificate and validate with Entra ID that the device exists and even assign VLAN based on the groups the device is a member of.
  • Intune Device Matching: EZRADIUS can extract the Intune device ID from a field of the certificate and validate with Intune that the device exists and is compliant with your Intune policies.

By default, EZRADIUS will allow any certificate issued by a Trusted CA to authenticate, without requiring any additional matching criteria. If you want all valid certificates to be accepted:

  1. Click Add Access Policy to create a blank access policy.

  2. Provide a Policy Name, such as “All Valid Certificates”.

  3. Leave all fields unchecked and in their default state.

    EZRADIUS Cloud RADIUS New Access Policy form for Students with All Valid Certificates matching and Add Policy button highlighted

If you want to restrict an access policy to only allow user certificates from valid Entra ID users, follow these steps:

  1. Check the Match With Entra ID Objects checkbox.
  2. For Certificate Type, select User.
  3. Under Certificate Field, select which certificate field contains the user’s User Principal Name (UPN). Usually this is Subject Alternate Name (UPN), which is what our Intune SCEP and Keytos Connect guides configure. If your certificates only contain the user’s email address in an RFC822 Subject Alternative Name (for example Jamf $EMAILADDRESS certificates), select Subject Alternate Name (Email) instead.

Now that you have matched the certificate with a valid Entra ID user, you can optionally also check that the user is in a specific Entra ID group.

  1. Check the Check Group Membership checkbox.
  2. Under the Add Group section, type in the name of the Entra ID group you want to check for membership. Select it from the dropdown list.

You should now have an access policy that only allows user certificates from valid Entra ID users, optionally restricted to specific Entra ID groups:

EZRADIUS Cloud RADIUS access policy with Match With Entra ID Objects enabled, Certificate Type User, and Subject Alternative Name UPN field selected

If you want to restrict an access policy to only allow device certificates from valid Entra ID devices, follow these steps:

  1. Check the Match With Entra ID Objects checkbox.
  2. For Certificate Type, select Device.
  3. Under Certificate Field, select which certificate field contains the device’s Entra ID device ID. If you followed our Intune SCEP guides, the Entra ID device ID is in the subject name (CN={{AAD_Device_ID}}), so select Subject Name.
  4. For Device Identifier, set this to AAD Device ID, which is the Entra ID identifier for the device.
  5. If you selected a Subject Alternative Name field, set Attribute Prefix to any text that comes before the device ID in that field so that the system correctly extracts the device ID from the certificate. Leave it empty when using the Subject Name field.

Now that you have matched the certificate with a valid Entra ID device, you can optionally also check that the device is in a specific Entra ID group.

  1. Check the Check Group Membership checkbox.
  2. Under the Add Group section, type in the name of the Entra ID group you want to check for membership. Select it from the dropdown list. Note that this group has to contain the device itself, not the user who owns the device.

You should now have an access policy that only allows device certificates from valid Entra ID devices, optionally restricted to specific Entra ID groups:

EZRADIUS Cloud RADIUS access policy with Match With Entra ID Objects enabled, Certificate Type Device, Subject Name field, and AAD Device ID identifier selected

If you want to restrict an access policy to only allow device certificates from valid Intune-managed devices, follow these steps:

  1. Check the Match With Entra ID Objects checkbox.
  2. For Certificate Type, select Device.
  3. Under Certificate Field, select Subject Alternate Name (DNS). Our Intune SCEP guides add the Intune device ID to the certificate as a DNS Subject alternative name with the value {{DeviceId}}.
  4. For Device Identifier, set this to Intune Device ID, which is the Intune identifier for the device.
  5. Leave Attribute Prefix empty, since the Subject alternative name only contains the device ID.

Now that you have matched the certificate with a valid Intune-managed device, you can optionally check if the device is compliant in Intune before granting access. This ensures that only devices meeting your organization’s compliance requirements are allowed to match against this policy.

  1. Check the box for Check Device Compliance in Intune.

If you want to also restrict access based on group membership, follow these steps:

  1. Check the Check Group Membership checkbox.
  2. Under the Add Group section, type in the name of the Entra ID group you want to check for membership. Select it from the dropdown list. Note that this group has to contain the device itself, not the user who owns the device.

You should now have an access policy that only allows device certificates from valid Intune-managed devices, optionally restricted to specific Entra ID groups:

EZRADIUS Cloud RADIUS access policy with Match With Entra ID Objects enabled, Certificate Type Device, Subject Alternate Name (DNS) field, Intune Device ID identifier, empty Attribute Prefix, and Check Device Compliance in Intune enabled

By default, EZRADIUS will not set a Virtual LAN (VLAN), and your network will use its own default VLAN. However, you can specify a specific VLAN in each access policy to assign specific users and devices to their own VLAN and override the default.

This is useful for putting specific Entra ID users or groups into their own VLANs, or putting compliant devices into a separate VLAN from non-compliant devices.

If you do not want to assign a VLAN for this access policy, keep VLAN Management set to Do not assign VLAN. This will ensure that the network uses its default VLAN for all users and devices under this access policy.

EZRADIUS Cloud RADIUS VLAN Settings section with VLAN Management set to Do not assign VLAN

If you want to assign a specific, static VLAN to all devices that match against this access policy, set VLAN Management to Assign Static VLAN and enter the VLAN ID in the VLAN Name field. This ensures that all matching devices are placed in the specified VLAN, overriding the network’s default VLAN.

If you want to assign different VLANs to different users or devices based on their attributes, you should either:

  1. Set up multiple access policies, each with a different static VLAN and different matching attributes.
  2. Use dynamic VLAN assignment based on certificate values to automatically assign VLANs according to the information contained in the user’s certificate.

More information on how to use this field is available in our reference architectures

EZRADIUS Cloud RADIUS VLAN Settings section with VLAN Management set to Assign Static VLAN and VLAN Name field showing value 1

VLANs can also be set based on a VLAN ID specified within the certificate authenticating to the network. To configure this:

  1. From the VLAN Management dropdown, select Assign Dynamic VLAN (From Certificate Value).

  2. Under Certificate Field, select the field in the certificate that contains the VLAN ID.

  3. If there’s a prefix in front of the VLAN ID in the certificate, enter the prefix in the Prefix field. EZRADIUS will ignore this prefix when assigning VLANs.

    EZRADIUS Cloud RADIUS VLAN Settings showing Assign Dynamic VLAN From Certificate Value with Subject Alternate Name DNS field and vlan- prefix

Want MAC Authentication Bypass, OCSP, or other advanced settings? If you would like to configure advanced settings such as MAC Authentication Bypass, attribute matching, EKU usage, or OCSP, visit our dedicated EZRADIUS Certificate Policy guide.

Collapses this section and completes the checkmark.

To connect your device to an enterprise network using RADIUS authentication, you typically need the following details from your network administrator:

  1. Network SSID: The name of the Wi-Fi network you want to connect to.
  2. Security Type: The type of security protocol used by the network (for example, WPA2-Enterprise or WPA3-Enterprise).
  3. EAP Method: The Extensible Authentication Protocol method used for authentication (for example, EAP-TTLS/PAP, EAP-TLS, or PEAP-MSCHAPv2).
  4. RADIUS Server CA Certificate: The certificate authority (CA) certificate that your device will use to trust the RADIUS server during the authentication process.
  5. User Credentials: Your Entra ID username and password, or a client certificate if using EAP-TLS.

Collapses this section and completes the checkmark.

Step 1 - How to Download and Prepare the User Certificate and Private Key for EAP-TLS on Ubuntu

To connect to a Wi-Fi network using EAP-TLS certificate-based authentication, you need to have a client certificate and private key in PEM format. Follow these steps to prepare your certificates:

How to Create a New User Certificate for EAP-TLS

Begin by downloading or creating a user certificate for EAP-TLS authentication. Depending on your setup, you can use one of the following methods:

Refer to this guide for instructions on how to create and download a user certificate for EAP-TLS authentication using the EZCA Self-Service Portal. Make sure to download the certificate in PEM format along with the private key.

Refer to this guide for instructions on how to automatically install a SCEP certificate for EAP-TLS authentication using a script on Linux.

If you are using a 3rd party PKI, refer to your PKI documentation to create and download a user certificate for EAP-TLS authentication. Make sure to download the certificate in PEM format along with the private key.

You should now have a PEM formatted client certificate and CA certificate on your local machine:

Ubuntu Files app showing the PEM client certificate, private key, and CA certificate for EAP-TLS

How to Prepare the User Certificate and Private Key

If the private key is unencrypted, encrypt the private key with OpenSSL using the following command. Make sure that the private key and the certificate file are separate. This is a limitation with NetworkManager.

openssl rsa -aes256 -in $FILE_WITH_PRIVATE_KEY -out $FILE_NAME_FOR_ENCRYPTED_PRIVATE_KEY

Step 2 - How to Trust Your RADIUS Server CA Certificate on Ubuntu

For your Ubuntu device to trust the RADIUS server during the authentication process, you need to install the RADIUS server CA certificate on your device. This tells your Ubuntu device to trust all RADIUS servers that present a certificate signed by this CA during the authentication process.

How to Download Your RADIUS Server CA Certificate

If you used the EZRADIUS auto-generated certificate for your RADIUS server, you’ll just have a single CA certificate to download. Follow these steps:

  1. Log in to your EZRADIUS portal.
  2. Navigate to Policies.
  3. Select the RADIUS policy that your network (access points or switches) is connected to.
  4. Scroll down to the Server Certificate section.
  5. Click on the Download CA Certificate button to download the certificate to your local machine. It will have a filename similar to RootCA.cer. Download EZRADIUS CA Certificate

If you used EZCA to issue your RADIUS server certificate, you’ll need to download the CA certificate for your EZCA CA, plus the Root CA certificate, if applicable. Follow these steps:

  1. Log in to your EZCA portal.
  2. Navigate to Certificate Authorities.
  3. Select the CA that issued your RADIUS server certificate.
  4. Click on the View Details button.
  5. Click on the Download Certificate button to download the CA certificate to your local machine. It will have a filename similar to <CA-NAME>.cer.
  6. If your EZCA CA is an intermediate CA, make sure to also download the Root CA certificate by repeating the above steps for the Root CA.

Refer to your PKI documentation to download the CA certificate(s) that issued your RADIUS server certificate. Ensure you have the root CA and any intermediate CA certificates if applicable.

How to Install the RADIUS Server CA Certificate on Ubuntu

To install the RADIUS server CA certificate on your Ubuntu device, follow these steps:

  1. Open the Files application and navigate to the location where you downloaded the RADIUS server CA certificate (for example, RootCA.cer).
  2. Right-click on the certificate file and select Open With Other Application.
  3. Choose Certificates from the list of applications and click Select.
  4. In the Certificates application, click on the Install Certificate button.
  5. Select System as the location to install the certificate and click Continue.
  6. You may be prompted to enter your Ubuntu administrator password to authorize the installation. Enter your password and click Authenticate.
  7. After the installation is complete, close the Certificates application.

Step 3 - How to Configure Your Ubuntu Network Settings for RADIUS Authentication

When connecting your Ubuntu device to an enterprise network using RADIUS authentication, you need to ensure that the correct EAP (Extensible Authentication Protocol) method is configured based on your authentication setup.

How to Connect to an EAP-TLS Wi-Fi Network on Linux

  1. Open the Settings application on your Ubuntu device.

  2. Navigate to the Wi-Fi section and select the desired Wi-Fi network

    Ubuntu Settings Wi-Fi section with the enterprise Wi-Fi network selected
  3. Make sure Security is set to WPA & WPA2 Enterprise (or WPA3-Enterprise if your network uses WPA3)

    Ubuntu Wi-Fi authentication dialog with Security set to WPA & WPA2 Enterprise
  4. Change Authentication to TLS.

    Ubuntu Wi-Fi authentication dialog with Authentication set to TLS
  5. Set Identity to anonymous

    Ubuntu Wi-Fi authentication dialog with Identity set to anonymous for EAP-TLS
  6. For CA certificate, select the RADIUS server CA certificate you downloaded in the Step 2 - How to Trust Your RADIUS Server CA Certificate on Ubuntu step (for example, RootCA.cer). This is the CA that issued your RADIUS server certificate (not the RADIUS server certificate itself, and only the same as your client certificate’s CA if both were issued by the same EZCA root).

  7. For User certificate, select your client certificate file in PEM format.

  8. For Private key, select your encrypted private key file in PEM format.

    Ubuntu Wi-Fi authentication dialog with CA certificate, user certificate, and private key selected for EAP-TLS
  9. Enter the User key password you used to encrypt the private key earlier.

    Ubuntu Wi-Fi authentication dialog with the user key password entered
  10. Click Connect to connect to the network.

    Ubuntu Wi-Fi authentication dialog with the Connect button for EAP-TLS
  11. You should now be connected to the network with certificate authentication using EAP-TLS

    Ubuntu Settings Wi-Fi section showing the device connected to the EAP-TLS network

How to Set Up EAP-TLS Certificate Based Authentication with SCEP Certificate for Wi-Fi on Ubuntu

  1. Make sure the SCEP Certificate Authority which issued your SCEP certificate is trusted by your EZRADIUS policy

  2. Copy the following script to a file, fill the values as required, and run it

    • If you are using an auto-generated server certificate, download the RADIUS server CA certificate as described in the How to Trust Your RADIUS Server CA Certificate on Ubuntu section above, then uncomment CA_PATH and set it to the absolute path of that file.
    • If your server certificate was issued by an EZCA SCEP CA, you can instead set EZCA_SERVER_CA_STATIC_SCEP_URL to that CA’s static SCEP URL and the script will download the CA certificate for you. One of these two values must be set or the script will exit.
    • Set the SSID of the wifi network in SSID
    #!/bin/bash
    # User-set values
    # CA_PATH="" # Set to the absolute path of the server certificate CA
    EZCA_SERVER_CA_STATIC_SCEP_URL="" # Set to the static scep URL of the server certificate CA
    SSID="test-wifi"                  # Set to the SSID of the network
    
    # NOTE: set ONE of the two values above:
    # - If your RADIUS server certificate is auto-generated by EZRADIUS, download the server CA
    #   certificate from EZRADIUS ("Download CA Certificate"), copy it to the device, then
    #   uncomment CA_PATH and set it to the absolute path of that file.
    # - If your RADIUS server certificate was issued by an EZCA SCEP CA, you can instead set
    #   EZCA_SERVER_CA_STATIC_SCEP_URL and the script will download that CA certificate for you.
    
    ## ---------- ## ---------- ## ---------- ## ---------- ## ---------- ##
    
    # Check all required executables exist
    req_execs=("base64" "cat" "curl" "cut" "grep" "head" "mkdir" "nmcli" "sed")
    for exe in "${req_execs[@]}"; do
      if [ ! $(command -v "$exe") ]; then
        echo "Required executable $exe not found"
        exit 1
      fi
    done
    
    if [ -z "$EZCA_SERVER_CA_STATIC_SCEP_URL" ] && [ -z "$CA_PATH" ]; then
      echo "Either EZCA_SERVER_CA_STATIC_SCEP_URL or CA_PATH must be set"
      exit 1
    fi
    
    SSID=${SSID:-'DEFAULT_SSID'}
    CONNECTION_NAME=${CONNECTION_NAME:-'keytos-ezradius-eap-tls'}
    
    INSTALL_DIR=${INSTALL_DIR:-"$HOME/.local/share/keytos/scep_certs"}
    PFX_PATH=${PFX_PATH:-"$INSTALL_DIR/scep-client-cert.pfx"}
    PASSWORD_PATH=${PASSWORD_PATH:-"$INSTALL_DIR/scep-client-cert_password.txt"}
    ENCRYPTED_KEY_PATH=${ENCRYPTED_KEY_PATH:-"$INSTALL_DIR/scep-client-cert-key.pem"}
    CER_PATH=${CER_PATH:-"$INSTALL_DIR/scep-client-cert.pem"}
    
    WIFI_NIC=$(nmcli -t -f DEVICE,TYPE device | grep wifi$ | head -n 1 | cut -d: -f1)
    if [ -z "$WIFI_NIC" ]; then
      exit 1
    fi
    
    nmcli -f GENERAL.STATE con show "$CONNECTION_NAME" >/dev/null 2>&1
    if [ $? -eq 0 ]; then
      echo "$CONNECTION_NAME already exists, skipping wifi setup"
      exit 0
    fi
    
    # If CA_PATH was not provided, download the server certificate CA from the EZCA static SCEP URL
    if [ ! -f "$CA_PATH" ]; then
      echo "Getting CA Certificate"
      INSTALL_DIR=${INSTALL_DIR:-"$HOME/.local/share/keytos/scep_certs"}
      mkdir -p $INSTALL_DIR
    
      CA_PATH=$INSTALL_DIR/server_ca_certificate.pem
      curl ${EZCA_SERVER_CA_STATIC_SCEP_URL}?operation=GetCACert |
        base64 |
        sed '1i -----BEGIN CERTIFICATE-----' |
        sed '$a -----END CERTIFICATE-----' \
          >$CA_PATH
      echo "CA Certificate download to $CA_PATH from $EZCA_SERVER_CA_STATIC_SCEP_URL"
    fi
    
    # Check files exist
    if [ ! -f "$CA_PATH" ]; then
      echo "Required file not found: $CA_PATH"
      exit 1
    fi
    if [ ! -f "$CER_PATH" ]; then
      echo "Required file not found: $CER_PATH"
      exit 1
    fi
    if [ ! -f "$ENCRYPTED_KEY_PATH" ]; then
      echo "Required file not found: $ENCRYPTED_KEY_PATH"
      exit 1
    fi
    if [ ! -f "$PASSWORD_PATH" ]; then
      echo "Required file not found: $PASSWORD_PATH"
      exit 1
    fi
    
    nmcli c add type wifi ifname "$WIFI_NIC" con-name "$CONNECTION_NAME" \
      802-11-wireless.ssid "$SSID" \
      802-11-wireless-security.key-mgmt wpa-eap \
      802-1x.eap tls \
      802-1x.identity 'anonymous' \
      802-1x.ca-cert "$CA_PATH" \
      802-1x.client-cert "$CER_PATH" \
      802-1x.private-key "$ENCRYPTED_KEY_PATH" \
      802-1x.private-key-password "$(cat $PASSWORD_PATH)"
    

How to Connect to an EAP-TLS Wired Network on Linux

  1. Open Settings and go to the Network tab. Click the gear icon next to the Wired connection to open the settings.

    Ubuntu Settings Network tab with the Wired connection settings gear icon
  2. Under Security enable 802.1x Security.

  3. Set Authentication to TLS.

  4. Set Identity to anonymous.

  5. For the User certificate, select your client certificate file in PEM format.

  6. For the CA certificate, select the RADIUS server CA certificate you downloaded in the Step 2 - How to Trust Your RADIUS Server CA Certificate on Ubuntu step (for example, RootCA.cer), not the RADIUS server certificate itself.

  7. For the Private key, select your encrypted private key file in PEM format.

  8. Enter the User key password you used to encrypt the private key earlier.

  9. Click Apply to save the settings.

    Ubuntu Wired connection 802.1x Security tab with TLS authentication, certificates, and private key filled in
  10. You should now be connected to the network.

    Ubuntu Settings Network tab showing the wired connection connected with EAP-TLS

How to Troubleshoot EZRADIUS 802.1X Authentication on Ubuntu

If you are unable to connect to your network, refer to our troubleshooting guide. If you are using Entra ID credentials, also see our Entra ID troubleshooting guide.

🔎 EZRADIUS Troubleshooting Guide