单臂路由和三层路由

网友投稿 245 2022-11-06

单臂路由和三层路由

单臂路由和三层路由

单臂路由

4、单臂路由的缺陷:(1)“单臂”为网络骨干链路,容易形成网络瓶颈。(2)子接口依然依托于物理接口,应用不灵活。(3)VLAN间转发需要查看路由表,严重浪费设备资源。

子接口:路由器的物理接口可以分化为多个逻辑接口,每一个子接口对应一个VLAN网段网关。

单臂路由的配置:

交换机的配置: sys [Huawei]sys SW1 [SW1]un in en [SW1]user-interface console 0 [SW1-ui-console0]idle-timeout 0 0 [SW1-ui-console0]q [SW1]vlan b 10 20 [SW1]int e0/0/1 [SW1-Ethernet0/0/1]p l a [SW1-Ethernet0/0/1]p d v 10 [SW1-Ethernet0/0/1]un sh [SW1-Ethernet0/0/1]dis th # interface Ethernet0/0/1 port link-type access port default vlan 10 # return [SW1-Ethernet0/0/1]int e0/0/2 [SW1-Ethernet0/0/2]p l a [SW1-Ethernet0/0/2]p d v 20 [SW1-Ethernet0/0/2]un sh [SW1-Ethernet0/0/2]dis th # interface Ethernet0/0/2 port link-type access port default vlan 20 # return [SW1-Ethernet0/0/2]int e0/0/3 [SW1-Ethernet0/0/3]p l t [SW1-Ethernet0/0/3]p t a v a [SW1-Ethernet0/0/3]un sh [SW1-Ethernet0/0/3]dis th # interface Ethernet0/0/3 port link-type trunk port trunk allow-pass vlan 2 to 4094 # return [SW1-Ethernet0/0/3]q [SW1] 路由器R1的配置: [Huawei]sys R1 [R1]UN IN EN [R1]user-interface console 0 [R1-ui-console0]idle-timeout 0 0 [R1-ui-console0]q [R1]int g0/0/0.10 [R1-GigabitEthernet0/0/0.10]dis th [V200R003C00] # interface GigabitEthernet0/0/0.10 # return [R1-GigabitEthernet0/0/0.10]ip add 192.168.10.1 24 [R1-GigabitEthernet0/0/0.10]un sh [R1-GigabitEthernet0/0/0.10]dis th [V200R003C00] # interface GigabitEthernet0/0/0.10 ip address 192.168.10.1 255.255.255.0 # return [R1-GigabitEthernet0/0/0.10]dot1q termination vid 10 ==//分成子接口== [R1-GigabitEthernet0/0/0.10]arp broadcast enable [R1-GigabitEthernet0/0/0.10]dis th [V200R003C00] # interface GigabitEthernet0/0/0.10 dot1q termination vid 10 ip address 192.168.10.1 255.255.255.0 arp broadcast enable # return [R1-GigabitEthernet0/0/0.10]q [R1]int g0/0/0.20 [R1-GigabitEthernet0/0/0.20]dot1q termination vid 20 [R1-GigabitEthernet0/0/0.20]ip add 192.168.20.1 24 [R1-GigabitEthernet0/0/0.20]un sh [R1-GigabitEthernet0/0/0.20]arp broadcast enable [R1-GigabitEthernet0/0/0.20]dis th [V200R003C00] # interface GigabitEthernet0/0/0.20 dot1q termination vid 20 ip address 192.168.20.1 255.255.255.0 arp broadcast enable # return [R1-GigabitEthernet0/0/0.20]q [R1]dis ip interface brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 4 The number of interface that is DOWN in Physical is 2 The number of interface that is UP in Protocol is 3 The number of interface that is DOWN in Protocol is 3 Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 unassigned up down GigabitEthernet0/0/0.10 192.168.10.1/24 up up GigabitEthernet0/0/0.20 192.168.20.1/24 up up GigabitEthernet0/0/1 unassigned down down GigabitEthernet0/0/2 unassigned down down NULL0 unassigned up up(s) [R1]

三层交换机

