最佳答案
探测组名称为nqa,描述为test。用于检测链路健康性。
<H3C>system
[H3C]nqa template icmp nqa
[H3C-nqatplt-icmp-nqa]description test
[H3C-nqatplt-icmp-nqa]reaction trigger per-probe
[H3C-nqatplt-icmp-nqa]quit
配置电信链路接口地址,并开启保存上一跳功能。
[H3C]interface GigabitEthernet1/0/1
[H3C-GigabitEthernet1/0/1]ip address 202.90.112.2 255.255.255.0
[H3C-GigabitEthernet1/0/1]ip last-hop hold
[H3C-GigabitEthernet1/0/1]nat outbound
[H3C-GigabitEthernet1/0/1]quit
配置联通链路接口地址,并开启保存上一跳功能。
[H3C]interface GigabitEthernet1/0/2
[H3C-GigabitEthernet1/0/2]ip address 14.204.0.2 255.255.255.0
[H3C-GigabitEthernet1/0/2]ip last-hop hold
[H3C-GigabitEthernet1/0/2]nat outbound
[H3C-GigabitEthernet1/0/2]quit
配置移动链路接口地址,并开启保存上一跳功能。
[H3C]interface GigabitEthernet1/0/3
[H3C-GigabitEthernet1/0/3]ip address 218.200.5.8 255.255.255.0
[H3C-GigabitEthernet1/0/3]ip last-hop hold
[H3C-GigabitEthernet1/0/3]nat outbound
[H3C-GigabitEthernet1/0/3]quit
将外网接口加入不信任区域
[H3C]security-zone name Untrust
[H3C-security-zone-Untrust]import interface Dialer1
[H3C-security-zone-Untrust]import interface GigabitEthernet1/0/1
[H3C-security-zone-Untrust]import interface GigabitEthernet1/0/2
[H3C-security-zone-Untrust]import interface GigabitEthernet1/0/3
[H3C-security-zone-Untrust]quit
创建对象策略pass,因为本章内容主要介绍负载均衡,域间策略采用最简配置请见谅。
[H3C]object-policy ip pass
[H3C-object-policy-ip-pass] rule 0 pass
[H3C-object-policy-ip-pass]quit
创建any到any域的域间策略调用pass策略。
[H3C]zone-pair security source any destination any
[H3C-zone-pair-security- Any-Any]object-policy apply ip pass
[H3C-zone-pair-security- Any-Any]quit
设置路由防止在负载均衡配置前或者负载均衡失效后网络不通问题
[H3C]ip route-static 0.0.0.0 0 218.200.5.9 preference 80
[H3C]ip route-static 0.0.0.0 0 14.204.0.1 preference 70
[H3C]ip route-static 0.0.0.0 0 202.90.112.1
设置链路失败的reschedule:重定向连接,即把连接重定向到链路组中其它可用的链路上。并使用transparent enable关闭链路组本身的NAT功能并绑定nqa探测组。
[H3C]loadbalance link-group cmcc
[H3C-lb-lgroup-cmcc]fail-action reschedule
[H3C-lb-lgroup-cmcc]transparent enable
[H3C-lb-lgroup-cmcc]probe nqa.
[H3C-lb-lgroup-cmcc]quit
[H3C]loadbalance link-group cnc
[H3C-lb-lgroup-cnc]fail-action reschedule
[H3C-lb-lgroup-cnc]transparent enable
[H3C-lb-lgroup-cnc]probe nqa.
[H3C-lb-lgroup-cnc]quit
[H3C]loadbalance link-group china-isp
[H3C-lb-lgroup-china-isp]fail-action reschedule
[H3C-lb-lgroup-china-isp]transparent enable
[H3C-lb-lgroup-china-isp]probe nqa
[H3C-lb-lgroup-china-isp]quit
[H3C]loadbalance link-group caiwu
[H3C-lb-lgroup-caiwu]fail-action reschedule
[H3C-lb-lgroup-caiwu]transparent enable
[H3C-lb-lgroup-caiwu]probe nqa
[H3C-lb-lgroup-caiwu]quit
router ip指链路的网关地址,将链路绑定链路组后该链路才能生效。
[H3C]loadbalance link cmcc-link
[H3C-lb-link-cmcc-link]router ip 218.200.5.9
[H3C-lb-link-cmcc-link]link-group cmcc
[H3C-lb-link-cmcc-link]probe nqa
[H3C-lb-link-cmcc-link]quit
[H3C]loadbalance link cnc-link
[H3C-lb-link-cnc-link]router ip 14.204.0.1
[H3C-lb-link-cnc-link]link-group cnc
[H3C-lb-link-cnc-link]probe nqa
[H3C-lb-link-cnc-link]quit
将电信链路带宽调整为100M,设置带宽繁忙比当带宽利用率超过90%*100M=90M,新建session会负载到其他链路。
[H3C]loadbalance link chinanet-link
[H3C-lb-link-cnc-chinanet-link]router ip 202.90.112.1
[H3C-lb-link-cnc-chinanet-link]link-group china-isp
[H3C-lb-link-cnc-chinanet-link]probe nqa
[H3C-lb-link-cnc-chinanet-link]max-bandwidth outbound 102400
[H3C-lb-link-cnc-chinanet-link]bandwidth outbound busy-rate 90
[H3C-lb-link-cnc-chinanet-link]quit
[H3C]loadbalance link link-caiwu
[H3C-lb-link- link-caiwu] router ip 202.90.112.1
[H3C-lb-link- link-caiwu] link-group caiwu
[H3C-lb-link- link-caiwu]quit
[H3C]loadbalance class cmcc type link-generic match-any
[H3C-lbc-link-generic-cmcc]match 1 isp cmcc
[H3C-lbc-link-generic-cmcc]quit
[H3C]loadbalance class cnc type link-generic match-any
[H3C-lbc-link-generic-cnc]match 1 isp cnc
[H3C-lbc-link-generic-cnc]quit
[H3C]loadbalance class chinanet type link-generic match-any
[H3C-lbc-link-generic-chinanet]match 1 isp chinatel
[H3C-lbc-link-generic-chinanet]quit
[H3C] loadbalance class caiwu type link-generic match-any
[H3C-lbc-link-generic-caiwu]match 1 source ip address 172.16.0.0 24
[H3C-lbc-link-generic-caiwu]quit
配置负载行为绑定各链路组,设置转发失败规则为继续匹配。
[H3C]loadbalance action cmcc type link-generic
[H3C-lbc-link-generic- cmcc]link-group cmcc
[H3C-lbc-link-generic- cmcc]fallback-action continue
[H3C-lbc-link-generic- cmcc]quit
[H3C]loadbalance action cnc type link-generic
[H3C-lbc-link-generic-cnc]link-group cnc
[H3C-lbc-link-generic-cnc]fallback-action continue
[H3C-lbc-link-generic-cnc]quit
[H3C]loadbalance action chinanet type link-generic
[H3C-lbc-link-generic-chinanet]link-group china-isp
[H3C-lbc-link-generic-chinanet]fallback-action continue
[H3C-lbc-link-generic-chinanet]quit
[H3C]loadbalance action caiwu type link-generic
[H3C-lbc-link-generic-caiwu]link-group caiwu
[H3C-lbc-link-generic-caiwu]fallback-action continue
[H3C-lbc-link-generic-caiwu]quit
负载均衡策略严格按照配置顺序进行匹配,如果需要财务数据优先匹配需要将优先配置。
[H3C]loadbalance policy 1 type link-generic
[H3C-lbp-link-generic-1]class caiwu action caiwu
[H3C-lbp-link-generic-1]class chinanet action chinanet
[H3C-lbp-link-generic-1]class cmcc action cmcc
[H3C-lbp-link-generic-1]class cnc action cnc
配置LB虚服务,虚服务地址为0.0.0.0/0表示内网访问所有的数据将会匹配虚服务进行转发,lb策略调用之前创建的策略1,如果无法匹配运营商的数据缺省从移动转发。
[H3C]virtual-server outbound type link-ip
[H3C-vs-link-ip-outbound]virtual ip address 0.0.0.0 0
[H3C-vs-link-ip-outbound]lb-policy 1
[H3C-vs-link-ip-outbound]default link-group cmcc
[H3C-vs-link-ip-outbound]service enable
[H3C-vs-link-ip-outbound]quit
[H3C]quit
<H3C>save force
(0)
没有具体命令吗
3 配置步骤 3.1 创建NQA探测组用于链路探测 探测组名称为nqa,描述为test。用于检测链路健康性。 <H3C>system [H3C]nqa template icmp nqa [H3C-nqatplt-icmp-nqa]description test [H3C-nqatplt-icmp-nqa]reaction trigger per-probe [H3C-nqatplt-icmp-nqa]quit 3.2 基本组网配置 3.2.1 外网接口配置 配置电信链路接口地址,并开启保存上一跳功能。 [H3C]interface GigabitEthernet1/0/1 [H3C-GigabitEthernet1/0/1]ip address 202.90.112.2 255.255.255.0 [H3C-GigabitEthernet1/0/1]ip last-hop hold [H3C-GigabitEthernet1/0/1]nat outbound [H3C-GigabitEthernet1/0/1]quit 配置联通链路接口地址,并开启保存上一跳功能。 [H3C]interface GigabitEthernet1/0/2 [H3C-GigabitEthernet1/0/2]ip address 14.204.0.2 255.255.255.0 [H3C-GigabitEthernet1/0/2]ip last-hop hold [H3C-GigabitEthernet1/0/2]nat outbound [H3C-GigabitEthernet1/0/2]quit 配置移动链路接口地址,并开启保存上一跳功能。 [H3C]interface GigabitEthernet1/0/3 [H3C-GigabitEthernet1/0/3]ip address 218.200.5.8 255.255.255.0 [H3C-GigabitEthernet1/0/3]ip last-hop hold [H3C-GigabitEthernet1/0/3]nat outbound [H3C-GigabitEthernet1/0/3]quit 3.2.2 安全域及安全策略配置 将外网接口加入不信任区域 [H3C]security-zone name Untrust [H3C-security-zone-Untrust]import interface Dialer1 [H3C-security-zone-Untrust]import interface GigabitEthernet1/0/1 [H3C-security-zone-Untrust]import interface GigabitEthernet1/0/2 [H3C-security-zone-Untrust]import interface GigabitEthernet1/0/3 [H3C-security-zone-Untrust]quit 创建对象策略pass,因为本章内容主要介绍负载均衡,域间策略采用最简配置请见谅。 [H3C]object-policy ip pass [H3C-object-policy-ip-pass] rule 0 pass [H3C-object-policy-ip-pass]quit 创建any到any域的域间策略调用pass策略。 [H3C]zone-pair security source any destination any [H3C-zone-pair-security- Any-Any]object-policy apply ip pass [H3C-zone-pair-security- Any-Any]quit 3.2.3 路由设置 设置路由防止在负载均衡配置前或者负载均衡失效后网络不通问题 [H3C]ip route-static 0.0.0.0 0 218.200.5.9 preference 80 [H3C]ip route-static 0.0.0.0 0 14.204.0.1 preference 70 [H3C]ip route-static 0.0.0.0 0 202.90.112.1 3.3 配置链路组 设置链路失败的reschedule:重定向连接,即把连接重定向到链路组中其它可用的链路上。并使用transparent enable关闭链路组本身的NAT功能并绑定nqa探测组。 3.3.1 配置移动链路组 [H3C]loadbalance link-group cmcc [H3C-lb-lgroup-cmcc]fail-action reschedule [H3C-lb-lgroup-cmcc]transparent enable [H3C-lb-lgroup-cmcc]probe nqa. [H3C-lb-lgroup-cmcc]quit 3.3.2 配置联通链路组 [H3C]loadbalance link-group cnc [H3C-lb-lgroup-cnc]fail-action reschedule [H3C-lb-lgroup-cnc]transparent enable [H3C-lb-lgroup-cnc]probe nqa. [H3C-lb-lgroup-cnc]quit 3.3.3 配置电信链路组 [H3C]loadbalance link-group china-isp [H3C-lb-lgroup-china-isp]fail-action reschedule [H3C-lb-lgroup-china-isp]transparent enable [H3C-lb-lgroup-china-isp]probe nqa [H3C-lb-lgroup-china-isp]quit 3.3.4 配置财务链路组 [H3C]loadbalance link-group caiwu [H3C-lb-lgroup-caiwu]fail-action reschedule [H3C-lb-lgroup-caiwu]transparent enable [H3C-lb-lgroup-caiwu]probe nqa [H3C-lb-lgroup-caiwu]quit 3.4 配置链路 router ip指链路的网关地址,将链路绑定链路组后该链路才能生效。 3.4.1 配置移动链路 [H3C]loadbalance link cmcc-link [H3C-lb-link-cmcc-link]router ip 218.200.5.9 [H3C-lb-link-cmcc-link]link-group cmcc [H3C-lb-link-cmcc-link]probe nqa [H3C-lb-link-cmcc-link]quit 3.4.2 配置联通链路 [H3C]loadbalance link cnc-link [H3C-lb-link-cnc-link]router ip 14.204.0.1 [H3C-lb-link-cnc-link]link-group cnc [H3C-lb-link-cnc-link]probe nqa [H3C-lb-link-cnc-link]quit 3.4.3 配置电信链路 将电信链路带宽调整为100M,设置带宽繁忙比当带宽利用率超过90%*100M=90M,新建session会负载到其他链路。 [H3C]loadbalance link chinanet-link [H3C-lb-link-cnc-chinanet-link]router ip 202.90.112.1 [H3C-lb-link-cnc-chinanet-link]link-group china-isp [H3C-lb-link-cnc-chinanet-link]probe nqa [H3C-lb-link-cnc-chinanet-link]max-bandwidth outbound 102400 [H3C-lb-link-cnc-chinanet-link]bandwidth outbound busy-rate 90 [H3C-lb-link-cnc-chinanet-link]quit 3.4.4 配置财务链路 [H3C]loadbalance link link-caiwu [H3C-lb-link- link-caiwu] router ip 202.90.112.1 [H3C-lb-link- link-caiwu] link-group caiwu [H3C-lb-link- link-caiwu]quit 3.5 配置负载均衡规则匹配运营商路由表 3.5.1 建立移动负载规则匹配移动数据 [H3C]loadbalance class cmcc type link-generic match-any [H3C-lbc-link-generic-cmcc]match 1 isp cmcc [H3C-lbc-link-generic-cmcc]quit 3.5.2 建立联通负载规则匹配联通数据 [H3C]loadbalance class cnc type link-generic match-any [H3C-lbc-link-generic-cnc]match 1 isp cnc [H3C-lbc-link-generic-cnc]quit 3.5.3 建立电信负载规则匹配电信数据 [H3C]loadbalance class chinanet type link-generic match-any [H3C-lbc-link-generic-chinanet]match 1 isp chinatel [H3C-lbc-link-generic-chinanet]quit 3.5.4 建立财务负载规则匹配172.16.0.0财务网段 [H3C] loadbalance class caiwu type link-generic match-any [H3C-lbc-link-generic-caiwu]match 1 source ip address 172.16.0.0 24 [H3C-lbc-link-generic-caiwu]quit 3.6 配置负载均衡行为匹配各链路组 配置负载行为绑定各链路组,设置转发失败规则为继续匹配。 3.6.1 建立移动负载均衡行为匹配移动链路组 [H3C]loadbalance action cmcc type link-generic [H3C-lbc-link-generic- cmcc]link-group cmcc [H3C-lbc-link-generic- cmcc]fallback-action continue [H3C-lbc-link-generic- cmcc]quit 3.6.2 建立联通均衡行为匹配联通链路组 [H3C]loadbalance action cnc type link-generic [H3C-lbc-link-generic-cnc]link-group cnc [H3C-lbc-link-generic-cnc]fallback-action continue [H3C-lbc-link-generic-cnc]quit 3.6.3 建立电信负载均衡行为匹配电信链路组 [H3C]loadbalance action chinanet type link-generic [H3C-lbc-link-generic-chinanet]link-group china-isp [H3C-lbc-link-generic-chinanet]fallback-action continue [H3C-lbc-link-generic-chinanet]quit 3.6.4 建立财务负载均衡行为匹配财务链路组 [H3C]loadbalance action caiwu type link-generic [H3C-lbc-link-generic-caiwu]link-group caiwu [H3C-lbc-link-generic-caiwu]fallback-action continue [H3C-lbc-link-generic-caiwu]quit 3.7 配置负载均衡策略 负载均衡策略严格按照配置顺序进行匹配,如果需要财务数据优先匹配需要将优先配置。 [H3C]loadbalance policy 1 type link-generic [H3C-lbp-link-generic-1]class caiwu action caiwu [H3C-lbp-link-generic-1]class chinanet action chinanet [H3C-lbp-link-generic-1]class cmcc action cmcc [H3C-lbp-link-generic-1]class cnc action cnc 3.8 配置虚服务策略 配置LB虚服务,虚服务地址为0.0.0.0/0表示内网访问所有的数据将会匹配虚服务进行转发,lb策略调用之前创建的策略1,如果无法匹配运营商的数据缺省从移动转发。 [H3C]virtual-server outbound type link-ip [H3C-vs-link-ip-outbound]virtual ip address 0.0.0.0 0 [H3C-vs-link-ip-outbound]lb-policy 1 [H3C-vs-link-ip-outbound]default link-group cmcc [H3C-vs-link-ip-outbound]service enable [H3C-vs-link-ip-outbound]quit 3.9 保存配置 [H3C]quit <H3C>save force
这个够乱,你不如重新评论一下
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
这个够乱,你不如重新评论一下