简单的三层交换配置路由实验 (思科)

实验名称:简单的三层交换配置路由 (思科)
实验拓扑:
《简单的三层交换配置路由实验 (思科)》

《简单的三层交换配置路由实验 (思科)》

1、配置终端设备:
       pc1-pc5按照拓扑图中所示配置各个pc的ip地址。
          网关配置为 192.168.x.254 
       pc6配置为 192.168.7.1/24 网关为192.168.7.254

  2、配置网络设备
      #配置交换设备(sw1)
          1、创建vlan
               vlan 1
               vlan 2
               vlan 3

          2、配置端口模式
                    interface range fa 0/1 - 3
                       switchport mode access

          3、将端口加入特定vlan
                    interface fa0/1
                        switchport access vlan 1
                    interface fa0/2
                        switchport access vlan 2
                    interface fa0/3
                        switchport access vlan 3            

          4、配置交换机之间的互联链路(trunk)
                    interface fa 0/24
                      switchport mode trunk

       #配置交换设备(Lsw2)
          1、创建vlan
               vlan 4
               vlan 5

          2、配置端口模式
                    interface range fa 0/1 ,0/2
                      switchport mode access

          3、将端口加入特定vlan
                    interface fa 0/1
                        switchport access vlan 4
                    interface fa 0/2
                        switchport access vlan 5

          4、配置交换机之间的互联链路(trunk)
                    interface fa 0/24
                      switchport mode trunk

       #配置路由设备(Lsw3)
         1、配置交换机之间的互联链路
                   interface fa 0/23 , 0/24
                     switchport trunk encapsulation dot1q 
                     switchport mode trunk
         2、创建对应的 valn
                  vlan 1
                  vlan 2
                  vlan 3
                  vlan 4
                  vlan 5

         3、配置每个vlan对应的svi接口(每个vlan的网关IP地址)
                  interface vlan 1
                    no shutdown
                    ip address 192.168.1.254 255.255.255.0
                 interface vlan 2
                    no shutdown
                    ip address 192.168.2.254 255.255.255.0
                  interface vlan 3
                    no shutdown
                    ip address 192.168.3.254 255.255.255.0
                 interface vlan 4
                    no shutdown
                    ip address 192.168.4.254 255.255.255.0                      
                  interface vlan 5
                    no shutdown
                    ip address 192.168.6.254 255.255.255.0

          4、配置1端口模式为路由,并配置IP地址
                    interface fa 0/1
                      no switchport
                        ip address 192.168.6.1
         5、设置浮动静态路由
               ip routing
               ip route 192.168.7.0 255.255.255.0 192.168.6.2

       #配置路由器设备(AR1)        
             1、配置两个端口的IP地址
            interface g 0/0 
                ip address 192.168.7.254 255.255.255.0
            interface g 0/1
                ip  address 192.168.6.2 255.255.255.0
            2、配置浮动静态路由
                IP route 0.0.0.0 0.0.0.0 192.168.6.1

    验证:
![](https://s1.51cto.com/images/blog/201811/16/79778123f25b6defdc505583708573c8.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
    pc1 ping pc6

转载于:https://blog.51cto.com/14029008/2318157

    原文作者:weixin_33831196
    原文地址: https://blog.csdn.net/weixin_33831196/article/details/92730982
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