zoukankan      html  css  js  c++  java
  • 交换机配置——跨交换机划分VLAN配置

    一、实验要求:实现跨交换地划分vlan的配置任务,使同一vlan下的主机能相互通讯

    二、拓扑图如下;

    三、具体实验步骤:

    S1交换机配置:

    S1>enable  --进入特权模式
    S1#config terminal  --进入全局配置模式
    Enter configuration commands, one per line. End with CNTL/Z.
    S1(config)#hostname S1  --修改交换机名为S1
    S1(config)#vlan 2  --创建并进入vlan 2端口,开启
    S1(config-vlan)#vlan 3  --创建并进入vlan 3 端口,开启
    S1(config-vlan)#exit  --返回上一级
    S1(config)#interface f0/1  进入f0/1端口
    S1(config-if)#switchport mode access  --端口模式改为access模式
    S1(config-if)#switchport access vlan 2  --将f0/1端口划入到vlan 2 下
    S1(config-if)#interface f0/2   --进入f0/2端口
    S1(config-if)#switchport mode access   --端口模式改为access模式
    S1(config-if)#switchport access vlan 3  --将f0/2端口划入到vlan 3 下
    S1(config-if)#interface f0/3  --进入f0/3端口
    S1(config-if)#switchport mode trunk  --将f0/3改为trunk模式,这是实现跨交换机vlan通讯最重要的一部

    S1(config-if)#end  --返回到特权模式
    S1#copy running-config startup-config  --保存配置
    %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down

    %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up

    %SYS-5-CONFIG_I: Configured from console by console

    Destination filename [startup-config]?
    Building configuration...
    [OK]  --保存成功

    S2交换机配置:

    Switch>enable  --进入特权模式
    Switch#config terminal  --进入全局配置模式
    Enter configuration commands, one per line. End with CNTL/Z.
    Switch(config)#hostname S2  --修改交换机名为S2
    S2(config)#vlan 2  --创建并进入vlan 2端口,开启
    S2(config-vlan)#vlan 3  --创建并进入vlan 3端口,开启
    S2(config-vlan)#exit  --返回上一级
    S2(config)#interface f0/1  --进入f0/1端口
    S2(config-if)#switchport mode access  --将端口模式改为access模式
    S2(config-if)#switchport access vlan 2  --将f0/1端口划入到vlan 2
    S2(config-if)#interface f0/2   --进入f0/2端口
    S2(config-if)#switchport mode access  --将端口模式改为access模式
    S2(config-if)#switchport access vlan 3  --将f0/2端口划入到vlan 2
    S2(config-if)#interface f0/3  --进入f0/3端口
    S2(config-if)#switchport mode trunk  --将端口模式改为trunk模式,这是跨交换机vlan通讯最重要的一部
    S2(config-if)#end  --返回特权模式
    S2#copy running-config startup-config  --保存配置
    %SYS-5-CONFIG_I: Configured from console by console

    Destination filename [startup-config]?
    Building configuration...
    [OK]  --保存成功

    四、验证同vlan下的两台主机是否互通,

    vlan 2下的PC1PC3

    vlan 3下的PC2PC4

  • 相关阅读:
    [转]VS2010几款超赞的扩展辅助工具总结
    从客户端中检测到有潜在危险的Request.Form 值
    面试系列28 分布式服务接口的幂等性如何设计
    面试系列26 如何基于dubbo进行服务治理、服务降级、失败重试以及超时重试
    面试系列25 dubbo的spi思想是什么
    面试系列24 dubbo负载均衡策略和集群容错策略
    面试系列23
    面试系列22 dubbo的工作原理
    面试系列21 为什么要进行系统拆分
    面试系列20 生产环境中的redis是怎么部署的
  • 原文地址:https://www.cnblogs.com/evolve/p/9177986.html
Copyright © 2011-2022 走看看