10G Core Routing Switch User Manual
陈泽科技有限公司
- - 24 - -
www.stephen-tele.com
6.2.2.
Assigning Static-Access Ports to a VLAN
You can assign a static-access port to a VLAN.
Beginning in privileged EXEC mode, follow these steps to assign a port to a VLAN
Command
Purpose
Step 1
config terminal
Enter global configuration mode.
Step 2
Interface
interface_id
Enter interface configuration mode for the physical
interface to be configured.
Step 3
switchport mode access
Define the VLAN membership mode for the port (Layer
2 access port).
Step 4
switchport access vlan
vlan_id
Assign the port to a VLAN. Valid VLAN IDs are 1 to
4094.
Step 5
end
Return to privileged EXEC mode.
Step 6
show Interface vlan
vlan_id
Verify your entries.
Step 7
Copy
running-config
startup-config
(Optional) Save your entries in the configuration file.
This example shows how to configure a port as an access port in VLAN 2:
Switch#
configure terminal
Switch(config)#
interface vlan 2
Switch(config)#
interface gigabitethernet 1/1
Switch(config-if)#
switchport mode access
Switch(config-if)#
switchport access vlan 2
6.2.3.
Configuring VLAN Trunks
These sections describe how VLAN trunks function on the switch:
Trunking Overview
A trunk is a point-to-point link between one or more Ethernet switch interfaces and another networking device such as
a router or a switch. Ethernet trunks carry the traffic of multiple VLANs over a single link, and you can extend the
VLANs across an entire network.
The trunking encapsulation 802.1Q is available on all Ethernet interfaces:
Configuring an Ethernet Interface as a Trunk Port
Because trunk ports send and receive VTP advertisements, to use VTP you must ensure that at least one trunk port is
configured on the switch and that this trunk port is connected to the trunk port of a second switch. Otherwise, the
switch cannot receive any VTP advertisements.
This section includes these procedures for configuring an Ethernet interface as a trunk port on the switch:
Beginning in privileged EXEC mode, follow these steps to configure a port as a 802.1Q trunk port:
Command
Purpose
Step 1
config terminal
Enter global configuration mode.
Step 2
Interface
interface_id
Enter interface configuration mode for the physical
interface to be configured.