Sample Header Ad - 728x90

Right syntax of dictionary of key/value pairs

1 vote
1 answer
183 views
I read through the docs here and here . My goal is to configure a ip-sec VPN connection from nmcli only. I run Ubuntu 20.04 Server without X Server. I already have a connection file on another machine, so I have all the information needed: [connection] id=myVPN uuid=blabla-blabla-blabla type=vpn autoconnect=false permissions=user:mark:; [vpn] IKE DH Group=dh2 IPSec ID=myID IPSec gateway=myGateway IPSec secret-flags=1 Local Port=0 NAT Traversal Mode=natt Perfect Forward Secrecy=server Vendor=cisco Xauth password-flags=1 Xauth username=myUser ipsec-secret-type=save xauth-password-type=save service-type=org.freedesktop.NetworkManager.vpnc [ipv4] dns-search= method=auto [ipv6] addr-gen-mode=stable-privacy dns-search= method=auto [proxy] Here my first try: sudo nmcli connection add connection.id myVPN connection.type vpn connection.autoconnect false connection.permissions mark vpn.data {"IKE DH Group"="dh2" "IPSec ID"="myID" "IPSec gateway"="myGateway" "IPSec secret-flags"="1" "Local Port"="0" "NAT Traversal Mode"="natt" "Perfect Forward Secrecy"="server" "Vendor"="cisco" "Xauth password-flags"="1" "Xauth username"="myUser" "ipsec-secret-type"="save" "xauth-password-type"="save" } vpn.service-type=org.freedesktop.NetworkManager.vpnc It fails with the following error: > Error: invalid \.\ 'IPSec ID=myID' I understood it wants the . instead of the = to assign the key/value pairs. Here my second try: > Error: failed to modify vpn.data: '{IKE DH Group.dh2' is not valid; use = Now it says the opposite: it wants the `= sign. What is the correct syntax to set those key/value pairs?
Asked by Mark (815 rep)
Oct 10, 2021, 06:25 AM
Last activity: Oct 10, 2021, 04:54 PM