簡單的三層交換配置路由 實驗(華為)
阿新 • • 發佈:2018-11-17
實驗名稱:簡單的三層交換配置路由
實驗拓撲:
實驗需要:
1、按圖中所示配置設網路備vlan,IP地址
2、能夠使各pc互相ping通。
實驗步驟:
1、配置終端裝置: pc1-pc5按照拓撲圖中所示配置各個pc的ip地址。 閘道器配置為 192.168.x.254 pc6配置為 192.168.7.1/24 閘道器為192.168.7.254 2、配置網路裝置 #配置交換裝置(Lsw1) 1、建立vlan vlan 1 vlan 2 vlan 3 2、配置埠模式 interface g0/0/1 port link-type access interface g0/0/2 port link-type access interface g0/0/3 port link-type access 3、將埠加入特定vlan interface gi0/0/1 port default vlan 1 interface gi0/0/2 port default vlan 2 interface gi0/0/3 port default vlan 3 4、配置交換機之間的互聯鏈路(trunk) interface gi0/0/24 port link-type trunk port trunk allow-pass vlan all #配置交換裝置(Lsw2) 1、建立vlan vlan 4 vlan 5 2、配置埠模式 interface g0/0/1 port link-type access interface g0/0/2 port link-type access 3、將埠加入特定vlan interface gi0/0/1 port default vlan 4 interface gi0/0/2 port default vlan 5 4、配置交換機之間的互聯鏈路(trunk) interface gi0/0/24 port link-type trunk port trunk allow-pass vlan all #配置路由裝置(Lsw3) 1、配置交換機之間的互聯鏈路 interface gi0/0/1 port link-type trunk port trunk allow-pass vlan all interface gi0/0/2 port link-type trunk port trunk allow-pass vlan all 2、建立對應的 valn vlan 1 vlan 2 vlan 3 vlan 4 vlan 5 vlan 6 3、配置每個vlan對應的svi介面(每個vlan的閘道器IP地址) interface vlan 1 undo shutdown ip address 192.168.1.254 255.255.255.0 interface vlan 2 undo shutdown ip address 192.168.2.254 255.255.255.0 interface vlan 3 undo shutdown ip address 192.168.3.254 255.255.255.0 interface vlan 4 undo shutdown ip address 192.168.4.254 255.255.255.0 interface vlan 5 undo shutdown ip address 192.168.6.254 255.255.255.0 interface vlan 6 undo shutdown ip address 192.168.6.1 255.255.255.0 4、配置24埠模式,並加入vlan6 interface g0/0/24 port link-type access port default vlan 6 5、設定浮動靜態路由 ip route-static 192.168.7.0 255.255.255.0 192.168.6.2 #配置路由器裝置(AR1) 1、配置兩個埠的IP地址 interface g0/0/0 ip address 192.168.7.254 255.255.255.0 no shutdown interface g0/0/1 ip address 192.168.6.2 255.255.255.0 no shutdown 2、配置浮動靜態路由 IP route-static 0.0.0.0 0.0.0.0 192.168.6.1 注意:路由用交換機LSW3中,與路由器連線的埠一定要加入到一個新vlan中,並配置vlan閘道器的ip地址。
驗證:
互相都ping通。
為pc1 ping pc6的結果。