CLI ReferenceInterface Configuration Commands  Interface Configuration Commands 
 
switchport mode 
 
Use this command to assign a L2 interface (switch port) mode. You can designate 
this interface as an access port or a trunk port or an 802.1Q tunnel. Add no in the 
command to restore it to the default. 
switchport mode {access | trunk} 
Configure the switch port as an access port. 
Configure the switch port as a trunk port. 
By default, the switch port is an access port. 
Interface configuration mode. 
If a switch port is an access port, it can be a member port of only one 
VLAN.  Use  switchport  access  vlan  to  specify  the  member  of  the 
VLAN. 
A trunk port can be a member port of various VLANs on the allowed-VLAN list. The 
allowed VLAN list of the interface determines the VLANs of the interface. The trunk 
port is the member of all the VLANs  on the allowed VLAN list. Use switchport 
trunk to define the allowed-VLANs list. 
Ruijie(config-if)# switchport mode trunk 
Use  this  command  to  configure  an  interface  as  a  static 
access port and assign it to a VLAN. 
Use  this  command  to  specify  a  native  VLAN  and  the 
allowed-VLAN list for the trunk port.