VLAN划分实验

VLAN划分实验

  • 如下图四台PC的网段均为192.168.1.0/24.,在末划分vlan前都可以相互平通,在这里我就不测试了,读者可以自行测试。
  • 任务:把vlan10划分到PC1和PC4,vlan20划分到PC2和PC3
  • 命名交换机为S1,S2
  • 测试PC1和PC4能ping通
  • P1和PC2不能ping通
  • 注:记得打开两台交换机之间的trunk
  • int f0/24
  • switchport mode trunk

在这里插入图片描述

  • S1的配置
Switch>enable 
Switch#conf
Switch#configure 
Configuring from terminal, memory, or network [terminal]? 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#host S1
S1(config)#vlan 10
S1(config-vlan)#int vlan 10
S1(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up
S1(config-if)#exit
S1(config)#vlan 20
S1(config-vlan)#int vlan 20
S1(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up
S1(config-if)#exit
S1(config)#int f0/1
S1(config-if)#switchport access vlan 10
S1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
S1(config-if)#int f0/2
S1(config-if)#switchport access vlan 20
S1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
S1(config-if)#
S1(config-if)#int f0/24
S1(config-if)#switchport mode trunk 
S1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up
S1(config-if)#
  • S2的配置
Switch>enable 
Switch#configure 
Configuring from terminal, memory, or network [terminal]? 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#host S2
S2(config)#vlan 10
S2(config-vlan)#int vlan 10
S2(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
S2(config-if)#vlan 20
S2(config-vlan)#int vlan 20
S2(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
S2(config-if)#int f0/2
S2(config-if)#switchport access vlan 10
S2(config-if)#
S2(config-if)#int f0/1
S2(config-if)#switchport access vlan 20
S2(config-if)#
S2(config-if)#
  • 命令配置完后先测试PC1ping PC2是不通的
    在这里插入图片描述
  • PC1和PC4能通
  • PC2和PC3能通

在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

啊醒

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

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

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

打赏作者

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

抵扣说明:

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

余额充值