Options

How to select only either odd or even ports in a cisco switch

dppagcdppagc Member Posts: 293
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?

Comments

  • Options
    DoubleNNsDoubleNNs 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
  • Options
    AlceoAlceo 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
  • Options
    Fulcrum45Fulcrum45 Member Posts: 621 ■■■■■□□□□□
    Good tip Alceo, thanks!
  • Options
    dppagcdppagc Member Posts: 293
    So you guys are saying that either way I have to type it in manually?
  • Options
    JasionoJasiono Member Posts: 896 ■■■■□□□□□□
    Yeah but once you have the macro it will be quicker in the future.
Sign In or Register to comment.