• 交换机配置——跨交换机划分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

  • 相关阅读:
    ubuntu下安装配置apache2(含虚拟主机配置)
    ubuntu安装软件包apt-get和dpkg方法
    python日期,时间函数
    python多线程
    截取utf8中文字符串
    python解析json
    sqlite读写
    lambda,map,filter,reduce
    pyinstaller生成exe可执行程序
    对象练习
  • 原文地址:https://www.cnblogs.com/evolve/p/9177986.html
Copyright © 2020-2023  润新知