單臂路由協議

這個實驗主要是解決了用一個路由器完成兩個VLAN之間的通信。

實驗器材:一臺交換機  一臺錄由器   兩臺電腦。還有些雙膠線。

實驗過程:

            1:連線 ,把PC1,PC2 分別連到交換機的0/1,0/2號端口。把交換機的0/10號端口和路由器的0/1號端口相連。

            2:進行交換機和路由器的一些配置。

                

switch(config)#enab

switch(config)#enable pass

switch(config)#enable password 123

switch(config)#vlan 10

switch(config-vlan)#exit

switch(config)#vlan 20

switch(config-vlan)#exit

switch(config-vlan)#int fa0/1

switch(config-if)#sw acc vlan 10

switch(config-if)#exit

switch(config)#int fa0/2

switch(config-if)#sw acc vlan 20

switch(config-if)#exit

switch(config)#int fa0/10

switch(config-if)#sw mode trunk

switch(config-if)#end

錄由器的配置:

router(config-if)#

router(config-if)#exit

router(config)#int fa0/1.1

router(config-subif)#

%LINK-5-CHANGED: Interface FastEthernet0/1.1, changed state to up


%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1.1, changed state to up


router(config-subif)#ip add 1.1.1.254 255.255.255.0


% Configuring IP routing on a LAN subinterface is only allowed if that

subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q,

or ISL vLAN.


router(config-subif)#

router(config-subif)#encpa

router(config-subif)#encap

router(config-subif)#encapsulation  dot1

router(config-subif)#encapsulation  dot1Q 

router(config-subif)#encapsulation  dot1Q 1

router(config-subif)#encap

router(config-subif)#encapsulation dot

router(config-subif)#encapsulation dot1Q 10

router(config-subif)#ip add 1.1.1.254 255.255.255.0

router(config-subif)#no shut

router(config-subif)#exit

router(config)#int fa0/1.2


%LINK-5-CHANGED: Interface FastEthernet0/1.2, changed state to up


%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1.2, changed state to up

router(config-subif)#encap

router(config-subif)#encapsulation dot

router(config-subif)#encapsulation dot1Q 20

router(config-subif)#ip add 2

                            ^

% Invalid input detected at '^' marker.

router(config-subif)#ip add 2.2.2.254 255.255.255.0

   3;給兩臺電腦分別設置    IP分別爲1.1.1.1 255.255.255.0 和 2.2.2.2 255.255.255.0

   4:測試兩臺電腦間能否PING通。

    5:總結:這次試驗最爲奇特的地方是一個路由器的端口可以設成兩個  很多個子端口,可以分別高IP。

      還有個新東西是VLAN 出的數據包路由器並不能識別,所以還行在路由器的子端口裏加上encapsultion dotlQ  vlan  這麼一條指令。

       動手操作得以實現,踏上網管之路。


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