Appendix D: Example Template


The following is an example template for switch N3248PXE-ON, which include host name, OOB Management IP and gateway. For details about how to use global configuration, see Staging a Switch for Automated Deployment in AmpCon.

name: N3248PXE-ON-Nov20
description: N3248PXE-ON-Nov20
platform: N3248PXE-ON
content_start:


{#::::: For input Variable::::#}

set system hostname {{ Hostname }}
{% if Hostname %}
set protocols static route 0.0.0.0/0 next-hop {{ Default_gateway }}
{% endif %}

{#::::: Basic PoE config::::#}
set poe interface all enable true

{#::::: Basic VLAN config::::#}
set vlans vlan-id {{Data_VLAN_id}} vlan-name "DataVlan1"
set vlans vlan-id {{Data_VLAN_id}} l3-interface Vlan{{Data_VLAN_id}}
set l3-interface vlan-interface Vlan{{Data_VLAN_id}} address {{Data_VLAN_IP_Address_Mask.split('/')[0]}} prefix-length {{Data_VLAN_IP_Address_Mask.split('/')[1]}}

set vlans vlan-id {{Voice_VLAN_id}}


{#:::::For ports 1/1/1 through 1/1/24:data vlan 100 voice 101 ::::#}
{% for i in range(1,51) %}
set interface gigabit-ethernet te-1/1/{{ i }} family ethernet-switching port-mode "trunk"
{#::::: Inband port :::::#}
set interface gigabit-ethernet te-1/1/{{ i }} family ethernet-switching native-vlan-id {{Data_VLAN_id}}
set interface gigabit-ethernet te-1/1/{{ i }} voice-vlan vlan-id {{Voice_VLAN_id}}
{% endfor %}

{#::::: Outband port :::::#}
set system management-ethernet eth0 ip-address IPv4 {{Management_IP_Address_Mask.split('/')[0]}}/{{Management_IP_Address_Mask.split('/')[1]}}
set system management-ethernet eth0 ip-gateway IPv4 192.168.42.1



content_end$
param_start:
{
"Hostname": {
"param_default": "P8-Access-BR-1-SW-1",
"type": "text",
"required": "not required",
"description": "Configure the hostname",
"param_check": ""
},
"Management_IP_Address_Mask": {
"param_default": "192.168.42.169/24",
"type": "text",
"required": "required",
"description": "Configure management IP mask.e.g. 192.168.42.169/24",
"param_check": ""
},
"Default_gateway": {
"param_default": "192.168.42.1",
"type": "IPv4",
"required": "required",
"description": "Configure the default gateway e.g 192.168.42.1",
"param_check": ""
},
"Data_VLAN_id": {
"param_default": "10",
"type": "text",
"required": "required",
"description": "Configure Data VLAN id , e.g. 10",
"param_check": ""
},
"Data_VLAN_IP_Address_Mask": {
"param_default": "192.168.43.169/24",
"type": "text",
"required": "required",
"description": "Configure management IP mask.e.g. 192.168.43.169/24",
"param_check": ""
},
"Voice_VLAN_id": {
"param_default": "800",
"type": "text",
"required": "required",
"description": "Configure Voice VLAN id , e.g. 800",
"param_check": ""
}
}



param_end$

This is just an illustration. Please ensure the CLIs you use are compatible with the version of PicOS being used.



Copyright © 2024 Pica8 Inc. All Rights Reserved.