三层交换技术可以实现VLAN之间通信,三层交换机具有路由功能,每个VLAN的虚接口就是该网段的网关。

数据在传输时,当三层交换机接收到第一个数据包时,由三层引擎来处理,会拆分原数据帧,重新封装新的源MAC和目的MAC地址,并且因为帧头部发生变化,最后的帧校验CRC也应当随之变化。第一个包之后,在硬件中创建一个MLS条目,用于后续数据包由硬件执行重新封装和快速转发。2层数据帧会被重新封装为需要转发的下一个网段的帧格式。这个过程就是MLS的“一次路由,多次交换”的原理。

基于CEF(一种基于拓扑转发的模型)的MLS,其关键是两张转发信息表,1、转发信息库(FIB)与路由表一一对应,是路由表的一个镜像。路由更新时,FIB随之变化,其中包含邻接主机的IP地址和VLAN ID的对应关系。2、邻接关系表中包含邻接主机和交换机MAC地址的对应关系,用来提供二层重写信息。

三层交换机配置VLAN接口的虚接口的配置:

SW2配置: SYS [Huawei]SYS SW2 [SW2]un in en [SW2]user-interface console 0 [SW2-ui-console0]idle-timeout 0 0 [SW2-ui-console0]q [SW2]int e0/0/1 [SW2-Ethernet0/0/1]q [SW2]v b 10 20 30 [SW2]int e0/0/1 [SW2-Ethernet0/0/1]p l a [SW2-Ethernet0/0/1]p d v 10 [SW2-Ethernet0/0/1]un sh [SW2-Ethernet0/0/1]dis th # interface Ethernet0/0/1 port link-type access port default vlan 10 # return [SW2-Ethernet0/0/1]q [SW2]int e0/0/2 [SW2-Ethernet0/0/2]p l a [SW2-Ethernet0/0/2]p d v 20 [SW2-Ethernet0/0/2]un sh [SW2-Ethernet0/0/2]dis th # interface Ethernet0/0/2 port link-type access port default vlan 20 # return [SW2-Ethernet0/0/2]int e0/0/3 [SW2-Ethernet0/0/3]p l a [SW2-Ethernet0/0/3]p d v 30 [SW2-Ethernet0/0/3]un sh [SW2-Ethernet0/0/3]dis th # interface Ethernet0/0/3 port link-type access port default vlan 30 # return [SW2-Ethernet0/0/3]int e0/0/4 [SW2-Ethernet0/0/4]p l t //交换机和交换机相连要设置成trunk模式 [SW2-Ethernet0/0/4]p t a v a //允许所有vlan的数据通过 [SW2-Ethernet0/0/4]un sh [SW2-Ethernet0/0/4]dis th # interface Ethernet0/0/4 port link-type trunk port trunk allow-pass vlan 2 to 4094 # return [SW2-Ethernet0/0/4]q [SW2] SW1配置: sys [Huawei]sys SW1 [SW1]un in en [SW1]user-interface console 0 [SW1-ui-console0]idle-timeout 0 0 [SW1-ui-console0]q [SW1]v b 10 20 30 [SW1]int Vlanif 10 ==//在虚拟vlan接口上配置地址== [SW1-Vlanif10]ip add 192.168.10.1 24 [SW1-Vlanif10]int Vlanif 20 [SW1-Vlanif20]ip add 192.168.20.1 24 [SW1-Vlanif20]int Vlanif 30 [SW1-Vlanif30]ip add 192.168.30.1 24 [SW1-Vlanif30]q [SW1]int g0/0/1 [SW1-GigabitEthernet0/0/1]p l t [SW1-GigabitEthernet0/0/1]p t a v a [SW1-GigabitEthernet0/0/1]un sh [SW1-GigabitEthernet0/0/1]dis th # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 2 to 4094 # return [SW1-GigabitEthernet0/0/1]q [SW1]

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:马斯克脑机接口试验距离 Neuralink 最终的目的是什么?
下一篇:DHCP与DHCP中继
相关文章

 发表评论

暂时没有评论,来抢沙发吧~