糯米文学吧

位置:首页 > 计算机 > 网络技术

思科三层交换机路由功能配置实例

普通交换机工作在链路层,即二层交换机,无路由功能,也就是只能同一个网段的机器才能通信。下面是小编收集的思科三层交换机路由功能配置实例,希望对你有帮助!

思科三层交换机路由功能配置实例

  配置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口)就没有交换能力了。

如果又要交换机有路由功能,又有交换功能,那么交换功能可以由其它口负担。