Cisco CISCO876-SEC-I-K9 Configuration Guide - Page 64

Assign a Switch Port to a VLAN, Verify Your VLAN Configuration

Page 64 highlights

Configure VLANs Chapter 5 Configuring a LAN with DHCP and VLANs Assign a Switch Port to a VLAN Perform these steps to assign a switch port to a VLAN, beginning in global configuration mode: Command Step 1 interface switch port id Example: Router(config)# interface FastEthernet 2 Router(config-if)# Purpose Specifies the switch port that you want to assign to the VLAN. Step 2 switchport access vlan vlan-id Assigns a port to the VLAN. Example: Router(config-if)# switchport access vlan 2 Router(config-if)# Step 3 end Example: Router(config-if)# end Router# Exits interface mode and returns to privileged EXEC mode. Verify Your VLAN Configuration Use the following commands to view your VLAN configuration. • show-Entered from VLAN database mode. Displays summary configuration information for all configured VLANs. • show vlan-switch-Entered from privileged EXEC mode. Displays detailed configuration information for all configured VLANs. Router# vlan database Router(vlan)# show VLAN ISL Id: 1 Name: default Media Type: Ethernet VLAN 802.10 Id: 100001 State: Operational MTU: 1500 Translational Bridged VLAN: 1002 Translational Bridged VLAN: 1003 VLAN ISL Id: 2 Name: VLAN0002 Media Type: Ethernet VLAN 802.10 Id: 100002 State: Operational MTU: 1500 Cisco 850 Series and Cisco 870 Series Access Routers Software Configuration Guide 5-6 OL-5332-01

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196

5-6
Cisco 850 Series and Cisco 870 Series Access Routers Software Configuration Guide
OL-5332-01
Chapter 5
Configuring a LAN with DHCP and VLANs
Configure VLANs
Assign a Switch Port to a VLAN
Perform these steps to assign a switch port to a VLAN, beginning in global configuration mode:
Command
Purpose
Step 1
interface
switch port id
Example:
Router(config)#
interface FastEthernet 2
Router(config-if)#
Specifies the switch port that you want to assign
to the VLAN.
Step 2
switchport
access vlan
vlan-id
Example:
Router(config-if)#
switchport access vlan 2
Router(config-if)#
Assigns a port to the VLAN.
Step 3
end
Example:
Router(config-if)#
end
Router#
Exits interface mode and returns to privileged
EXEC mode.
Verify Your VLAN Configuration
Use the following commands to view your VLAN configuration.
show
—Entered from VLAN database mode. Displays summary configuration information for all
configured VLANs.
show vlan-switch
—Entered from privileged EXEC mode. Displays detailed configuration
information for all configured VLANs.
Router#
vlan database
Router(vlan)#
show
VLAN ISL Id: 1
Name: default
Media Type: Ethernet
VLAN 802.10 Id: 100001
State: Operational
MTU: 1500
Translational Bridged VLAN: 1002
Translational Bridged VLAN: 1003
VLAN ISL Id: 2
Name: VLAN0002
Media Type: Ethernet
VLAN 802.10 Id: 100002
State: Operational
MTU: 1500