糯米文學吧

位置:首頁 > 計算機 > 網絡技術

思科三層交換機路由功能配置實例

普通交換機工作在鏈路層,即二層交換機,無路由功能,也就是隻能同一個網段的機器才能通信。下面是小編收集的思科三層交換機路由功能配置實例,希望對你有幫助!

思科三層交換機路由功能配置實例

  配置23口:

Switch#enable

Switch#configure terminal

Switch(config)#interface fastEthernet 0/23

Switch(config)ip addr

Switch(config-if)#no switchport

Switch(config-if)#no shutdown

Switch(config-if)#end

  類似的`配置24口:

Switch#enable

Switch#configure terminal

Switch(config)#interface fastEthernet 0/24

Switch(config)ip addr

Switch(config-if)#no switchport

Switch(config-if)#no shutdown

Switch(config-if)#end

  打開交換機路由轉發開關:

Switch#configure terminal

Switch(config)#ip routing

Switch(config)#ip cef (這個默認是打開的)

  此時可以查看下23口的狀態:

Switch#show interfaces fastEthernet 0/23

  此時在交換機上ping兩個口的地址成功:

Switch#ping

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

Switch#ping

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms

Switch#

  pc1(win7)增加路由:

到的數據包通過轉發:

route ADD MASK METRIC 3

對應的pc2也增加路由:

route ADD MASK METRIC 3

此時和即可通信。

如果使用了交換機口的路由功能,那麼此口(即這裏的23,24口)就沒有交換能力了。

如果又要交換機有路由功能,又有交換功能,那麼交換功能可以由其它口負擔。