摘要:在網絡結構較簡單的園區網中,單臂路由技術是解決VLAN間通信的常用方案。但園區網間的網絡互通問題的解決方案不是唯一的,文章對園區網間單臂路由技術解決網絡互通的替代解決方案進行了探討。
關鍵詞:園區網;單臂路由技術;VLAN;解決方案
中圖分類號:TP393文獻標識碼:A文章編號:1009-3044(2008)34-1889-02
Alternative Solutions that Single-arm Routing Technology to Resolve Network Intercommunication in Garden Area Network
SU Wen-zhi, GUO Fei-yan
(Henan Vocational and Technical College Department of Computer Science, Jiyuan 454650, China)
Abstract: In simpler structure garden area network, single-arm routing technology is the common solution that communication between VLAN. But, The garden area net network communicates problem's resolving is not unique, the paper discussed Alternative solutions that single-arm routing technology to Resolve network intercommunication in garden area network.
Key words: garden area network;single-arm routing technology;vlan;solution
眾多中小型園區網內部網絡結構都很簡單,僅僅是用一臺交換機將所有客戶機以及服務器連接到一起,然后通過光纖訪問Internet而已。當然為了保證部分主機的安全性以及分割內部廣播包提高網絡傳輸速度,采取諸如劃分VLAN,分配不同子網的方法來實現。通過劃分VLAN可以讓在同一臺交換機不同端口的客戶機不能互相訪問,有效的隔離了網絡。通過VLAN劃分網絡固然可以解決安全和廣播風暴的頻繁出現,但是對于那些既希望隔離又希望對某些客戶機進行互通的園區網來說,劃分VLAN的同時為不同VLAN建立互相訪問的通道也是必要的。
那么什么時候要用到單臂路由呢?在園區網內部劃分了VLAN,當VLAN 之間有部分主機需要通信,但交換機不支持三層交換,這時候可以采用一臺支持802.1Q的路由器實現VLAN的互通。我們只需要在以太口上建立子接口,并分配IP地址作為該VLAN的網關,同時啟動802.1Q協議即可。
單臂路由方式僅僅是對現有網絡升級時采取的一種策略,在園區網內部網絡中劃分了 VLAN,當VLAN之間有部分主機需要通信,但交換機不支持三層交換,這時我們使用該方法來解決實際問題。由于單臂路由存在著很多缺點:一方面它非常消耗路由器CPU與內存的資源,在一定程度上影響了網絡數據包傳輸的效率,另一方面將本來可以由三層交換機內部完成的工作交給了額外的設備完成,對于連接線路要求也是非常高的。另外通過單臂路由將本來劃分得好好的VLAN徹底打破,原有的提高安全性與減少廣播數據包等措施起到的效果也大大降低了。因此,我們在園區網中尋求一種單臂路由技術的替代解決方案。如圖1所示,其中DCR-1702與DCRS-5526S間的單臂路由技術使用替代解決方案。(注:以神州數碼設備為例)
具體配置實現如下:
1) 基本配置
DCS-3926S:
Switch.>enable
Switch#config
Switch(config)#hostname DCS-3926S
DCS-3926S(config)#VLAN 10
DCS-3926S(config- VLAN10)#switchport interface Ethernet 0/0/1
DCS-3926S(config- VLAN10)#exit
DCS-3926S(config)#VLAN 20
DCS-3926S(config- VLAN20)#switchport interface Ethernet 0/0/2
DCS-3926S(config- VLAN20)#exit
DCS-3926S(config)#interface Ethernet 0/0/24
DCS-3926S(config-ethernet0/0/24)#switchport mode trunk
DCS-3926S(config-ethernet0/0/24)#^z
DCS-3926S#
DCRS-5526S:
Switch.>enable
Switch#config
Switch(config)#hostnam DCRS-5526S
DCRS-5526S(config)#VLAN 10
DCRS-5526S(config-VLAN10)#exit
DCRS-5526S(config)#VLAN 20
DCRS-5526S(config-VLAN20)#exit
DCRS-5526S(config)#VLAN 30
DCRS-5526S(config-VLAN30)#switchport interface Ethernet 0/0/3
DCRS-5526S(config-ethernet0/0/3)#exit
DCRS-5526S(config)#interface vlan10
DCRS-5526S(config-if-vlan10)#ip address 192.168.10.1 255.255.255.0
DCRS-5526S(config-if-vlan10)#exit
DCRS-5526S(config)#iinterface vlan20
DCRS-5526S(config-if-vlan20)#ip address 192.168.20.1 255.255.255.0
DCRS-5526S(config-if-vlan20)#exit
DCRS-5526S(config)#iinterface vlan30
DCRS-5526S(config-if-vlan30)#ip address 192.168.30.1 255.255.255.0
DCRS-5526S(config-if-vlan30)#exit
DCRS-5526S(config)#vlan 100
DCRS-5526S(config-vlan100)#switchport interface Ethernet 0/0/24
DCRS-5526S(config-vlan100)#exit
DCRS-5526S(config)#
DCRS-5526S(config)#interface vlan100
DCRS-5526S(config-if-vlan100)#ip address 192.168.100.2255.255.255.0
DCRS-5526S(config-if-vlan100)#exit
DCRS-5526S(config)#
DCRS-5526S(config)#interface Ethernet 0/0/23
DCRS-5526S(config-ethernet0/0/23)#switchport mode trunk
DCRS-5526S(config-ethernet0/0/23)#^z
DCRS-5526S#
DCR-1702:
Rouer>
Rouer>enable
Rouer#
Rouer#config
Rouer(config)#
Rouer(config)#hostname DCR-1702
DCR-1702(config)#
DCR-1702(config)#interface f0/0
DCR-1702(config-if-f0/0)#ip address 192.168.100.1 255.255.255.0
DCR-1702(config-if-f0/0)#exit
DCR-1702(config)#
DCR-1702(config)#interface s0/2
DCR-1702(config-if-s0/2)#ip address 192.168.200.2 255.255.255.0
DCR-1702(config-if-s0/2)#exit
DCR-1702(config)#
DCR-1751:
Rouer>
Rouer>enable
Rouer#
Rouer#config
Rouer(config)#
Rouer(config)#hostname DCR-1751
DCR-1751(config)#
DCR-1751(config)#interface s1/0
DCR-1751(config-if-s1/0)#ip address 192.168.200.1 255.255.255.0
DCR-1751(config-if-s1/0)#exit
DCR-1751(config)#interface f0/0
DCR-1751(config-if-f0/0)#ip address 192.168.400.1 255.255.255.0
DCR-1751(config-if-f0/0)#exit
DCR-1751(config)#
DCR-1751(config)#exit
DCR-1751#
2) 路由配置
DCRS-5526S:
DCRS-5526S(config)#ip route 192.168.200.0 255.255.255.0 192.168.100.1
DCRS-5526S(config)#ip route 192.168.400.0 255.255.255.0 192.168.100.1
或者利用缺省路由代替:
DCRS-5526S(config)#ip route 0.0.0.0 0.0.0.0255.255.255.0192.168.100.1
DCR-1702:
DCR-1702(config)# ip route 192.168.10.0 255.255.255.0 192.168.100.2
DCR-1702(config)# ip route 192.168.20.0 255.255.255.0 192.168.100.2
DCR-1702(config)# ip route 192.168.30.0 255.255.255.0 192.168.100.2
DCR-1702(config)# ip route 192.168.400.0 255.255.255.0 192.168.200.1
DCR-1751:
DCR-1751(config)# ip route 192.168.10.0 255.255.255.0 192.168.200.2
DCR-1751(config)# ip route 192.168.20.0 255.255.255.0 192.168.200.2
DCR-1751(config)# ip route 192.168.30.0 255.255.255.0 192.168.200.2
DCR-1751(config)# ip route 192.168.100.0 255.255.255.0 192.168.200.2
或者利用缺省路由代替:
DCR-1751 (config)#ip route 0.0.0.0 0.0.0.0255.255.255.0192.168.200.2