Layer-3 Switch configuration-configure a group of layer-2 ports
- Configure terminal enters configuration status
- Nterface range {port-range} enters the group configuration status
Layer-3 Switch configuration-configure Layer-3 Ports
- Configure terminal enters configuration status
- Interface {fastethernet | gigabitethernet} interface-id} | {vlan-id} | {port-channel-number} enter the port configuration status
- No switchport changes the physical port to a layer-3 Port
- Ip address ip_address subnet_mask configure the ip address and mask
- No shutdown activation Port
Example:
- Switch(config)# interface gigabitethernet0/2
- Switch(config-if)# no switchport
- Switch(config-if)# ip address 192.20.135.21 255.255.255.0
- Switch(config-if)# no shutdown
Layer-3 Switch configuration --Configure VLAN
- Configure terminal enters configuration status
-
- Vlan-id: enter a VLAN id and then enter the vlan configuration state. You can enter a new VLAN id or the old one for modification.
-
- Name vlan-name (optional) enter a VLAN name. If no VLAN name is configured, the default name is the four-digit number filled with 0 before the VLAN number. For example, VLAN0004 is the default name of vlan4.
-
- Mtu-size (optional) Change MTU size
Example:
- Switch # configure terminal
- Switch (config) # vlan 20
- Switch (config-vlan) # name test20
- Switch (config-vlan) # end
- Or
- Switch # vlan database
- Switch (vlan) # vlan 20 name test20
- Switch (vlan) # exit
Layer-3 Switch configuration-- The port is assigned to a VLAN.
- Configure terminal enters configuration status
- Interface-id: enter the port to be allocated
- Switchport mode access defines L2 ports
- Switchport access vlan-id assigns a port to a VLAN
Example:
- Switch # configure terminal
- Enter configuration commands, one per line. End with CNTL/Z.
- Switch (config) # interface fastethernet0/1
- Switch (config-if) # switchport mode access
- Switch (config-if) # switchport access vlan 2
- Switch (config-if) # end
- Switch #
- Configure VLAN trunk
- Configure terminal enters configuration status
- Interface-Id: enter the port configuration status
- Switchport trunk encapsulation {isl | dot1q | negotiate} configure trunk to encapsulate ISL or 802.1Q or
Layer-3 Switch configuration-Automatic negotiation
Example:
- Switchport mode {dynamic {auto | desirable} | trunk}: configure the layer-2 trunk mode.
- Dynamic auto-automatically negotiate whether it is a trunk
- Dynamic desirable-set the port to trunk. If the peer ports are trunk and desirable, configure Native VLAN
- 802.1q) or in automatic mode, trunk-sets the port to the forced trunk mode, regardless of whether the peer port is trunkswitchport access vlan-id (optional)
- Specify a default VLAN. If the port is no longer trunkswitchport trunk native vlan-id, specify the 802.1Q native VLAN number.
- Switch# configure terminal
- Enter configuration commands, one per line. End with CNTL/Z.
- Switch(config)# interface fastethernet0/4
- Switch(config-if)# switchport mode trunk
- Switch(config-if)# switchport trunk encapsulation dot1q
- Switch(config-if)# end
Layer-3 Switch configuration --Define the VLAN allowed by the TRUNK
- Configure terminal Sub-entry configuration status
- Interface-id: enter port configuration
- Switchport mode trunk: configure the Layer 2 port as trunk
- Switchport trunk allowed vlan {add | all | listen t | remove} vlan-list (optional) configure the VLAN allowed by the trunk. Use add, all, listen t, remove
- No switchport trunk allowed vlan allows all VLANs to pass through
Example:
- Switch(config)# interface fastethernet0/1
- Switch(config-if)# switchport trunk allowed vlan remove 2
- Switch(config-if)# end
Layer-3 Switch configuration-configure Native VLAN802.1q)
- Configure terminal enters configuration status
- Interface-id: enter the port configured as 802.1qtrunk
- Switchport trunk native vlan-Id configuration native VLAN number
- No switchport trunk native vlan port configuration command returns to the default status
Layer-3 Switch configuration-configure Load Balancing Based on port Weights
- Configure terminal enters Switch 1 configuration status
- Vtp domain-name configuration VTP domain
- Vtp mode server configures Switch 1 to VTP server.
- Show vtp status verify VTP Configuration
- Show vlan verification VLAN
- Configure terminal enters configuration status
- Interface fastethernet 0/1 enters port F0/1
- Switchport trunk encapsulation {isl | dot1q | negotiate} configure trunk encapsulation
- Configure switchport mode trunk to trunk
- Show interfaces fastethernet0/1 switchport verify VLAN configuration