CCNA上机实验_02-Switch_Vlan

1、实验目的

掌握交换机VLAN的基本操作
理解广播域的作用

2、拓扑与需求

拓扑:
在这里插入图片描述
需求:

1.设置SW1和SW2的设备名分别为SW1和SW2
2.按拓扑图所示配置PC1~4的IP地址
3.交换机按图示配置各终端所属的相应vlan,并且进行合理的配置使得同vlan间PC可以相互访问,不同vlan间PC不可以相互访问(不使用trunk)
4.在SW2上配置使得PC1可以使用Telnet远程管理到SW2,远程管理密码为SPOTO

3、配置与实现

  1. 设置SW1和SW2的设备名分别为SW1和SW2
    SW1
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1

SW2

Switch>enable
Switch#configure terminal
Switch(config)#hostname SW2
  1. 按拓扑图所示配置PC1~4的IP地址
    PC1
PC1>enable
PC1#configure terminal
PC1(config)#interface Ethernet0/0
PC1(config-if)#ip address 192.168.10.1 255.255.255.0
PC1(config-if)#no shutdown

PC2

PC2>enable
PC2#configure terminal
PC2(config)#interface Ethernet0/0
PC2(config-if)#ip address 192.168.20.1 255.255.255.0
PC2(config-if)#no shutdown

PC3

PC3>enable
PC3#configure terminal
PC3(config)#interface Ethernet0/0
PC3(config-if)#ip address 192.168.10.2 255.255.255.0
PC3(config-if)#no shutdown

PC4

PC4>enable
PC4#configure terminal
PC4(config)#interface Ethernet0/0
PC4(config-if)#ip address 192.168.20.2 255.255.255.0
PC4(config-if)#no shutdown
  1. 交换机按图示配置各终端所属的相应vlan,并且进行合理的配置使得同vlan间PC可以相互访问,不同vlan间PC不可以相互访问(不使用trunk)
    SW1
SW1(config)#interface range ethernet 0/0-1
SW1(config-if-range)#switchport mode access 
SW1(config-if-range)#switchport access vlan 10
% Access VLAN does not exist. Creating vlan 10
SW1(config-if-range)#interface range ethernet 0/2-3
SW1(config-if-range)#switchport mode access 
SW1(config-if-range)#switchport access vlan 20
% Access VLAN does not exist. Creating vlan 20
当接口划入的VLAN不存在时,IOS会自动创建
使用 range 可以批量操作多个接口

SW2

SW2(config)#interface range ethernet 0/0-1
SW2(config-if-range)#switchport mode access 
SW2(config-if-range)#switchport access vlan 10
% Access VLAN does not exist. Creating vlan 10
SW2(config-if-range)#interface range ethernet 0/2-3
SW2(config-if-range)#switchport mode access 
SW2(config-if-range)#switchport access vlan 20
% Access VLAN does not exist. Creating vlan 20

在这里插入图片描述
4. 在SW2上配置使得PC1可以使用Telnet远程管理到SW2,远程管理密码为SPOTO
SW2

配置SVI(交换虚拟接口,可用于管理交换机)

SW2(config)#interface vlan 10
SW2(config-if)#ip address 192.168.10.3 255.255.255.0
SW2(config-if)#no shutdown 

配置Enable密码为SPOTO

SW2(config)#enable password SPOTO

配置允许Telnet,密码为SPOTO

SW2(config)#line vty 0 4
SW2(config-line)#transport input telnet 
SW2(config-line)#password SPOTO
SW2(config-line)#login

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值