CCNA课程实验-02-Switch-vlan

实验条件

网络拓朴

在这里插入图片描述

需求

  1. 设置SW1和SW2的设备名分别为SW1和SW2
  2. 按拓扑图所示配置PC1~4的IP地址
  3. 交换机按图示配置各终端所属的相应vlan,并且进行合理的配置使得同vlan间PC可以相互访问,不同vlan间PC不可以相互访问(不使用trunk)
  4. 在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#
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

烈火蜓蜻

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值