Skip to main content

Tunnel Interface

Tunnel interfaces are virtual interfaces used for VPN tunnels and encapsulation. The scm CLI provides commands to create, update, delete, and load tunnel interfaces.

Overview

The tunnel-interface commands allow you to:

  • Create tunnel interfaces with IP addressing
  • Update existing tunnel interface configurations
  • Delete tunnel interfaces that are no longer needed
  • Bulk import tunnel interfaces from YAML files
  • Export tunnel interfaces for backup or migration

Set Tunnel Interface

Create or update a tunnel interface.

Syntax

scm set network tunnel-interface NAME [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMEName of the tunnel interfaceYes

Options

OptionDescriptionRequired
--folder TEXTFolder locationYes*
--snippet TEXTSnippet locationYes*
--device TEXTDevice locationYes*
--comment TEXTInterface descriptionNo
--default-value TEXTDefault interface (e.g. tunnel.1)No
--mtu INTEGERMTU (576-9216)No
--ip-json TEXTStatic IPs as JSONNo

* Exactly one of --folder, --snippet, or --device is required.

Examples

Create a Tunnel Interface

$ scm set network tunnel-interface tunnel.1 \
--folder Texas \
--ip-json '[{"name": "10.0.0.1/30"}]' \
--comment "VPN tunnel"
---> 100%
Created tunnel interface: tunnel.1 in folder Texas

Create a Tunnel Interface with Custom MTU

$ scm set network tunnel-interface tunnel.2 \
--folder Texas \
--ip-json '[{"name": "10.0.0.5/30"}]' \
--mtu 1400 \
--comment "Site-to-site VPN"
---> 100%
Created tunnel interface: tunnel.2 in folder Texas

Delete Tunnel Interface

Delete a tunnel interface from SCM.

Syntax

scm delete network tunnel-interface NAME [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMEName of the tunnel interface to deleteYes

Options

OptionDescriptionRequired
--folder TEXTFolder locationYes*
--snippet TEXTSnippet locationYes*
--device TEXTDevice locationYes*
--forceSkip confirmation promptNo

* Exactly one of --folder, --snippet, or --device is required.

Example

$ scm delete network tunnel-interface tunnel.1 --folder Texas --force
---> 100%
Deleted tunnel interface: tunnel.1 from folder Texas

Load Tunnel Interface

Load multiple tunnel interfaces from a YAML file.

Syntax

scm load network tunnel-interface [OPTIONS]

Options

OptionDescriptionRequired
--file TEXTPath to YAML fileYes
--folder TEXTOverride folder location for all objectsNo
--snippet TEXTOverride snippet location for all objectsNo
--device TEXTOverride device location for all objectsNo
--dry-runPreview changes without applyingNo

YAML File Format

---
tunnel_interfaces:
- name: tunnel.1
folder: Texas
comment: "VPN tunnel to site A"
ip:
- name: "10.0.0.1/30"

- name: tunnel.2
folder: Texas
comment: "VPN tunnel to site B"
mtu: 1400
ip:
- name: "10.0.0.5/30"

Examples

Load with Original Locations

$ scm load network tunnel-interface --file tunnels.yml
---> 100%
✓ Loaded tunnel interface: tunnel.1
✓ Loaded tunnel interface: tunnel.2

Successfully loaded 2 out of 2 tunnel interfaces from 'tunnels.yml'

Load with Folder Override

$ scm load network tunnel-interface --file tunnels.yml --folder Austin
---> 100%
✓ Loaded tunnel interface: tunnel.1
✓ Loaded tunnel interface: tunnel.2

Successfully loaded 2 out of 2 tunnel interfaces from 'tunnels.yml'
note

When using container override options (--folder, --snippet, --device), all tunnel interfaces will be loaded into the specified container, ignoring the container specified in the YAML file.

Show Tunnel Interface

Display tunnel interface objects.

Syntax

scm show network tunnel-interface [NAME] [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMEName of the tunnel interface to show; omit to list allNo

Options

OptionDescriptionRequired
--folder TEXTFolder locationYes*
--snippet TEXTSnippet locationYes*
--device TEXTDevice locationYes*
--max-results INTEGERMaximum number of results to displayNo
--output [table|json|yaml]Output format (default: table)No

* Exactly one of --folder, --snippet, or --device is required.

note

When no NAME argument is provided, all items are listed by default.

Examples

Show Specific Tunnel Interface

$ scm show network tunnel-interface tunnel.1 --folder Texas
---> 100%
Tunnel Interface: tunnel.1
Location: Folder 'Texas'
Comment: VPN tunnel
IP: 10.0.0.1/30

List All Tunnel Interfaces (Default Behavior)

$ scm show network tunnel-interface --folder Texas
---> 100%
Tunnel interfaces in folder 'Texas':
------------------------------------------------------------
Name: tunnel.1
Comment: VPN tunnel
IP: 10.0.0.1/30
------------------------------------------------------------
Name: tunnel.2
Comment: Site-to-site VPN
IP: 10.0.0.5/30
------------------------------------------------------------

Backup Tunnel Interfaces

Backup all tunnel interface objects from a specified location to a YAML file.

Syntax

scm backup network tunnel-interface [OPTIONS]

Options

OptionDescriptionRequired
--folder TEXTFolder locationNo*
--snippet TEXTSnippet locationNo*
--device TEXTDevice locationNo*
--file TEXTCustom output filenameNo

* One of --folder, --snippet, or --device is required.

Examples

Backup from Folder

$ scm backup network tunnel-interface --folder Texas
---> 100%
Successfully backed up 6 tunnel interfaces to tunnel_interface_folder_texas_20240115_120530.yaml

Backup with Custom Filename

$ scm backup network tunnel-interface --folder Texas --file texas-tunnels.yaml
---> 100%
Successfully backed up 6 tunnel interfaces to texas-tunnels.yaml

Best Practices

  1. Use /30 Subnets: Assign /30 subnets for point-to-point tunnel interfaces to conserve IP addresses.
  2. Set Appropriate MTU: Reduce MTU below the physical interface to account for tunnel encapsulation overhead.
  3. Add Descriptive Comments: Document which VPN or site each tunnel interface connects to.
  4. Test with Dry Run: Use --dry-run when loading configurations to preview changes before applying.
  5. Backup Before Changes: Always backup existing tunnel configurations before making bulk modifications.