实验条件
网络拓朴
需求
- 设置SW1和SW2的设备名分别为SW1和SW2
- 按拓扑图所示配置PC1~4的IP地址
- 交换机按图示配置各终端所属的相应vlan,并且进行合理的配置使得同vlan间PC可以相互访问,不同vlan间PC不可以相互访问(不使用trunk)
- 在SW2上配置使得PC1可以使用Telnet远程管理到SW2,远程管理密码为SPOTO
配置实现
1.设置SW1和SW2的设备名分别为SW1和SW2
SW1&SW2
Switch>enable
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW2
SW2(config)#
2. 按拓扑图所示配置PC1~4的IP地址
PC1 & PC2 & PC3 & PC4
Router(config)#hostname PC1
PC1(config)#int e0/0
PC1(config-if)#ip address 192.168.10.1 255.255.255.0
PC1(config-if)#no shutdown
PC1(config-if)#
3. 配置相应vlan
交换机按图示配置各终端所属的相应vlan,并且进行合理的配置使得同vlan间PC可以相互访问,不同vlan间PC不可以相互访问(不使用trunk)
SW1
SW1(config)#int range e0/0-1
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 10
SW1(config-if-range)#no shutdown
SW1(config-if-range)#int range e0/2-3
SW1(config-if-range)#switchport mode access
SW1(config-if-range)#switchport access vlan 20
SW1(config-if-range)#no shutdown
SW1(config-if-range)#do sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active
10 VLAN 10 active Et0/0, Et0/1
20 VLAN20 active Et0/2, Et0/3
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
Remote SPAN VLANs
------------------------------------------------------------------------------
Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------
SW2
SW2(config)#int range e0/0-1
SW2(config-if-range)#switchport mode access
SW2(config-if-range)#switchport access vlan 10
SW2(config-if-range)#no shutdown
SW2(config-if-range)#int range e0/2-3
SW2(config-if-range)#switchport mode access
SW2(config-if-range)#switchport access vlan 20
SW2(config-if-range)#do sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active
10 VLAN 10 active Et0/0, Et0/1
20 VLAN20 active Et0/2, Et0/3
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
Remote SPAN VLANs
------------------------------------------------------------------------------
Primary Secondary Type Ports
------- --------- ----------------- ------------------------------------------
4.配置TELNET访问
在SW2上配置使得PC1可以使用Telnet远程管理到SW2,远程管理密码为SPOTO
开启远程管理,需要先确认配置好特权密码
SW2
SW2(config)#enable password SPOTO
SW2(config)#enable secret SPOTO //上面两个命令都设置时,secret会覆盖password
SW2(config)#int vlan 10
SW2(config-if)#ip address 192.168.10.3 255.255.255.0
SW2(config-if)#no shutdown
SW2(config-if)#line vty 0 4
SW2(config-line)#password SPOTO
SW2(config-line)#login
SW2(config-line)#transport input telnet
SW2(config-line)#
PC1
PC1>telnet 192.168.10.3
Trying 192.168.10.3 ... Open
User Access Verification
Password:
SW2>enable
Password:
SW2#