1. 程式人生 > >簡單的三層交換配置路由實驗 (思科)

簡單的三層交換配置路由實驗 (思科)

實驗名稱:簡單的三層交換配置路由 (思科)
實驗拓撲:
簡單的三層交換配置路由實驗 (思科)

簡單的三層交換配置路由實驗 (思科)

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

    驗證:
![](http://i2.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