Configuration Guide Interface Configuration
Configuring Switch Ports
Configuring Access/Trunk Port
This section is devoted to the setting of working modes (access/trunk port) of switch port and
the setting in each mode.
To set the related attributes of a switch port, use the switchport command or other commands
in the interface configuration mode:
Ruijie(config-if)# switchport mode {access |
trunk }
The following example shows how to set the operation mode of Gigabitethernet 1/2 to access
port.
Ruijie# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Ruijie(config)# interface gigabitethernet 1/2
Ruijie(config-if)# switchport mode access
Ruijie(config-if)# end
Ruijie(config-if)# switchport access vlan vlan-id
Set the VLAN to which the
access port belongs.
The following example shows how to configure the VLAN to which the access port
gigabitethernet 2/1 to be 100
Ruijie# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Ruijie(config)# interface gigabitethernet 2/1
Ruijie(config-if)# switchport access vlan 100
Ruijie(config-if)# end
Set the native VLAN of the trunk port.
Ruijie(config-if)# switchport trunk native vlan
vlan-id
Set the Native VLAN of the trunk
port.
The following example shows how to set the native VLAN of the trunk port Gigabitethernet 2/1
to be 10.
Ruijie# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Ruijie(config)# interface gigabitethernet 2/1
Ruijie(config-if)# switchport trunk native vlan 10
Ruijie(config-if)# end
Set port security. For more information about port security, refer to Port-based Flow Control: