JunOS Switch VLANs and Trunk Ports

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.
  • Create the following VLANs and configure the correct names:
  • VLAN 10: name Managment.
  • VLAN 20: name Admin.
  • VLAN 30: name IT.
  • VLAN 40: name Accounts.
  • Configure Ge-0/0/0 as an access interface in VLAN 10.
  • Configure Ge-0/0/1 as an access interface in VLAN 20.
  • Configure Ge-0/0/22 as a Trunk interface for all VLANs in once.
  • Configure Ge-0/0/23 as a Trunk interface for  VLAN 10,20,40.

Configuration of VLANs

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

Configuration of Access Ports

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 MANAGEMENT
root@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

Configuration of Trunk Ports

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 all
This 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 all
Another 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]

Verification Commands

root@SW1>show vlan ( For Verify VLAN and VLAN Member Ports)
sureshthapa@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

Comments