啃书文库 > 科技 >
普通交换机工作在链路层,即二层交换机,无路由功能,也就是只能同一个网段的机器才能通信。而三层交换机可以在互联网层配置路由功能,使不同网段的设施可以通信。现以思科3550交换机为例配置三层路由功能。以达成如下拓扑通信。
----------------------------------| 思科3550三层交换机 |---- -------------------- -------50.1.1.1 (23口) 60.1.1.1(24口)|| |||| ||50.1.1.2 60.1.1.2(pc1) (pc2)配置23口:Switch#enableSwitch#configure terminalSwitch(config)#interface fastEthernet 0/23Switch(config)ip addr 50.1.1.1 255.255.255.0Switch(config-if)#no switchportSwitch(config-if)#no shutdownSwitch(config-if)#end
类似的配置24口:Switch#enableSwitch#configure terminalSwitch(config)#interface fastEthernet 0/24Switch(config)ip addr 60.1.1.1 255.255.255.0Switch(config-if)#no switchportSwitch(config-if)#no shutdownSwitch(config-if)#end
打开交换机路由转发开关:Switch#configure terminalSwitch(config)#ip routingSwitch(config)#ip cef (这个默认是打开的)
此时可以查询下23口的状况:Switch#show interfaces fastEthernet 0/23
此时在交换机上ping两个口的地址成功:Switch#ping 50.1.1.1
Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 50.1.1.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 msSwitch#ping 60.1.1.1
Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 60.1.1.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 msSwitch#
pc1(Windows 7)增加路由:到60.1.1.0/24的数据包通过50.1.1.1转发:route ADD 60.1.1.0 MASK 255.255.255.0 50.1.1.1 METRIC 3
对应的pc2也增加路由:route ADD 50.1.1.0 MASK 255.255.255.0 60.1.1.1 METRIC 3
此时50.1.1.2和60.1.1.2即可通信。
假如用了交换机口的路由功能,那样此口(即这里的23,24口)就没交换能力了。假如又要交换机有路由功能,又有交换功能,那样交换功能可以由其它口负担。
- 上一篇:应对科普清明时节,牢记防火15条,祭扫踏青无火患!
- 下一篇:没有了
猜你喜欢
- 2024-04-05 华三交换机怎么样备份配置? 华三交换机配置保存
- 热点排行
- 热门推荐
- 热门tag