Setup a L2TP Client with nmcli
Install Dependencies
sudo dnf install NetworkManager-l2tpCreate the Connection
Note: Replace
CONNECTIONwith desired connection name
sudo nmcli connection add con-name CONNECTION type vpn vpn-type l2tpEdit 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