網絡設備配置與管理---VLAN間路由實現部門間通信




理論學習

問題1:三層交換機的路由共有幾種實現方式?

1) 虛擬交換接口(svi

2) 路由接口routed port

3) 三層聚合鏈路(L3 Aggregate Link 接口

 

問題2:描述單臂路由的實現原理?

 

單臂路由是在二層交換機上進行vlan 劃分的,然後通過一條中繼鏈路連接路由器的一個接口(通常路由需要使用至少兩個接口來實現路由功能,而現在只需要一個接口,就像一條胳膊在發揮作用以 稱之爲單臂路由在路由器上通過配置子接口和802.1Q 協議封裝最終實現在vlan 信息和子網一一對應,即實現vlan 的路由功能。

 

 

問題3:SVI的含義是什麼?如何實現VLAN間路由?

 

交換機虛擬接口(Switch Virtual InterfaceSVI)代表一個由交換端口構成的VLAN(其實就是通常所說的VLAN接口),以便於實現系統中路由和橋接的功能。一個交換機虛擬接口對應一個VLAN,當需要路由虛擬局域網之間的流量或橋接VLAN之間不可路由的協議,以及提供IP主機到交換機的連接的時候,就需要爲相應的虛擬局域網配置相應的交換機虛擬接口,其實SVI就是指通常所說的VLAN接口,只不過它是虛擬的,用於連接整個VLAN,所以通常也把這種接口稱爲邏輯三層接口,也是三層接口。

三層可以劃分vlanvlan設置一個地址當網關 ,實現vlan間的路由

也可以在二層創建vlan,三層通過虛擬子接口 創建單臂路由,實現vlan間的路由

問題4:路由接口和SVI接口實現路由什麼不同

 

svi接口說白了就是vlan接口,在上面配上ip,然後把二層端口加入進來,以前的設備不能直接在端口 上配ip,就用svi接口方式來配ip,實現三層連接。

而路由接口,是直接在端口上設置ip實現路由

 

    問題5:交換機的VLAN有哪些類型?

 

1) 業務vlan

2) 互聯vlan

   3)  管理vlan

工作任務描述

某公司現有兩個部門,每個部門各有100臺左右的計算機,所有計算機位於同一子網,現在發現整個網絡的通信質量很差,請問如何進行網絡改造以提高網絡通信質量。

工作任務實施

網絡拓撲結構設計(粘貼PT的拓撲圖)

wKiom1WH6lqQbvt3AADLsGsvcgY042.jpg

方案一:SW1連接A部門的計算機,SW2連接B部門計算機,兩臺二層交換機不做任何配置,僅用於網絡接入,而這兩臺二層交換機上行線路分別連接到RS交換機的一個VLAN,爲RS的兩個VLAN配置IP地址即可實現VLAN間路由功能。這種網絡的規劃和配置適合於AB兩部門的計算機相對獨立的連接在各自的交換機上,僅需要解決的是兩個部門之間的路由問題。

        方案一配置:

 

Rs

 

RS#show run

Building configuration...

 

Current configuration : 1307 bytes

!

version 12.2

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname RS

!

!

!

ip routing

!

!

spanning-tree mode pvst

!

!

interface FastEthernet0/1

!

(省略……)

!

interface FastEthernet0/23

 switchport access vlan 2

 switchport mode access

!

interface FastEthernet0/24

 switchport access vlan 3

 switchport mode access

!

interface GigabitEthernet0/1

!

interface GigabitEthernet0/2

!

interface Vlan1

 no ip address

 shutdown

!

interface Vlan2

 ip address 192.168.1.254 255.255.255.0

!

interface Vlan3

 ip address 192.168.2.254 255.255.255.0

!

ip classless

!

!

line con 0

!

line aux 0

!

line vty 0 4

 login

!

!

!

end

 

 

 

 

 

試以及查看RS的路由

 

RS# show ip route 

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidate default, U - per-user static route, o - ODR

       P - periodic downloaded static route

 

Gateway of last resort is not set

 

C    192.168.1.0/24 is directly connected, Vlan2

C    192.168.2.0/24 is directly connected, Vlan3

 

方案二:如果AB部門的計算機由於地理位置的原因,分別連接在SW1SW2交換機上,則需要將SW1SW2的兩條上行線路設置爲Trunk線路,RS交換機採用VTP域的模式實現擴展VLAN的功能,然後在RS三層交換機上通過配置各個VLANIP地址實現兩個VLAN之間的路由功能。

方案二配置

RS

 

RS#show run

Building configuration...

 

Current configuration : 1381 bytes

!

version 12.2

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname RS

!

!

ip routing

!

!

spanning-tree mode pvst

!

!

interface FastEthernet0/1

!

