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

时间:2020-08-08 08:10:40 网络技术 我要投稿

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

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

  配置23口:

  Switch#enable

  Switch#configure terminal

  Switch(config)#interface fastEthernet 0/23

  Switch(config)ip addr 50.1.1.1 255.255.255.0

  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 60.1.1.1 255.255.255.0

  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 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 ms

  Switch#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 ms

  Switch#

  pc1(win7)增加路由:

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

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

【思科三层交换机路由功能配置实例】相关文章:

思科三层交换机配置实例及命令05-21

思科三层交换机配置08-14

思科交换机划分vlan配置实例09-15

思科三层交换机配置命令大全08-19

H3C配置三层交换机配置实例08-14

华为交换机路由器配置实例201610-04

交换机RPR三层组网功能的配置08-22

思科交换机和路由器的基本配置05-16

思科交换机限速及限制BT下载配置实例11-13