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

  • 相关阅读:
    redis的五种常见数据类型的常用指令
    Linux常用的命令
    moco操作
    如何使用GoEasy实现PHP与Websocket实时通信
    浅谈websocket
    nginx 配置虚拟主机访问PHP文件 502错误的解决方法
    集群/分布式环境下5种session处理策略
    nginx 集群
    使用Nginx实现反向代理
    nginx的配置和基本使用命令
  • 原文地址:https://www.cnblogs.com/evolve/p/9177986.html
Copyright © 2011-2022 走看看