(省略……

!

interface FastEthernet0/23

 switchport access vlan 2

 switchport trunk encapsulation dot1q

 switchport mode trunk

!

interface FastEthernet0/24

 switchport access vlan 3

 switchport trunk encapsulation dot1q

 switchport mode trunk

!

interface GigabitEthernet0/1

!

interface GigabitEthernet0/2

!

interface Vlan1

 no ip address

 shutdown

!

interface Vlan2

 ip address 192.168.1.254 255.255.255.0

!

interface Vlan3

 ip address 192.168.2.254 255.255.255.0

!

ip classless

!

!

line con 0

!

line aux 0

!

line vty 0 4

 login

!

!

end

 

 

Sw1

 

 

Sw1#show run

Building configuration...

 

Current configuration : 1091 bytes

!

version 12.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Sw1

!

!

spanning-tree mode pvst

!

interface FastEthernet0/1

 switchport access vlan 2

 switchport mode access

!

interface FastEthernet0/2

 switchport access vlan 3

 switchport mode access

!

interface FastEthernet0/3

!

(省略……

!

interface FastEthernet0/24

 switchport mode trunk

!

interface Vlan1

 no ip address

 shutdown

!

!

line con 0

!

line vty 0 4

 login

line vty 5 15

 login

!

!

end

 

 

Sw2

 

Sw2#show run

Building configuration...

 

Current configuration : 1091 bytes

!

version 12.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Sw2

!

!

spanning-tree mode pvst

!

interface FastEthernet0/1

 switchport access vlan 2

 switchport mode access

!

interface FastEthernet0/2

 switchport access vlan 3

 switchport mode access

!

interface FastEthernet0/3

!

(省略……

!

interface FastEthernet0/24

 switchport mode trunk

!

interface Vlan1

 no ip address

 shutdown

!

!

line con 0

!

line vty 0 4

 login

line vty 5 15

 login

!

!

end

試以及查看RS的路由

 

RS#show ip route 

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidate default, U - per-user static route, o - ODR

       P - periodic downloaded static route

 

Gateway of last resort is not set

 

C    192.168.1.0/24 is directly connected, Vlan2

C    192.168.2.0/24 is directly connected, Vlan3

 

如果改爲三層接口如何實現

RS

 

show run

Building configuration...

 

Current configuration : 1317 bytes

!

version 12.2

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname RS

!

!

ip routing

!

!

spanning-tree mode pvst

!

!

interface FastEthernet0/1

!

(省略……

!

interface FastEthernet0/23

 no switchport

 ip address 192.168.1.254 255.255.255.0

 duplex auto

 speed auto

!

interface FastEthernet0/24

 no switchport

 ip address 192.168.2.254 255.255.255.0

 duplex auto

 speed auto

!

interface GigabitEthernet0/1

!

interface GigabitEthernet0/2

!

interface Vlan1

 no ip address

 shutdown

!

interface Vlan2

 no ip address

!

interface Vlan3

 no ip address

!

ip classless

!

!

line con 0

!

line aux 0

!

line vty 0 4

 login

!

!

end

工作擴展

擴展ACL的配置

由於購買三層交換機的投入較大,上述實驗我們也可以採用一種較爲省錢的方法來實現,就是採用單臂路由,這樣只要加入一個路由器,就可以實現二層交換機各VLAN間的路由了。

     具體配置:

R1

 

R1#show run

Building configuration...

 

Current configuration : 594 bytes

!

version 12.2

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname R1

!

!

interface FastEthernet0/0

 no ip address

 duplex auto

 speed auto

!

interface FastEthernet0/0.1

 encapsulation dot1Q 2

 ip address 192.168.1.254 255.255.255.0

!

interface FastEthernet0/0.2

 encapsulation dot1Q 3

 ip address 192.168.2.254 255.255.255.0

!

interface FastEthernet0/1

 no ip address

 duplex auto

 speed auto

 shutdown

!

ip classless

!

!

line con 0

!

line aux 0

!

line vty 0 4

 login

!

!

end

 

Switch

 

 

show run

Building configuration...

 

Current configuration : 1094 bytes

!

version 12.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Switch

!

!

spanning-tree mode pvst

!

interface FastEthernet0/1

 switchport access vlan 2

 switchport mode access

!

interface FastEthernet0/2

 switchport access vlan 3

 switchport mode access

!

interface FastEthernet0/3

!

(省略……

!

interface FastEthernet0/24

 switchport mode trunk

!

interface Vlan1

 no ip address

 shutdown

!

!

line con 0

!

line vty 0 4

 login

line vty 5 15

 login

!

!

end

思考問題:

問題1:單臂路由和三層交換機的VLAN間路由有什麼不同?

 

單臂路由在大流量的情況下,會給路由器帶來很大的負荷。

 

而三層交換機的VLAN間路由由交換機的三層轉發引擎完成,其性能取決於交換機的背板轉發速率,注意,因爲一般的三層交換機都可以在多個端口上(注意:不是全部端口同時線速轉發)輕鬆實現線速轉發,可以獲得很好的性能,VLAN間流量不必經過路由器,網絡延時和抖動都很小,同時也極大程度的減輕上層接入路由器的負載。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章