Port Vlans allowed and active in management domain
Fa0/11 1
Fa0/12 1
Port Vlans in spanning tree forwarding state and not pruned
Fa0/11 1
Fa0/12 none
Sw1(config)#vlan 20
Sw1(config-vlan)#name G-LAB20
Sw1(config-vlan)#end
Sw1#vlan database
Sw1(vlan)#vlan 30 name G-LAB30
VLAN 30 added:
Name: G-LAB30
Sw1(vlan)#exit
APPLY completed.
Exiting....
Sw1#
Sw1#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10
20 G-LAB20 active
30 G-LAB30 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Sw1#
Sw1(config)#no vlan 30
Sw1(config)#do sh vlan b
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10
20 G-LAB20 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Sw1(config)#int fa0/1
Sw1(config-if)#switchport mode access
Sw1(config-if)#switchport access vlan 20
Sw1(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/1 but will only
have effect when the interface is in a non-trunking mode.
Sw1(config-if)#exit
Sw1(config)#vlan 30
Sw1(config-vlan)#name G-LAB30
Sw1(config-vlan)#exit
Sw1(config)#int range fa0/2 - 5
Sw1(config-if-range)#sw mode access
Sw1(config-if-range)#sw access vlan 30
Sw1(config-if-range)#end
Sw1#sh vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10
20 G-LAB20 active Fa0/1
30 G-LAB30 active Fa0/2, Fa0/3, Fa0/4, Fa0/5
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Sw1(config-if)#int vlan 30
Sw1(config-if)#
Sw1(config-if)#ip address 192.168.30.254 255.255.255.0
Sw1(config-if)#no shutdown
Sw1(config-if)#exit
Sw1(config)#line vty 0 4
Sw1(config-line)#password G-LAB
Sw1(config-line)#login
Sw1(config)#enable secret G-LAB123
Sw1(config)#end
2. 简单验证
1) PC1 IP:192.168.30.23/24
PC2 IP:192.168.30.24/24
2) PC1 连结到Sw1的Fa0/1端口,PC2 连结到Sw1的Fa0/2端口,观察两个端口指示灯变成绿色的时间:
Fa0/1: ___s
Fa0/2: ___s
3) PC1 ping PC2:
Pinging 192.168.30.24 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.30.24:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
4) 将PC1 连结到Sw1的Fa0/3端口,PC1 再ping PC2:
Pinging 192.168.30.24 with 32 bytes of data:
Request timed out.
Reply from 192.168.30.24: bytes=32 time=1ms TTL=64
Reply from 192.168.30.24: bytes=32 time=1ms TTL=64
Reply from 192.168.30.24: bytes=32 time=1ms TTL=64
Ping statistics for 192.168.30.24:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
C:Documents and SettingsJoseph>telnet 192.168.30.254
Trying 192.168.30.254 ... Open
User Access Verification
Password:
Sw1>en
Password:
Sw1#
Sw1#copy run start
Destination filename [startup-config]?
Building configuration...
Sw1#
Sw1#sh flash:
Directory of flash:/
2 -rwx 2664051 Mar 01 1993 00:03:19 c2960-i6q4l2-mz.122-11.EA1.bin
3 -rwx 556 Mar 01 1993 03:56:53 vlan.dat
4 -rwx 269 Jan 01 1970 00:01:16 env_vars
5 -rwx 974 Mar 01 1993 03:59:06 config.text
推荐阅读
- 武汉P4实验室在哪?
- 中国P4实验室共有几个?
- 什么是实验法?它有哪些基本要素?
- 职教本科合作实验班是什么意思?
- 科技前沿|秃头有救了!科学家发现刺激头发生长分子:已用小白鼠实验成功
- switch卡带日版国行通用,日版switch运行国行卡带-
- 昆明9万学生全城找鼠妇做实验-为什么要多只鼠妇做实验
- 昆明9万学生全城找鼠妇做实验-为什么要用多只鼠妇进行实验
- 任天堂|Switch或将迎来新型号 任天堂花大价钱疯狂采购原材料
- 实验|小米叶脉冷泵散热效果明显 网友:别把骁龙冻感冒