Skip to main content

dtctl vpn create

Usage​

dtctl vpn create [flags]

Aliases​

c

Description​

Create a site-to-site VPN connection on a router. Reference existing IKE/IPSEC policies and endpoint groups by ID, or create them inline with the corresponding parameter flags. The router must already have a VPN service (see create-service).

Example​

# Create a VPN using existing policies and inline endpoint subnets/CIDRs
dtctl vpn create --router-id <router-id> \
--vpn name=to-hq,peer_address=203.0.113.10,psk=<psk>,peer_id=203.0.113.10,initiator=bi-directional \
--ike-policy-id <ike-id> --ipsec-policy-id <ipsec-id> \
--local-endpoint-name local --local-endpoint-subnets <subnet-id> \
--remote-endpoint-name remote --remote-endpoint-subnets 192.168.100.0/24

Flags​

OptionDescription
--ike-policy, -kCreate an IKE policy inline as key=value: name, lifetime, auth_algorithm, encryption_algorithm, ike_version, pfs
--ike-policy-id, -iID of an existing IKE policy (provide this or --ike-policy)
--ipsec-policy, -tCreate an IPSEC policy inline as key=value: name, lifetime, auth_algorithm, encryption_algorithm, pfs
--ipsec-policy-id, -sID of an existing IPSEC policy (provide this or --ipsec-policy)
--local-endpoint-id, -lID of an existing local endpoint group (provide this or --local-endpoint-name + --local-endpoint-subnets)
--local-endpoint-name, -nName for a new local endpoint group
--local-endpoint-subnets, -dComma-separated local subnet IDs for a new local endpoint group
--remote-endpoint-id, -mID of an existing remote endpoint group (provide this or --remote-endpoint-name + --remote-endpoint-subnets)
--remote-endpoint-name, -wName for a new remote endpoint group
--remote-endpoint-subnets, -zComma-separated remote CIDRs for a new remote endpoint group, e.g. 192.168.100.0/24,192.168.101.0/24
--router-id, -rID of the router to create the VPN on (required)
--vpn, -pConnection parameters as key=value: name, peer_address, psk, peer_id, local_id, initiator (bi-directional|response-only), dpd_action, dpd_interval, dpd_timeout (required)
CommandDescription
dtctl vpn listList VPN connections
dtctl vpn showShow a VPN connection
dtctl vpn updateUpdate a VPN connection
dtctl vpn deleteDelete a VPN connection
dtctl vpn endpointsShow a VPN's endpoints
dtctl vpn policiesShow a VPN's policies
dtctl vpn restartRestart a VPN connection

Global Flags​

OptionDescription
--api-urlSend this command to a different API endpoint, e.g. a test environment (default "https://console.dt.net.tr/api/v1")
--config, -cSpecify a custom config file
Default: ~/.config/dtctl/config.yaml
--no-headersOmit the column headers, for scripting
Default: false
--output, -oOutput format: text, wide, vertical, json. text fits the terminal, wide never truncates, vertical prints one field per line
Default: text