Setup a L2TP Client with nmcli

Install Dependencies

sudo dnf install NetworkManager-l2tp

Create the Connection

Note: Replace CONNECTION with desired connection name

sudo nmcli connection add con-name CONNECTION type vpn vpn-type l2tp

Edit the connection with Required Params

Note: In this example, I am not using IPSec. This is a simple L2TP connection with username/password authentication

sudo nmcli connection edit CONNECTION

This will bring you into the nmcli shell. Use the command ? for help.

set vpn.data gateway=IPADDRESS,password-flags=0,user=USERNAME,user-auth-type=password

set vpn.secrets password=PASSWORD

The print command will show you all of the available paramaters. From this, you can infer other values you may need to provide.

Bring the Connection Up

sudo nmcli connection up CONNECTION