• 2017.4.26-morning


    实验目标

    掌握交换机Tag VLAN的配置

    l 掌握三层交换机基本配置方法;

    掌握三层交换机VLAN路由的配置方法;

    通过三层交换机实现VLAN间相互通信;

    实验背景

    某企业有两个主要部门,技术部和销售部,分处于不同的办公室,为了安全和便于管理对两个部门的主机进行了VLAN的划分,技术部和销售部分处于不同的VLAN,先由于业务的需求需要销售部和技术部的主机能够相互访问,获得相应的资源,两个部门的交换机通过一台三层交换机进行了连接。

    技术原理

    三层交换机具备网络层的功能,实现VLAN相互访问的原理是:利用三层交换机的路由功能,通过识别数据包的IP地址,查找路由表进行选路转发,三层交换机利用直连路由可以实现不同VLAN之间的相互访问。三层交换机给接口配置IP地址。采用SVI(交换虚拟接口)的方式实现VLAN间互连。SVI是指为交换机中的VLAN创建虚拟接口,并且配置IP地址。

    实验步骤

    新建packet tracer拓扑图

    1)在二层交换机上配置VLAN2VLAN3,分别将端口2、端口3划分给VLAN2VLAN3

    2)将二层交换机与三层交换机相连的端口fa 0/1都定义为tag Vlan模式。

    3)在三层交换机上配置VLAN2VLAN3,此时验证二层交换机VLAN2VLAN3下的主机之间不能相互通信。

    4)设置三层交换机VLAN间的通信,创建VLAN2,VLAN3的虚接口,并配置虚接口VLAN2VLAN3IP地址。

    5)查看三层交换机路由表。

    6)将二层交换机VLAN2VLAN3下的主机默认网关分别设置为相应虚拟接口的IP地址。

    7)验证二层交换机VLAN2,VALN3下的主机之间可以相互通信。

    首先在三层交换机上分别设置各VLAN的接口IP地址。三层交换机将vlan做为一种接口对待,就象路由器上的一样,再在各接入VLAN的计算机上设置与所属VLAN的网络地址一致的IP地址,并且把默认网关设置为该VLAN的接口地址。这样,所有的VLAN也可以互访了。

    实验设备

    Switch_2960 1台;Swithc_3560 1台;PC 3台;直连线

     

    PC1

    IP: 192.168.1.2

    Submark: 255.255.255.0

    Gateway: 192.168.1.1

    PC2

    IP: 192.168.2.2

    Submark: 255.255.255.0

    Gateway: 192.168.2.1

    PC3

    IP: 192.168.1.3

    Submark: 255.255.255.0

    Gateway: 192.168.1.1

    PC1 Ping PC3

    Ping 192.168.1.3  reply

    PC1 Ping PC2         

    Ping 192.168.2.2   timeout

    S2960

    Switch>en

    Switch#conf t

    Switch(config )#vlan 2

    Switch(config-vlan)#exit

    Switch(config )#vlan 3

    Switch(config-vlan)#exit

    Switch(config )#int fa 0/2

    Switch(config-if)#switchport access vlan 2

    Switch(config-if)#exit

    Switch(config )#int fa 0/3

    Switch(config-if)#switchport access vlan 3

    Switch(config-if)#exit

    Switch(config )#int fa 0/1

    Switch(config-if)#switchport  mode  trunk

    Switch(config-if)#end

    Switch#show vlan

    S3560

    Switch>en

    Switch#conf t

    Switch(config )#vlan 2  //新建vlan 2

    Switch(config-vlan)#exit

    Switch(config )#vlan 3  //新建vlan 3

    Switch(config-vlan)#exit

    Switch(config )#int fa 0/1  //进入0模块第1端口

    Switch(config-if)#switchport trunk encapsulation dot1q //给这个接口的trunk封装为802.1Q的帧格式

    Switch(config-if)#switchport mode trunk  //定义这个接口的工作模式为trunk

    Switch(config-if)#exit

    Switch(config )#int fa 0/2   //进入0模块第2端口

    Switch(config-if)#switchport access vlan 2  //当前端口加入vlan 2

    Switch(config-if)#exit

    Switch(config )#interface vlan 2  //进入vlan2 虚拟接口

    Switch(config-if)#ip address 192.168.1.1 255.255.255.0  //配置IP地址

    Switch(config-if)#no shutdown  //开启该端口

    Switch(config-if)#exit

    Switch(config )#interface vlan 3

    Switch(config-if)#ip address 192.168.2.1 255.255.255.0

    Switch(config-if)#no shutdown

    Switch(config-if)#end

    Switch#show ip route  //显示路由表

    Switch#show vlan   //显示vlan信息

    PC1 Ping PC3

    Ping 192.168.1.3  reply

    PC1 Ping PC2         

    Ping 192.168.2.2   reply

  • 相关阅读:
    django之数据库orm
    Python的迭代器和生成器
    xhprof 安装使用
    http_load
    sysbench
    LINUX系统下MySQL 压力测试工具super smack
    apache ab工具
    关于流量升高导致TIME_WAIT增加,MySQL连接大量失败的问题
    mysql5.6优化
    php-fpm超时时间设置request_terminate_timeout分析
  • 原文地址:https://www.cnblogs.com/bgd140206202/p/6767315.html
Copyright © 2020-2023  润新知