How to get the possible port range on a switch within a script?

  • 0
  • 1
  • Question
  • Updated 5 years ago
  • Answered
Create Date: Jun 22 2012 2:04AM

Hi!

I want to write a script for Ridgeline that enables 802.1x on all ports that have MAC authentication enabled. The problem now is that I've following x450e setups:


  • 24 Port

  • 48 Port

  • 48 + 24 Port (stacked)

  • 48 + 48 Port (stacked)


Whats the best way to get the port range used on this stack/switch so I can execute for example:

enable netlogin ports 1:1-48, 2:1-24 dot1x

Thx for your help.

(from Robert_Penz)
Photo of EtherNation User

EtherNation User, Employee

  • 20,340 Points 20k badge 2x thumb

Posted 5 years ago

  • 0
  • 1
Photo of EtherNation User

EtherNation User, Employee

  • 20,340 Points 20k badge 2x thumb
Create Date: Aug 3 2012 6:11AM

I would have a script parse through a "show config netlogin" command and grab all the ports with the "enable netlogin <port> port mac". Once the ports are added to a list, then they can easily be added to a "enable netlogin ports <port> dot1x" command. 


(from john_padilla)

This conversation is no longer open for comments or replies.