目录
- 三层交换机
- 1.三层交换机技术
- 链路聚合
- 1.链路聚合概述
- 2.链路聚合的工作模式
- 实验
- 实验一
三层交换机
1.三层交换机技术
交换机使用三层交换机技术实现vlan间的通信,三层交换=二层交换+三层转发。
在三层交换机上,第三层引擎处理数据流的的第一包(只在第一个包进行arp广播,后续数据包不进行处理)
在三层交换机上配置的vlan接口为虚接口,虚接口的引入使得交换机的使用更加灵活。
interface vlan id进入虚接口,可以在虚接口的基础上配ip从而实现某些路由器的功能。
链路聚合
1.链路聚合概述
链路聚合(Link Aggregation)是将组物理接口捆绑在一起作为一个逻辑接口来增加带宽的一种方法,又称为多接口负载均衡组(Load SharingGroup)或链路聚合组(Link Aggregation Group)。
通过在两台设备之间建立链路聚合组,可以提供更高的通讯带宽和更高的可靠性。链路聚合不仅为设备间通信提供了冗余保护,而且不需要对硬件进行升级。
2.链路聚合的工作模式
链路聚合的工作模式分手工负载分担模式和LACP模式。
手工负载分担(Manual load-balance) 模式下,Eth-Trunk的建立、 成员接口的加入由手工配置,没有ACP (link Aggregation Control Protocol)协议报文的参与。该模式下所有活动链路都参与数据的转发,平均分担流量,因此称为负载分担模式。如果某条活动链路故障,链路聚合组自动在剩余的活动链路中平均分担流量。当需要在两个直连设备间提供一个较大的链路带宽而设备又不支持L ACP协议时,可以使用手工负载分担模式。
静态LACP lStatic L ACP)模式是一种利用LACP协议进行聚合参数协商、确定活动接口和非活动接口的链路聚合方式。该模式下,需手工创建Eth-Trunk), 手工加入Eth-Trunk成员接口,由LACP协议协商确定活动接口和非活动接口。静态L ACP模式也称为M: N模式。这种方式同时可以实现链路负载分担和链路冗余备份的双重功能。在链路聚合组中M条链路处于活动状态,这些链路负责转发数据并进行负载分担,另外N条链路处于非活动状态作为备份链路,不转发数据。当M条链路中有链路出现故障时,系统会从N条备份链路中选择优先级最高的接替出现故障的链路,同时这条替换故障链路的备份链路状态变为活动状态开始转发数据。
静态LACP模式与手工负载分担模式的主要区别为:静态LACP模式有备份链路,而手工负载分担模式所有成员接口均处于转发状态,分担负载流量。
和静态LACP模式相对应的还包括动态L ACP模式。动态LACP模式的链路聚合,从Eth-Trunk的创建到加入成员接口都不需要人工的干预,由LACP协议自动协商完成。虽然这种方式对于用户来说很简单,但由于这种方式过于灵活,不便于管理,所以S9300上不支持动态LACP模式链路聚合。
实验
实验一
首先配好每个pc的ip地址,子网掩码,网关
SW1的配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys sw1
[sw1]
[sw1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]interface e0/0/4
[sw1-Ethernet0/0/4]p l a
[sw1-Ethernet0/0/4]p d v 10
[sw1-Ethernet0/0/4]interface e0/0/5
[sw1-Ethernet0/0/5]p l a
[sw1-Ethernet0/0/5]p d v 20
[sw1-Ethernet0/0/5]dis this
#
interface Ethernet0/0/5
port link-type access
port default vlan 20
#
return
[sw1-Ethernet0/0/5]interface e0/0/4
[sw1-Ethernet0/0/4]dis this
#
interface Ethernet0/0/4
port link-type access
port default vlan 10
#
return
[sw1-Ethernet0/0/4]interface e0/0/6
[sw1-Ethernet0/0/6]p l t
[sw1-Ethernet0/0/6]p t a v 10 20 30 40 50 60
[sw1-Ethernet0/0/6]dis this
#
interface Ethernet0/0/6
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60
#
return
[sw1-Ethernet0/0/6] User interface con0 is available
[sw1-Ethernet0/0/6]interface eth-trunk1
[sw1-Eth-Trunk1]mode lacp-
[sw1-Eth-Trunk1]mode lacp-static
[sw1-Eth-Trunk1]dis this
#
interface Eth-Trunk1
mode lacp-static
#
return
[sw1-Eth-Trunk1]q
[sw1]interface eth-trunk 1
[sw1-Eth-Trunk1]dis this
#
interface Eth-Trunk1
mode lacp-static
#
return
[sw1-Eth-Trunk1]trunkport e 0/0/1 to 0/0/3
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1-Eth-Trunk1]dis this
#
interface Eth-Trunk1
mode lacp-static
#
return
[sw1-Eth-Trunk1]dis eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: 4c1f-cc55-26be
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: down Number Of Up Port In Trunk: 0
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1 Unselect 100M 32768 2 289 10100010 1
Ethernet0/0/2 Unselect 100M 32768 3 289 10100010 1
Ethernet0/0/3 Unselect 100M 32768 4 289 10100010 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
Ethernet0/0/1 0 0000-0000-0000 0 0 0 10100011
Ethernet0/0/2 0 0000-0000-0000 0 0 0 10100011
Ethernet0/0/3 0 0000-0000-0000 0 0 0 10100011
[sw1-Eth-Trunk1]
[sw1-Eth-Trunk1]p l t
[sw1-Eth-Trunk1]dis this
#
interface Eth-Trunk1
port link-type trunk
mode lacp-static
#
return
[sw1-Eth-Trunk1]p t a v 10 20 30 40 50 60
[sw1-Eth-Trunk1]dis this
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60
mode lacp-static
#
return
[sw1-Eth-Trunk1]dis this
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60
mode lacp-static
#
return
[sw1-Eth-Trunk1]dis eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: 4c1f-cc55-26be
Least Active-linknumber: 1 Max Active-linknumber: 8
Operate status: down Number Of Up Port In Trunk: 0
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1 Unselect 100M 32768 2 289 10100010 1
Ethernet0/0/2 Unselect 100M 32768 3 289 10100010 1
Ethernet0/0/3 Unselect 100M 32768 4 289 10100010 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
Ethernet0/0/1 0 0000-0000-0000 0 0 0 10100011
Ethernet0/0/2 0 0000-0000-0000 0 0 0 10100011
Ethernet0/0/3 0 0000-0000-0000 0 0 0 10100011
[sw1-Eth-Trunk1]max active-linknumber 2
[sw1-Eth-Trunk1]dis eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1 WorkingMode: STATIC
Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP
System Priority: 32768 System ID: 4c1f-cc55-26be
Least Active-linknumber: 1 Max Active-linknumber: 2
Operate status: down Number Of Up Port In Trunk: 0
--------------------------------------------------------------------------------
ActorPortName Status PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1 Unselect 100M 32768 2 289 10100010 1
Ethernet0/0/2 Unselect 100M 32768 3 289 10100010 1
Ethernet0/0/3 Unselect 100M 32768 4 289 10100010 1
Partner:
--------------------------------------------------------------------------------
ActorPortName SysPri SystemID PortPri PortNo PortKey PortState
Ethernet0/0/1 0 0000-0000-0000 0 0 0 10100011
Ethernet0/0/2 0 0000-0000-0000 0 0 0 10100011
Ethernet0/0/3 0 0000-0000-0000 0 0 0 10100011
SW2的配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys sw2
[sw2]
[sw2]vlan batch 30 40
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw2]inter e0/0/1
[sw2-Ethernet0/0/1]p l a
[sw2-Ethernet0/0/1]p d v 30
[sw2-Ethernet0/0/1]dis this
#
interface Ethernet0/0/1
port link-type access
port default vlan 30
#
return
[sw2-Ethernet0/0/1]inter e0/0/2
[sw2-Ethernet0/0/2]p l a
[sw2-Ethernet0/0/2]p d v 40
[sw2-Ethernet0/0/2]dis this
#
interface Ethernet0/0/2
port link-type access
port default vlan 40
#
return
[sw2-Ethernet0/0/2]inter e0/0/9
[sw2-Ethernet0/0/9]p l t
[sw2-Ethernet0/0/9]p t a v 10 20 30 40 50 60
[sw2-Ethernet0/0/9]dis this
#
interface Ethernet0/0/9
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60
#
[sw2]interface eth-trunk 1
[sw2-Eth-Trunk1]trunkport e 0/0/3 to 0/0/5
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw2-Eth-Trunk1]dis eth-trunk 1
Eth-Trunk1's state information is:
WorkingMode: NORMAL Hash arithmetic: According to SIP-XOR-DIP
Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 3
--------------------------------------------------------------------------------
PortName Status Weight
Ethernet0/0/3 Up 1
Ethernet0/0/4 Up 1
Ethernet0/0/5 Up 1
[sw2-Eth-Trunk1]p l t
[sw2-Eth-Trunk1]p t a v 10 20 30 40 50 60
[sw2-Eth-Trunk1]dis this
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60
#
return
[sw2-Eth-Trunk1]interface eth-trunk 2
[sw2-Eth-Trunk2]trunkport e 0/0/6 to 0/0/8
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw2-Eth-Trunk2]p l t
[sw2-Eth-Trunk2]p t a v 10 20 30 40 50 60
[sw2-Eth-Trunk2]dis this
#
interface Eth-Trunk2
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60
#
SW3的配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys sw3
[sw3]vlan batch 50 60
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw3]interface e0/0/4
[sw3-Ethernet0/0/4]p l a
[sw3-Ethernet0/0/4]p d v 50
[sw3-Ethernet0/0/4]interface e0/0/5
[sw3-Ethernet0/0/5]p l a
[sw3-Ethernet0/0/5]p d v 60
[sw3-Ethernet0/0/5]dis this
#
interface Ethernet0/0/5
port link-type access
port default vlan 60
#
return
[sw3-Ethernet0/0/5]interface e0/0/6
[sw3-Ethernet0/0/6]p l t
[sw3-Ethernet0/0/6]p t a v 10 20 30 40 50 60
[sw3-Ethernet0/0/6]dis this
#
interface Ethernet0/0/6
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60
#
return
[sw3-Ethernet0/0/6]interface eth-trunk 2
[sw3-Eth-Trunk2]trunkport e 0/0/1 to 0/0/3
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw3-Eth-Trunk2]dis this
#
interface Eth-Trunk2
#
return
[sw3-Eth-Trunk2]p l t
[sw3-Eth-Trunk2]p t a v 10 20 30 40 50 60
由于路由器和三层交换机配置的时候比较乱就不放出来了。路由器和第三层交换机方面只需要配置一下各个端口的ip地址,配一下去pc1~6和pc7的静态路由。R1和R3在从R4走的静态路由的命令后面加上preference “数字”(数字大于静态路由默认的60)。之后就可以了