范莉 李凌


摘 要:從單臂路由的配置入手,分析了單臂路由的優缺點,對怎么配置單臂路由進行了說明,并對單臂路由造成的網絡瓶頸,提出了優化方案。
關鍵詞:單臂路由;VLAN;封裝;子接口;優化
中圖分類號:TP393.04 文獻標識碼:A 文章編號:1006-8937(2016)24-0086-02
單臂路由是指在路由器的一個接口上通過配置子接口的方式,實現原來互相隔離的VLAN之間互聯互通。 其主要優點是節約接口和成本,缺點是單臂路由不具有好的擴展性,當VLAN的數量不斷增加,流經路由器與交換機之間的流量也會變得越來越大,這時,這條鏈路就成了整個網絡的瓶頸,即使網絡帶寬在大,也是如此,因為他們的數據交換要在路由器虛擬的子接口上進行,接口處理數據速率較低,且非常消耗路由器CPU和內存資源,容易造成接口過載,形成網絡單點故障;或者是VLAN數目不多,但接入的終端較多,也會造成網絡瓶頸。
1 單臂路由的配置
單臂路由的配置主要把握四點,簡單來說就是VLAN、子接口、封裝和Trunk。設備主要有路由器、二層交換機各一臺,拓撲,如圖1所示,基本配置如下:
主交換機主要配置:
interface FastEthernet0/1(設置Trunk)
switchport mode trunk
interface FastEthernet0/2(設置接口屬于Vlan10)
switchport access vlan 10
interface FastEthernet0/3(設置接口屬于Vlan20)
switchport access vlan 20
interface FastEthernet0/4(設置接口屬于Vlan30)
switchport access vlan 30
本級路由器主要配置:
interface FastEthernet0/0.1(子接口)
encapsulation dot1Q 10(封裝,標志號為10)
ip address 192.168.1.1 255.255.255.0
interface FastEthernet0/0.2(子接口)
encapsulation dot1Q 20(封裝,標志號為20)
ip address 192.168.2.1 255.255.255.0
interface FastEthernet0/0.3(子接口)
encapsulation dot1Q 30(封裝,標志號為30)
ip address 192.168.3.1 255.255.255.0
interface Serial2/0(互聯地址設置)
ip address 172.19.35.2 255.255.255.128
router ospf 1(Ospf路由設置)
network 172.19.35.0 0.0.0.127 area 0
network 192.168.1.0 0.0.0.255 area 0
network 192.168.2.0 0.0.0.255 area 0
network 192.168.3.0 0.0.0.255 area 0
上級路由器主要配置:
interface Serial2/0(互聯地址設置)
ip address 172.19.35.1 255.255.255.128
router ospf 1(Ospf路由設置)
network 172.19.35.0 0.0.0.127 area 0
network 192.168.30.0 0.0.0.255 area 0
可以用Ping命令進行檢測。在實際使用中我們發現當主交換機業務增加時,虛擬接口交換能力有限,造成整個網絡擁塞,因此,需要用三層交換機進行調整,確保網絡暢通。
2 優化單臂路由
要改變單臂路由帶來的網絡瓶頸,需用三層交換機對二層交換機進行替代,這樣,當VLAN不斷增多時,相互間通信就在三層交換機上進行。拓撲,如圖2所示,具體配置及如下:
主交換機主要配置:
ip routing(務必記得打開交換機路由功能)
interface FastEthernet0/1(設置接口為Trunk)
switchport trunk encapsulation dot1q
switchport mode trunk
interface FastEthernet0/2(設置接口屬于vlan10)
switchport access vlan 10
interface FastEthernet0/3(設置接口屬于vlan20)
switchport access vlan 20
interface FastEthernet0/4(設置接口屬于vlan10)
switchport access vlan 30
interface Vlan1(設置vlan1地址,其為互聯接口)
ip address 8.11.168.2 255.255.255.0
interface Vlan10(設置vlan10地址)
ip address 192.168.1.1 255.255.255.0
interface Vlan20(設置vlan20地址)
ip address 192.168.2.1 255.255.255.0
interface Vlan30(設置vlan30地址)
ip address 192.168.3.1 255.255.255.0
ip classless
ip route 0.0.0.0 0.0.0.0 8.11.168.1 (默認靜態路由)
且接口fa0/2、fa0/3、fa0/4屬于相對應的Vlan。
本級路由器主要配置:
interface FastEthernet0/0(設置互聯接口地址)
ip address 8.11.168.1 255.255.255.0
interface Serial2/0(設置互聯接口地址)
ip address 172.19.35.2 255.255.255.128
router ospf 1(Ospf路由配置)
redistribute static subnets (靜態路由重分布)
network 172.19.35.0 0.0.0.127 area 0
network 8.11.168.0 0.0.0.255 area 0
ip classless
ip route 192.168.1.0 255.255.255.0 8.11.168.2
ip route 192.168.2.0 255.255.255.0 8.11.168.2
ip route 192.168.3.0 255.255.255.0 8.11.168.2
上級路由器主要配置:
interface FastEthernet0/0(設置互聯接口地址)
ip address 192.168.30.1 255.255.255.0
interface Serial2/0(設置互聯接口地址)
ip address 172.19.35.1 255.255.255.128
router ospf 1(Ospf路由配置)
network 172.19.35.0 0.0.0.127 area 0
network 192.168.30.0 0.0.0.255 area 0
經過優化后,不會因為VLAN間相互通信的增多而影響整個網絡的穩定性,且隨著主交換機業務增多,VLAN間的相互通信在三層交換機進行,同時,交換數據的速度也大大提高了。
參考文獻:
[1] 謝鈞,謝希仁.計算機網絡[M].北京:人民郵電出版社,2014.