單臂路由(Single-arm routing)
作用:實現不同vlan之間的通信。
瓶頸:因爲單臂路由不具備擴展性,當VLAN的數量不斷增加,數據量增大,路由器與交換機之間的路徑會成爲整個網絡的瓶頸,這
時候的單臂路由就不再適用了
解決這一瓶頸:三層交換機
抱歉,製圖軟件電腦沒有,先湊活看一下
配置步驟
交換機
sw>enable
sw# vlan database
sw(vlan)# vlan 2 (vlan1 默認存在,用於管理交換機,再次單臂路由實驗也佔用一下vlan1,總共3個vlan)
sw(vlan)# vlan 3
sw(vlan)# exit
sw# conf t
sw(config)#line con 0
sw(config-if)#logg sy ( 顯示同步)
sw(config-if)#no exec-t (配置超時)
sw(config-if)#exit
sw(config)# no ip domian-lookup (關閉DNS解析命令)
sw(config)#int f0/0
sw(config-if)#sw mode trunk
sw(config-if)#no shut
sw(config)#int f0/1
sw(config-if)#sw mode access
sw(config-if)#sw access vlan 1
sw(config-if)# no shut
sw(config)#int f0/2
sw(config-if)#sw mode access
sw(config-if)#sw access vlan 2
sw(config-if)# no shut
sw(config)#int f0/3
sw(config-if)#sw mode access
sw(config-if)#sw access vlan 3
sw(config-if)# no shut
路由器
r1>enable
r1# conf t
r1(config)#line con 0
r1(config-if)#logg sy ( 顯示同步)
r1(config-if)#no exec-t (配置超時)
r1(config-if)#exit
r1(config)# int e0/0.1 (進入子接口)
r1(config-if)# en dotq1 1 (1指vlan1 封裝vlan1)
r1(config-if)# no shut
r1(config)# int e0/0
r1(config-if)# ip add 192.168.1.1 255.255.255.0
(注意,使用ROUTER作單臂的話,VLAN1由於是默認的NATIVE VLAN,所以在數據在幹道傳送的時候是不打標記的,將VLAN1的單臂配
置在e0/0接口就可以了,不使用E0/0.1的子接口 )
r1(config)#int e0/0.2
r1(config-if)#en dotq1 vlan 2
r1(config-if)# ip add 192.168.2.1 255.255.255.0
r1(config-if)# no shut
r1(config)# int e0/0.3
r1(config-if)# en dotq1 vlan 3
r1(config-if)# ip add 192.168.3.1 255.255.255.0
r1(config-if)# no shut
r1(config)# int e0/1
r1(config-if)# ip add 10.0.0.1 255.0.0.0
r1(config-if)# no shut
現在給計算機配置好各自的IP、網關,然後ping一下不同vlan之間的IP,能同說明OK 成功,如果問題留言。