Switching

last person joined: 3 days ago 

Ask questions and share experiences about EX and QFX portfolios and all switching solutions across your data center, campus, and branch locations.
  • 1.  How to add or remove multiple VLANs from few interfaces without using full VLAN name?

    Posted 07-25-2016 05:08

    Hi

     

    I'm confusing with managing VLANs on my EX4550. In Extreme Summit X650 I could simple use AWK to prepare commnads for adding or removing VLANs without using full names:

     

    config vlan v118- add ports tagged 17,28
    config vlan v150- add ports tagged 17,28
    config vlan v315- add ports tagged 17,28

     

    where v118- have full name v118-R1C1 and tag 118, v150-  full name is v150-D3T2 and tag 150, and so on. 

     

    How can I manage VLANs on my EX4550 in the same way?

     


    #EX
    #JUNOS
    #vlan


  • 2.  RE: How to add or remove multiple VLANs from few interfaces without using full VLAN name?

     
    Posted 07-25-2016 06:03

    Hi,

     

    There are 2 ways possible to assign vlans to an interface in JUNOS:

     

    1. Under edit vlans vlan-name -> set interface x/x/x

    2. Under edit interfaces x/x/x unit 0 family ethernet-switching -> set vlan members vlan-name

     

    With method 1, if you have multiple vlans on same group of interfaces you could use copy vlan xxx to vlan yyy. The vlan-id will need to be changed but the interfaces will be copied.

     

    In Junos EX config, the vlan-name is the reference for the vlan.

     

    Cheers,

    Ashvin



  • 3.  RE: How to add or remove multiple VLANs from few interfaces without using full VLAN name?

    Posted 07-25-2016 06:53

    Unfortunately for these ways I need to know full names of all VLANs or do it manualy using TAB key. 

     

    Is there any way using tags instead of vlan-names?

    Can I change a vlan-name though all system config in one command?



  • 4.  RE: How to add or remove multiple VLANs from few interfaces without using full VLAN name?

     
    Posted 07-25-2016 08:17

    Hi, 

     

    AFAIK, we cannot use vlan-ids or tags on EXs. This is possible under family bridge [MX/SRX] with vlan-id-list. Example:

    interfaces ae2 {
    unit 0 {
    family bridge {
    interface-mode trunk;
    vlan-id-list 100, 200–205;
    }
    }
    }

    To change vlan-name in whole config, you could use "replace pattern xxxx with yyyy"

    With method 1, the vlan-name would be present in only one line of the configuration hierarchy.

     

    Hope this helps.

     

    Cheers,

    Ashvin 

     



  • 5.  RE: How to add or remove multiple VLANs from few interfaces without using full VLAN name?
    Best Answer

    Posted 07-25-2016 12:36

    You could just name the vlan with their id, only constraint is that there has to be at least one character. Then use the description to show what the vlan is for. Then you can refer to a number.

     

    jh@fw# show vlans
    v100 {
        description "test vlan";
        vlan-id 100;
    }
    
    jh@fw# show interfaces ge-0/0/4.0
    family ethernet-switching {
        vlan {
            members v100;
        }
    }

    As 

     

    jh@fw# edit interfaces
    
    [edit interfaces]
    jh@fw# show ge-0/0/4.0
    family ethernet-switching {
        vlan {
            members v100;
        }
    }
    
    [edit interfaces]
    jh@fw# replace pattern "v100" with "v200"
    
    [edit interfaces]
    jh@fw# show ge-0/0/4.0
    family ethernet-switching {
        vlan {
            members v200;
        }
    }
    
    [edit interfaces]
    jh@fw#


  • 6.  RE: How to add or remove multiple VLANs from few interfaces without using full VLAN name?

    Posted 07-28-2016 23:48

    Thanks! Replace pattern is a key to rename vlans and then add or remove them quickly.