Does anyone have a script to get the ports in a VLAN and then create a new VLAN and add those ports to it?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎05-02-2019 05:33 PM
We routinely create new VLANs that have the same ports as our "golden" VLAN. I was curious if a) it's possible and b) if anyone has a script that would prompt for the name of the new VLAN and tag, and then create a new VLAN that containing the same ports as the ones in our reference VLAN?
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎05-07-2019 05:11 PM
What if your seed VLAN has untagged ports ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎05-03-2019 07:15 PM
Hi Stephen,
Never tried such script yet, but it would be a nice challenge to create one that could 'clone' a VLAN of specific tag, based on a reference VLAN.
Pseudocode could be as follows:
If you wanted, you could also create a workflow with XMC 8.2 to determine a switch OS type and run a script for that which is OS-relevant, so you would have such workflow flexible to configure a group of mixed-OS devices.
Hope that helps,
Tomasz
P.S. After a while I see no sense in my "loop for each port". They can rather be merged and comma separated from the table (or spaces removed from the original CLI output without even playing with a table) and one shot to add them all is enough then.
Never tried such script yet, but it would be a nice challenge to create one that could 'clone' a VLAN of specific tag, based on a reference VLAN.
Pseudocode could be as follows:
- Show vlan [reference VID from user form in XMC or XOS prompt] | begin "Tag:"
- Parse the output string to get a 1-dimensional table with ports
- Loop for each port (or for i = 0:length(table)-1): configure vlan [target VID from user form in XMC or XOS prompt] add port [port from the table] tagged
If you wanted, you could also create a workflow with XMC 8.2 to determine a switch OS type and run a script for that which is OS-relevant, so you would have such workflow flexible to configure a group of mixed-OS devices.
Hope that helps,
Tomasz
P.S. After a while I see no sense in my "loop for each port". They can rather be merged and comma separated from the table (or spaces removed from the original CLI output without even playing with a table) and one shot to add them all is enough then.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎05-03-2019 01:48 PM
Currently we would be running it on a X460-48t running 16.2.4.5, but that will eventually be replaced by an X440-G2. We do have XMC, so preferable using that but we could also run it via XOS.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎05-03-2019 06:45 AM
What switch ? XOS ?
And where would you run the script from ? XMC or XOS ?
And where would you run the script from ? XMC or XOS ?
