Day One Tips
Highlighted
Day One Tips

Technique : Interface Range Command

‎11-12-2010 01:00 PM

 

You want to put interfaces from  ge-0/0/2 to ge-0/0/20 to vlan named "Vlan1" , You can do it one by one

Or , You can use Junos " Interface-Range " Command to make it faster & easier :

 

Example :

 

user@EX#set interfaces interface-range Range1 member-range ge-0/0/2 to ge-0/0/20;

user@EX#set interfaces interface-range Range1 unit 0 family ethernet-switching port-mode access;
user@EX#set interfaces interface-range Range1 unit 0 family ethernet-switching  vlan members Vlan1;

 

Verification:

 

User@EX> show vlans   
Name           Tag     Interfaces
default      
                      ge-0/0/0.0, ge-0/0/1.0 , ge-0/0/21.0, ge-0/0/22.0, ge-0/0/23.0
Vlan1     
                       ge-0/0/2.0*, ge-0/0/3.0, ge-0/0/4.0*, ge-0/0/5.0, ge-0/0/6.0, ge-0/0/7.0,
                       ge-0/0/8.0, ge-0/0/9.0, ge-0/0/10.0, ge-0/0/11.0, ge-0/0/12.0, ge-0/0/13.0,
                       ge-0/0/14.0, ge-0/0/15.0, ge-0/0/16.0, ge-0/0/17.0, ge-0/0/18.0, ge-0/0/19.0,
                       ge-0/0/20.0

 

 

 

 

 

3 REPLIES 3
Highlighted
Day One Tips

Re: Technique : Interface Range Command

‎11-16-2010 07:51 AM

Do these have to be sequential or can you use a separator value and select non-contiguous interfaces?

Highlighted
Day One Tips

Re: Technique : Interface Range Command

[ Edited ]
‎11-16-2010 08:20 AM

It can be non-Contiguous Values like the below :

 

user@EX#set interfaces interface-range Range1 member-range ge-0/0/2 to ge-0/0/10;

user@EX#set interfaces interface-range Range1 member-range ge-0/0/15 to ge-0/0/17;

user@EX#set interfaces interface-range Range1 member-range ge-0/0/19 to ge-0/0/20;

 

 

From ge-0/0/2 to ge-0/0/10 & from ge-0/0/15 to ge-0/0/17 & from ge-0/0/19 to ge-0/0/20

Highlighted
Day One Tips

Re: Technique : Interface Range Command

[ Edited ]
‎11-23-2010 01:34 PM

You can also use shell-globbing characters, e.g., I use this to set all my EX4200 VC end-stations ports to edge mode for STP:

 

 

user@sw> show configuration interfaces interface-range EDGE
member ge-0/0/*;
member "ge-1/0/[0-9]";
member ge-1/0/12;
member "ge-1/0/[15-46]";
member "ge-[2-8]/0/*";

user@sw> show configuration protocols mstp
...
interface EDGE {
    edge;
}
bpdu-block-on-edge;

 

Feedback