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

  • 相关阅读:
    文件共享服务之FTP
    通过rsycn实现数据同步
    rsync命令的使用
    Linux之ssh服务
    跳板机的工作原理和简单的跳板机实现
    Linux进程管理
    javaweb图片上传 tomcat重新部署 图片消失
    KindEditor 上传文件
    PL/SQL通过修改配置文件的方式实现数据库的连接
    PermGen space
  • 原文地址:https://www.cnblogs.com/evolve/p/9177986.html
Copyright © 2011-2022 走看看