How to select only either odd or even ports in a cisco switch
dppagc
Member Posts: 293
in CCNA & CCENT
E.g odd ports
int ran gi1/0/1,3,5,7,....
Is there an easier way of doing it other than typing in all the port numbers one by one?
int ran gi1/0/1,3,5,7,....
Is there an easier way of doing it other than typing in all the port numbers one by one?
Comments
-
DoubleNNs Member Posts: 2,015 ■■■■■□□□□□What OS is the switch? IOS or NX-OS?
I've moved away from networking more towards *Nix, but I know NX-OS has python installed and allows for some basic REGEX and scripting. The method might also depend on what you're ultimately trying to accomplish.Goals for 2018:
Certs: RHCSA, LFCS: Ubuntu, CNCF CKA, CNCF CKAD | AWS Certified DevOps Engineer, AWS Solutions Architect Pro, AWS Certified Security Specialist, GCP Professional Cloud Architect
Learn: Terraform, Kubernetes, Prometheus & Golang | Improve: Docker, Python Programming
To-do | In Progress | Completed -
Alceo Member Posts: 80 ■■□□□□□□□□If you need it only once I don't know a way, if you need it multiple times you can define a "macro", for example:
define interface-range ODD_INTERFACES fastEthernet 0/1 , fastEthernet 0/3 , fastEthernet 0/5 .......
and then use it:
interface range macro ODD_INTERFACES -
Jasiono Member Posts: 896 ■■■■□□□□□□Yeah but once you have the macro it will be quicker in the future.