In this section, we will discuss. How to configure VLANs, Access Port and Trunk ports in Juniper Switches.For this JunOS Switch VLANs and Trunk Ports configuration, I am using Real Juniper Switch EX2200.
root@SW1#set vlans <vlan-name> vlan-id <vlan-no>root@SW1#set vlans MANAGEMENT vlan-id 10
root@SW1#set vlans ADMIN vlan-id 20
root@SW1#set vlans IT vlan-id 30
root@SW1#set vlans ACCOUNTS vlan-id 40
root@SW1#set interfaces <interface-name> unit 0 family ethernet-switching port-mode <port-mode>(ex- access or trunk)
root@SW1#set interfaces <interface-name> unit 0 family ethernet-switching vlan members <vlan-name>root@SW1#set interfaces ge-0/0/0 unit 0 family ethernet-switching port-mode access
root@SW1#set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members MANAGEMENTroot@SW1#set interfaces ge-0/0/1 unit 0 family ethernet-switching port-mode access
root@SW1#set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members ADMIN
root@SW1#set interfaces <interface-name> unit 0 family ethernet-switching port-mode <port-mode>(ex- access or trunk)
root@SW1#set interfaces <interface-name> unit 0 family ethernet-switching vlan members allThis is for allow all VLANs in once.root@SW1#set interfaces ge-0/0/22 unit 0 family ethernet-switching port-mode trunk
root@SW1#set interfaces ge-0/0/22 unit 0 family ethernet-switching vlan members allAnother Way is Allow specific VLANs .root@SW1#set interfaces ge-0/0/23 unit 0 family ethernet-switching port-mode trunk
root@SW1#set interfaces ge-0/0/23 unit 0 family ethernet-switching vlan members [MANAGEMENT ADMIN ACCOUNTS]
root@SW1>show vlan ( For Verify VLAN and VLAN Member Ports)
root@AC7_WFH> show ethernet-switching interfaces detail | match trunk (Verify Trunk Ports)
Interface: ge-0/0/22.0, Index: 66, State: up, Port mode: Trunk
Interface: ge-0/1/23.0, Index: 114, State: up, Port mode: Trunk