Wired Intelligent Edge (Campus Switching and Routing)

 View Only
last person joined: one year ago 

Bring performance and reliability to your network with the HPE Aruba Networking Core, Aggregation, and Access layer switches. Discuss the latest features and functionality of HPE Aruba Networking switching devices, and find ways to improve security across your network.

Changing Port Level Config Of One Of The Switches In A Template Group From Aruba Central 

Sep 30, 2021 03:15 PM

Problem:

  • We had two switches Switch-PFR1 and Switch-PFR2 in template group on Aruba Central.
  • These switches were Up and In-sync on central.

 

  • Both these switches had same config (except hostname and ip address)
  • All the ports were part of VLAN 1.
  • Requirement was to have port 1/1/2 of Switch-PFR2 to be part of VLAN 100.
  • However port 1/1/2 of Switch-PFR1 would need to be part of VLAN 1.

 

Template :

 

#This template is imported from device "Switch-PFR1" with serial "SG07KN501D"

!
!Version ArubaOS-CX FL.10.06.0120
!export-password: default
hostname %_sys_hostname%
user admin group administrators password plaintext *****
ntp enable
!
!
!
!
ssh server vrf default
ssh server vrf mgmt
vsf member 1 
    type jl666a
vlan 1,100
spanning-tree
interface mgmt
    no shutdown
    ip dhcp
interface 1/1/1
    no shutdown
    no routing
    vlan access 1
interface 1/1/2
    no shutdown
    no routing
    vlan access 1
interface 1/1/3
    no shutdown
    no routing
    vlan access 1
interface 1/1/4
    no shutdown
    no routing
    vlan access 1

 

Switch-PFR1 Truncated Config :

 

Switch-PFR1# sh running-config
Current configuration:
!
!Version ArubaOS-CX FL.10.06.0120
!export-password: default
hostname Switch-PFR1
user admin group administrators password ciphertext AQBapa54LU8IuF38JPo3XMsO0pPskObnPlWLfJf5+CmgKOlEYgAAAEHGhhVbCiC2j8/XyqHEz5glvCOyVWmTq2O732DbO7YFTEGqvEIeizuu1K8FJCx51gMXjpMsEN1ZJvjQGQ6dTeAv1ewMvMCs8Kf+CeoL05cONOXfBMgsHMXzeaZKpL/6gsQU
ntp enable
!
!
!
!
ssh server vrf default
ssh server vrf mgmt
vsf member 1
    type jl666a
vlan 1,100
spanning-tree
interface mgmt
    no shutdown
    ip dhcp
interface 1/1/1
    no shutdown
    no routing
    vlan access 1
interface 1/1/2
    no shutdown
    no routing
    vlan access 1

 

Switch-PFR2 Truncated Config :

 

Switch-PFR2# sh running-config
Current configuration:
!
!Version ArubaOS-CX FL.10.06.0120
!export-password: default
hostname Switch-PFR2
user admin group administrators password ciphertext AQBapWBG9gMpFfHfkzSWm2JcGCyZ6cOq4djFaMi79zDPpK1mYgAAAD8zPmCStR6LYXfbfYu0oKMk1FnwCkUMZhnfVcTraEYVF5IjDiP6qOkSrhb/9NUugCd8BW9mNp2qlr2u4UuBaGT7R3bOJMb1ifVMhfEI/Yvg/T7ufc2Z1SZblNi3ZCMSSZKY
ntp enable
!
!
!
!
ssh server vrf default
ssh server vrf mgmt
vsf member 1
    type jl666a
vlan 1,100
spanning-tree
interface mgmt
    no shutdown
    ip dhcp
interface 1/1/1
    no shutdown
    no routing
    vlan access 1
interface 1/1/2
    no shutdown
    no routing
    vlan access 1



Diagnostics:

 

  • If we made changes directly on the template on port 1/1/2, the config would be pushed to both the switches and port 1/1/2 would be part of VLAN 100.

 

 

 

 



Solution

 

  • This can be solved using two methods.

1. Using If else statement in the template.

2. Using a variable in the template.

 

Method 1 : Using If else statement in the template.

  • We can identify switches based on hostname and write following condition.
  • If hostname is equal to Switch-PFR2 than 1/1/2 port would be part of VLAN 100, else port 1/1/2 would be part of VLAN 1.
%if _sys_hostname=Switch-PFR2%
interface 1/1/2
    no shutdown
    no routing
    vlan access 100
%else%
interface 1/1/2
    no shutdown
    no routing
    vlan access 1
%endif%

 

 

Verification :

 

  • After making the changes we could see that port 1/1/2 of Switch-PFR1 is part of VLAN 1 and port 1/1/2 of Switch-PFR2 is part of VLAN 100.

 

 

Method 2 : Using a variable in the template.

 

  • We download the variable file.

Devices > Switches > Config > Variables > Download Variables

  • An excel file would get downloaded.
  • Edit the excel file and create a new variable. Here I will call the variable as var
  • Assign values to all the switch for that variable. I have assigned value as 1 for Switch-PFR1 and value 100 for Switch-PFR2.
  • Here the values indicate the vlan id.
  • Change modified filed values to Y from N.

  • Upload it to central by clicking on Upload Variables File.
  • Once it is successfully uploaded you should see the following prompt and the variable should be displayed as shown below/

 

  • Then we call this variable under interface 1/1/2 in the template as shown below.
interface 1/1/2
    no shutdown
    no routing
    vlan access %var%

 

 

Verification :

 

  • After making the changes we could see that port 1/1/2 of Switch-PFR1 is part of VLAN 1 and port 1/1/2 of Switch-PFR2 is part of VLAN 100.

 

 

 

Statistics
0 Favorited
14 Views
0 Files
0 Shares
0 Downloads

Related Entries and Links

No Related Resource entered.