文章目录
- 一、三层交换技术
- 1、传统的MLS2-1
- 2、基于CEF的MLS
- 3、拓扑命令详解
- 二、链路聚合
- 1、概述
- 2、Eth-trunk的工作模式
- 2.1、Manual Load-balance 手工负载分担:
- 2.2、工作模式:静态LACP
- 3、实验拓展
一、三层交换技术
- 使用三层交换技术实现VLAN间的通信
- 三层交换=二层交换+三层转发
三层交换机通过硬件来交换和路由选择数据包。为了在硬件中处理数据包的高层信息,Cisco Catalyst 交换机使用传统的MLS体系结构或基于CEF的MLS体系结构。
1、传统的MLS2-1
- 三层转发过程中要重新封装2层
三层交换机上,第三层引擎处理数据流第一个包 - 传统的MLS2-2
- 交换ASIC从三层引擎中获悉2层重写信息在硬件中创建一个MLS条目
- 负责重写和转发数据流中的后续数据包
2、基于CEF的MLS
CEF是一种基于拓扑换发的模型
- 转发信息库(FIB)
- 邻接关系表
其中FIB是路由表的映像
3、拓扑命令详解
创建vlan:vlan 10
port link-type access(p l a):设置接口模式access
port default vlan 10(p d v 10):接入接口vlan 10
port link-type trunk(p l t):设置接口模式trunk
port trunk allow-pass vlan 20/all(p t a v a):接入接口vlan 20/all
实验拓展:
SW1:
<Huawei>sys
[Huawei]sys sw1
[sw1]vlan batch 10 20
[sw1]int e0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]p d v 10
[sw1-Ethernet0/0/1]q
[sw1]int e0/0/2
[sw1-Ethernet0/0/2]p l a
[sw1-Ethernet0/0/2]p d v 20
[sw1]int e0/0/4
[sw1-Ethernet0/0/4]p l t
[sw1-Ethernet0/0/4]p t a v a
[sw1-Ethernet0/0/4]q
[sw1]int e0/0/3
[sw1-Ethernet0/0/3]p l t
[sw1-Ethernet0/0/3]p t a v a
SW2:
[Huawei]sys sw2
[sw2]vlan batch 10 20
[sw2]int e0/0/1
[sw2-Ethernet0/0/1]p l a
[sw2-Ethernet0/0/1]p d v 10
[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]int e0/0/3
[sw2-Ethernet0/0/3]p l t
[sw2-Ethernet0/0/3]p t a v a
RSW:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys RSW
[RSW]vlan 10 20
[RSW]vlan batch 10 20
[RSW]int vlanif 10
[RSW-Vlanif10]ip add 192.168.1.254 24
[RSW-Vlanif10]int vlanif 20
[RSW-Vlanif20]ip add 192.168.2.254 24
[RSW]int g0/0/1
[RSW-GigabitEthernet0/0/1]p l t
[RSW-GigabitEthernet0/0/1]p t a v a
[RSW]vlan 30
[RSW-vlan30]int g0/0/2
[RSW-GigabitEthernet0/0/2]p l a
[RSW-GigabitEthernet0/0/2]p d v 30
[RSW-GigabitEthernet0/0/2]int vlanif 30
[RSW-Vlanif30]ip add 192.168.30.1 24
ping的结果是通的
[RSW]ping 192.168.30.2
PING 192.168.30.2: 56 data bytes, press CTRL_C to break
Reply from 192.168.30.2: bytes=56 Sequence=1 ttl=255 time=100 ms
Reply from 192.168.30.2: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 192.168.30.2: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 192.168.30.2: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 192.168.30.2: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.30.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/52/100 ms
R1:
[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.30.2 24
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.40.1 24
[R1]ip route-static 192.168.1.0 24 192.168.30.1
[R1]ip route-static 192.168.2.0 24 192.168.30.1
R2:
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.40.2 24
[Huawei-GigabitEthernet0/0/0]q
[Huawei]ip route-static 192.168.30.0 24 192.168.40.1
二、链路聚合
1、概述
链路聚合是将一组物理接口捆绑在一起作为一个逻辑接口来增加带宽的一种方法,又称为多接口负载均衡组或链路聚合组,相关的协议标准请参考IEEE802.3ad。
通过在两台设备之间建立链路聚合组,可以提供更高的通讯带宽和更高的可靠性。链路聚合不仅为设备间通信提供了冗余保护,而且不需要对硬件进行升级。
2、Eth-trunk的工作模式
华为的网络设备支持两种Eth-trunk工作模式
手工负载模式
LACR模式:配置了之后自动检测协商主配置:master(是用几根线)和备份,又称M:N
2.1、Manual Load-balance 手工负载分担:
简单的说就是:没有LACP的支持、每条都支持数据转发、一旦有设备故障,其他链路分担流量、一般在设备上不支持LACP 才会配置手工负载。利用LACP协议,自己定义活动接口和非活动接口;
2.2、工作模式:静态LACP
与手工负载分担欧式的主要区别为:
静态LAVP有备份链路,而手工负载分担模式所有成员接口均处于转发状态,分担负载流量
静态LACP不需要热工干预,由LACP协议自动协商完成
比如:有三条数据线,在sawitchA和sawitchB不同结果时,
sawitchA要求AB作为主数据,C作为备份,sawitchB觉得A作为备份,BC主,因为sawitchA优先级高,还是AB作为主数据,C作为备份。
3、实验拓展
实验要求:全网互通
1、二层交换机之间做LACP链路聚合
2、R1和R4有一条链路做浮动路由
SW1:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW1
[SW1]vlan batch 10 20 30 40 50 60
[SW1]int e0/0/1
[SW1-Ethernet0/0/1]p l a
[SW1-Ethernet0/0/1]p d v 10
[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]int e0/0/3
[SW1-Ethernet0/0/3]p l t
[SW1-Ethernet0/0/3]p t a v a
[SW1]int Eth-Trunk 1
[SW1-Eth-Trunk1]p l t
[SW1-Eth-Trunk1]pt a v a
[SW1-Eth-Trunk1]mode lacp-static
[SW1-Eth-Trunk1]trunkport e 0/0/4 to 0/0/6
SW2
[Huawei]sys SW2
[SW2]vlan batch 10 20 30 40 50 60
[SW2]INT e0/0/1
[SW2-Ethernet0/0/1]p l a
[SW2-Ethernet0/0/1]p d v 30
[SW2-Ethernet0/0/1]int e0/0/2
[SW2-Ethernet0/0/2]p l a
[SW2-Ethernet0/0/2]p d v 40
[SW2-Ethernet0/0/2]int e0/0/4
[SW2-Ethernet0/0/4]p l t
[SW2-Ethernet0/0/4]p t a v
[SW2]int Eth-Trunk 1
[SW2-Eth-Trunk1]p l t
[SW2-Eth-Trunk1]p t a v
[SW2-Eth-Trunk1]mode lacp-static
[SW2-Eth-Trunk1]trunkport
[SW2-Eth-Trunk1]trunkport e0/0/6
[SW2-Eth-Trunk1]trunkport e0/0/3
[SW2-Eth-Trunk1]trunkport e0/0/7
[SW2]int Eth-Trunk 2
[SW2-Eth-Trunk2]p l t
[SW2-Eth-Trunk2]p t a v a
[SW2-Eth-Trunk2]mode lacp-static
[SW2-Eth-Trunk2]trunkport e0/0/8
[SW2-Eth-Trunk2]trunkport e0/0/5
[SW2-Eth-Trunk2]trunkport e0/0/9
SW3
[SW3]sys SW3
[SW3]vlan batch 10 20 30 40 50 60
[SW3]int e0/0/1
[SW3-Ethernet0/0/1]p l a
[SW3-Ethernet0/0/1]p d v 50
[SW3-Ethernet0/0/1]int e0/0/2
[SW3-Ethernet0/0/2]p l a
[SW3-Ethernet0/0/2]p d v 60
[SW3-Ethernet0/0/2]int e0/0/3
[SW3-Ethernet0/0/3]p l t
[SW3-Ethernet0/0/3]p t a v a
[SW3]int Eth-Trunk 2
[SW3-Eth-Trunk2]p l t
[SW3-Eth-Trunk2]p t a v a
[SW3-Eth-Trunk2]mode lacp-static
[SW3-Eth-Trunk2]trunkport e 0/0/4 to 0/0/6
RSW
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]SYS RSW
[RSW]vlan batch 10 20 30 40 50 60
[RSW]int g0/0/1
[RSW-GigabitEthernet0/0/1]p l t
[RSW-GigabitEthernet0/0/1]p t a v a
[RSW-GigabitEthernet0/0/1]int g0/0/3
[RSW-GigabitEthernet0/0/3]p l t
[RSW-GigabitEthernet0/0/3]p t a v a
[RSW-GigabitEthernet0/0/3]int g0/0/4
[RSW-GigabitEthernet0/0/4]p l t
[RSW-GigabitEthernet0/0/4]p t a v a
[RSW-GigabitEthernet0/0/1]int vlanif 10
[RSW-Vlanif10]ip add 192.168.10.254 24
[RSW-Vlanif10]int vlanif 20
[RSW-Vlanif20]ip add 192.168.20.254 24
[RSW-Vlanif20]int vlanif 30
[RSW-Vlanif30]ip add 192.168.30.254 24
[RSW-Vlanif30]int vlanif 40
[RSW-Vlanif40]ip add 192.168.40.254 24
[RSW-Vlanif40]int vlanif 50
[RSW-Vlanif50]ip add 192.168.50.254 24
[RSW-Vlanif50]int vlanif 60
[RSW-Vlanif60]ip add 192.168.60.254 24
[RSW]int vlan 70
[RSW-Vlanif70]ip route-static 192.168.70.0 24 192.168.80.1
R1
[Huawei]sys R1
[R1]INT g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.80.1 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.90.1 24
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 192.168.100.1 24
[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.80.2
[R1]ip route-static 192.168.70.0 24 192.168.90.2
[R1]ip route-statuc 192.168.70.0 24 192.168.100.2
[R1]ip route-static 192.168.70.0 24 192.168.100.2
R2
[Huawei]sys R2
[R2]INT g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.90.2 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.120.1 24
[R2]ip route-static 192.168.70.0 24 192.168.120.2
[R2]ip route-static 0.0.0.0 0.0.0.0 192.168.90.1
R3
[Huawei]sys R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.100.2 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.110.1 24
[R3]ip route-static 192.168.70.0 24 192.168.110.2
[R3]ip route-static 0.0.0.0 0.0.0.0 192.168.100.1
R4
[Huawei]sys R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.110.2 24
[R4-GigabitEthernet0/0/1]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.120.2 24
[R4-GigabitEthernet0/0/1]int g0/0/2
[R4-GigabitEthernet0/0/2]ip add 192.168.70.1 24
[R4]ip route-static 0.0.0.0 0.0.0.0 192.168.120.1
[R4]ip route-static 0.0.0.0 0.0.0.0 192.168.110.1