A-A+

图文讲解:Cisco单臂路由的配置的应用实例

2015年11月19日 站长资讯 暂无评论

对于单臂路由可能大家了解的不多,所以今天特意通过一个实验来说明其应用,实验采用一个思科路由和一个交换机,另外再接了两台PC机来完成,下面有详细的图文讲解。

单臂路由,即在路由器上设置多个逻辑子接口,每个子接口对应一个vlan。在每个子接口的数据在物理链路上传递都要标记封装。Cisco设备支持ISL和802.1q(dot1Q)协议。华为只支持802.1q。

DOT1Q和ISL的区别:DOT1Q是各类产品的VLAN通用协议模式,Dot1q是一种普遍使用的标准,适用所有交换机与路由设备。支持超过1024vlan,而ISL最多支持1024个vlan。ISL是CISCO设备的专用协议,适用于Cisco设备。 ISL(Interior Switching Link)交换机间协议用于实现CISCO交换机间的VLAN中继。它是一个信息包标记协议,在支持ISL接口上发送的帧由一个标准以太网帧及相关的VLAN信息组成。

  1. PC1: IP :172.16.3.1/24     GW:255.255.255.0  
  2. PC2: IP :172.16.4.1/24     GW:255.255.255.0  
  3.    
  4. S1:  
  5.    
  6. Switch>enable  
  7. Switch#vlan database  
  8. Switch(vlan)#vlan 30  
  9. Switch(vlan)#vlan 40  
  10. Switch# configure terminal  
  11. Switch(config)#int fastEthernet 0/1  
  12. Switch(config-if)#switchport access vlan 30  
  13. Switch(config-if)#int f0/2  
  14. Switch(config-if)#switchport access vlan 40  
  15. Switch(config-if)#int f 0/24  
  16. Switch(config-if)#switchport mode trunk                (把该接口设置为trunk模式)  
  17. Switch(config-if)#switchport trunk allowed vlan all        (运行所有vlan通过)  
  18.    
  19. RT1:  
  20.    
  21. Router>enable  
  22. Router#configure terminal  
  23. Router(config)#int fastEthernet 0/0.1      (进入子接口)  
  24. Router(config-subif)#encapsulation dot1Q 30      (封装dot1Q协议,建立与vlan30的关联)  
  25. Router(config-subif)#ip add 172.16.3.254 255.255.255.0  
  26. Router(config-subif)#int f 0/0.2  
  27. Router(config-subif)#encapsulation dot1Q 40       (封装dot1Q协议,建立与vlan40的关联)  
  28. Router(config-subif)#ip add 172.16.4.254 255.255.255.0  
  29. Router(config-subif)#int f 0/0  
  30. Router(config-if)#no shutdown             (启动f0/0的接口,包括所有子接口)  

完成。Vlan30能与vlan40互相通讯。

标签:

给我留言