17
2020
04
16:39:27

华为交换机端口隔离及以太网链路配置



推荐点击下面图片,通过本站淘宝优惠价购买:

image.png

session 1 华为交换机端口隔离


        端口隔离可以实现在同一台交换机上对端口进行逻辑隔离,可以在同一个vlan内实现隔离。端口隔离分为L2层隔离和L3层隔离,其中在L2层的端口隔离中还可以有端口单向隔离技术用于某些特殊场景。


一、双向端口隔离配置




将pc1与pc2的端口加入同一个隔离组就实现了端口的隔离,默认是L2层隔离(无网关SVI接口),L3层隔离需要修改端口隔离模式,在全局模式使用命令:


[Huawei]port-isolate mode ?

  all  All

  l2   L2 only


上面命令修改端口隔离模式,L2或者all(L2+L3全部隔离)


如果只需要实现L2层隔离,配置如下:


interface GigabitEthernet0/0/1             

 port-isolate enable group 1

#

interface GigabitEthernet0/0/2

 port-isolate enable group 1

#


在SVI接口下必须使用三层隔离才能将端口隔离开,就需要使用[Huawei]port-isolate mode all  来修改端口隔离模式为L2+L3层




二、单向端口隔离配置(仅支持L2层隔离,L3层隔离是双向隔离)


[Huawei]port-isolate mode L2


interface GigabitEthernet0/0/1             

 am isolate g0/0/2                                  阻止g0/0/1向g0/0/2发送数据,但允许g0/0/2发来的报文,只收不发。

#




session 2 华为交换机以太网链路聚合


以太网捆绑技术,用于将多个端口在逻辑上捆绑成一个tunnel端口,以增加带宽使用的技术,分别有静态和LACP动态两种协议。


一、手工负载分担模式链路聚合配置




静态配置如下,lsw1与lsw2配置相同,但是负载分担方式可以不一样,因为负载分担方式只在本地设备有效。


[Huawei]interface Eth-Trunk 1                                                                 创建eth-tunnel端口


[Huawei-Eth-Trunk1]mode manual load-balance                                     配置模式为手工负载分担模式


[Huawei-Eth-Trunk1]load-balance src-dst-mac                                        负载分担选用源-目的-mac地址模式


[Huawei-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/3                 将g0/0/1-3加入聚合端口


[Huawei-Eth-Trunk1]port link-type trunk                                                      


[Huawei-Eth-Trunk1]port trunk allow-pass vlan all


[Huawei-Eth-Trunk1]quit


手工聚合链路的负载分担方式有:


[Huawei-Eth-Trunk1]load-balance ?

  dst-ip       According to destination IP hash arithmetic                             根据不同目的ip负载

  dst-mac      According to destination MAC hash arithmetic                     根据不同目的mac负载

  src-dst-ip   According to source/destination IP hash arithmetic              根据不同源-目的ip进行负载

  src-dst-mac  According to source/destination MAC hash arithmetic      根据不同源-目的mac进行负载

  src-ip       According to source IP hash arithmetic                                     根据不同源ip进行负载

  src-mac      According to source MAC hash arithmetic                             根据不同源mac进行负载


可以根据不同应用场景进行选择




二、LACP模式的链路聚合配置




在LSW1上的配置:


lacp priority 100                                   让LSW1成为LACP的主动端(LSW2上不用配置,默认32768)


interface Eth-Trunk1                                 首先创建一个聚合端口1

 mode lacp-static                                     模式为lacp

 lacp preempt enable                               启用抢占功能,当聚合链路中存在活动端口链路和冗余备份端口链路时,如果当前活动端口链路down了,那么备用端口链路就会up,然后当活动端口链路重新up后会抢占回up链路,备用端口链路由会从up变为down,在这里活动端口链路时g0/0/1和g0/0/2,g0/0/3作为备用端口链路down


 max active-linknumber 2      最大允许2个活动端口,所以lacp优先级最小的第三个端口的g0/0/3就被down掉做为备用端口链路了

 lacp preempt delay 60                            抢占延迟60s进行,活动链路恢复后60s后再抢占回传输链路

#


interface GigabitEthernet0/0/1

 eth-trunk 1                                    将g0/0/1-3加入聚合端口中

 lacp priority 100                            配置g0/0/1端口的lacp优先级为100,使端口成为活动端口,默认为32768

#

interface GigabitEthernet0/0/2

 eth-trunk 1

 lacp priority 100                             配置g0/0/1端口的lacp优先级为100,使端口成为活动端口,默认为32768

#

interface GigabitEthernet0/0/3

 eth-trunk 1                                     配置lacp优先级为默认的32768,端口成为备用端口

#


在LSW2上的配置:


interface Eth-Trunk1

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

 mode lacp-static

 lacp preempt enable

 max active-linknumber 2

 lacp preempt delay 60

#

interface GigabitEthernet0/0/1

 eth-trunk 1

 lacp priority 100

#

interface GigabitEthernet0/0/2

 eth-trunk 1

 lacp priority 100

#

interface GigabitEthernet0/0/3

 eth-trunk 1

#


查看聚合链路的状态,在LSW1上查看:


[LSW1]display eth-trunk 1

Eth-Trunk1's state information is:

Local:

LAG ID: 1                   WorkingMode: STATIC                               

Preempt Delay Time: 60      Hash arithmetic: According to SIP-XOR-DIP         

System Priority: 100        System ID: 4c1f-cc31-3f7c                         

Least Active-linknumber: 1  Max Active-linknumber: 2                          

Operate status: up          Number Of Up Port In Trunk: 2                     

--------------------------------------------------------------------------------

ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight

GigabitEthernet0/0/1   Selected 1GE      100     2      305     10111100  1     

GigabitEthernet0/0/2   Selected 1GE      100     3      305     10111100  1     

GigabitEthernet0/0/3   Unselect 1GE      32768   4      305     10100000  1     

Partner:

--------------------------------------------------------------------------------

ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState

GigabitEthernet0/0/1   32768    4c1f-cc1c-6d52  100     2      305     10111100

GigabitEthernet0/0/2   32768    4c1f-cc1c-6d52  100     3      305     10111100

GigabitEthernet0/0/3   32768    4c1f-cc1c-6d52  32768   4      305     10100000

[LSW1]


在LSW2上查看lacp状态:


[LSW2]display eth-trunk 1

Eth-Trunk1's state information is:

Local:

LAG ID: 1                   WorkingMode: STATIC                               

Preempt Delay Time: 60      Hash arithmetic: According to SIP-XOR-DIP         

System Priority: 32768      System ID: 4c1f-cc1c-6d52                         

Least Active-linknumber: 1  Max Active-linknumber: 2                         

Operate status: up          Number Of Up Port In Trunk: 2                     

--------------------------------------------------------------------------------

ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight

GigabitEthernet0/0/1   Selected 1GE      100     2      305     10111100  1     

GigabitEthernet0/0/2   Selected 1GE      100     3      305     10111100  1     

GigabitEthernet0/0/3   Unselect 1GE      32768   4      305     10100000  1     

Partner:

--------------------------------------------------------------------------------

ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState

GigabitEthernet0/0/1   100      4c1f-cc31-3f7c  100     2      305     10111100

GigabitEthernet0/0/2   100      4c1f-cc31-3f7c  100     3      305     10111100

GigabitEthernet0/0/3   100      4c1f-cc31-3f7c  32768   4      305     10100000

[LSW2]


本文链接:https://www.hqyman.cn/post/1214.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下,本站随机推荐观看栏目:


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: