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