Continue with configuration dialog? [y/n]:
Continue with configuration dialog? [y/n]:
switch>
switch>enable
switch#
switch#show vlan
VLAN Name Type Media Ports
---- ------------ ---------- --------- ----------------------------------------
1 default Static ENET Ethernet0/0/1 Ethernet0/0/2
Ethernet0/0/3 Ethernet0/0/4
Ethernet0/0/5 Ethernet0/0/
Ethernet0/0/7 Ethernet0/0/8
Ethernet0/0/9 Ethernet0/0/10
Ethernet0/0/11 Ethernet0/0/12
switch# config t
switch(Config)#vlan 2
switch(Config-Vlan2)#switch interface ethernet 0/0/11-12
Set the port Ethernet0/0/11 access vlan 2 successfully
Set the port Ethernet0/0/12 access vlan 2 successfully
switch(Config-Vlan2)#exit
switch(Config)#exit
switch#write
switch#conf t
switch(Config)#vlan 2
switch(Config-Vlan2)#switchport interface ethernet ?
<WORD> -- Interface list(input interface and/or the
interface ranges divided by semicolon(;). such
as e0/0/1;e0/0/3;e0/0/5-8) <1-100> character
switch(Config-Vlan2)#switchport interface ethernet 0/0/11-12
Set the port Ethernet0/0/11 access vlan 2 successfully
Set the port Ethernet0/0/12 access vlan 2 successfully
switch(Config-Vlan2)#
switch#show vlan
VLAN Name Type
---- ------------ ---------- --------- ----------------------------------------
1 default Static ENET Ethernet0/0/1 Ethernet0/0/2
Ethernet0/0/3 Ethernet0/0/4
Ethernet0/0/5 Ethernet0/0/6
Ethernet0/0/7 Ethernet0/0/8
Ethernet0/0/9 Ethernet0/0/10
2 VLAN0002 Static ENET Ethernet0/0/11 Ethernet0/
switch# write
switch#
Continue with configuration dialog? [y/n]:
switch(Config)#int vlan 1
20:42:07: %LINK-5-CHANGED: Interface Vlan1, changed state to UP
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to UP
switch(Config-If-Vlan1)#ip address 192.168.13.1 255.255.255.0
switch(Config-If-Vlan1)#int vlan 1
switch(Config-If-Vlan1)#int vlan 2
20:42:20: %LINK-5-CHANGED: Interface Vlan2, changed state to UP
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to UP
switch(Config-If-Vlan2)#ip address 192.168.14.1 255.255.255.
switch(Config-If-Vlan2)#
switch#write
switch#show run
Current configuration:
!
hostname switch
!
!
Vlan 1
vlan 1
!
Vlan 2
vlan 2
!
!
Interface Ethernet0/0/1
!
Interface Ethernet0/0/2
!
Interface Ethernet0/0/3
!
Interface Ethernet0/0/4
!
Interface Ethernet0/0/5
!
Interface Ethernet0/0/6
!
Interface Ethernet0/0/7
!
Interface Ethernet0/0/8
!
Interface Ethernet0/0/9
switchport access vlan 2
!
Interface Ethernet0/0/10
switchport access vlan 2
!
Interface Ethernet0/0/11
switchport access vlan 2
!
Interface Ethernet
switchport access vlan 2
!
!
interface Vlan1
interface vlan 1
ip address 192.168.13.1 255.255.255.0
!
!
interface Vlan2
interface vlan 2
ip address 192.168.14.1 255.255.255.0
!
!
switch#write
switch#
switch#
switch#
switch#
switch#
switch#conf
switch>
switch>
switch>
switch>
switch>
switch>
switch>
switch>en
switch#conf t
switch(Config)#int vlan 1
19:48:11: %LINK-5-CHANGED: Interface Vlan1, changed state to UP
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to UP
switch(Config-If-Vlan1)#ip address 192.168.16.1 255.255.255.0
switch(Config-If-Vlan1)#int vlan 2
19:48:34: %LINK-5-CHANGED: Interface Vlan2, changed state to UP
switch(Config-If-Vlan2)#ip address 192.168.17.1 255.255.255.0
switch(Config-If-Vlan2)#
switch#write
switch#sh run
Current configuration:
!
hostname switch
!
!
Vlan 1
vlan 1
!
Vlan 2
vlan 2
!
!
Interface Ethernet0/0/1
!
Interface Ethernet0/0/2
!
Interface Ethernet0/0/3
!
Interface Ethernet0/0/4
!
Interface Ethernet0/0/5
!
Interface Ethernet0/0/6
!
Interface Ethernet0/0/7
!
Interface Ethernet0/0/8
!
Interface Ethernet0/0/9
!
Interface Ethernet0/0/10
!
Interface Ethernet0/0/11
switchport access vlan 2
!
Interface Ethernet0/0/12
switchport access vlan 2
!
!
interface Vlan1
interface vlan 1
ip address 192.168.16.1 255.255.255.0
!
!
interface Vlan2
interface vlan 2
ip address 192.168.17.1 255.255.255.0
!
!
switch#show vlan
VLAN Name Type Media Ports
---- ------------ ---------- --------- ----------------------------------------
1 default Static ENET Ethernet0/0/1 Ethernet0/0/2
Ethernet0/0/3 Ethernet0/0/4
Ethernet0/0/5 Ethernet0/0/6
Ethernet0/0/7 Ethernet0/0/8
Ethernet0/0/9 Ethernet0/0/10
2 VLAN0002 Static ENET Ethernet0/0/11 Ethernet0/0/12
switch#
switch(Config)#
switch(Config)#
switch(Config)#exit
switch#sh vlan
VLAN Name Type Media Ports
---- ------------ ---------- --------- ----------------------------------------
1 default Static ENET Ethernet0/0/1 Ethernet0/0/2
Ethernet0/0/3 Ethernet0/0/4
Ethernet0/0/5 Ethernet0/0/6
Ethernet0/0/7 Ethernet0/0/8
2 VLAN0002 Static ENET Ethernet0/0/9 Ethernet0/0/10
Ethernet0/0/11 Ethernet0/0/12
switch# 20:44:52: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0/1
2,changed state to UP
配置vlan
最新推荐文章于 2025-08-12 14:30:08 发布