Calling Variable in XOS 15.X

  • 0
  • 1
  • Question
  • Updated 4 years ago
Create Date: Aug 23 2012 9:24AM

I am trying to set a variable to a port number (or range) and apply the variable when configuring a vlan:

set var uplink 1:48
config vlan vlan200 add port $uplink tag

I can see that the variable gets created and is correctly '1:48', however the config vlan command fails with the ^ pointing at the 'u' in uplink.

I am just using the scripting basics guide as my reference (they do this using $count to assign a vlan to a port), has the variable call changed in 15.X or am i simply doing something wrong / unsupported?

Thanks.
(from Nick_Lindhag)
Photo of EtherNation User

EtherNation User, Employee

  • 20,340 Points 20k badge 2x thumb

Posted 4 years ago

  • 0
  • 1
Photo of EtherNation User

EtherNation User, Employee

  • 20,340 Points 20k badge 2x thumb
Create Date: Aug 23 2012 9:36AM

  • Make sure vlan200 is tagged 
  • Put quotes around set var uplink "1:48"
  • Try referencing the variable with $(uplink) instead of $uplink. This helps when a variable has a special character in it. 

Hope this helps.

(from john_padilla)
Photo of EtherNation User

EtherNation User, Employee

  • 20,340 Points 20k badge 2x thumb
Create Date: Aug 23 2012 9:46AM

Thank you for the response, i have this working now.  My issue was very noob :(. I wrote the script to be used after we have enabled stacking but was testing on a new switch (stacking was not yet enabled).  I found this out by removing my "1:" and the command worked.

(from Nick_Lindhag)

This conversation is no longer open for comments or replies.