公司租用两条链路一条电信,一条联通都是200M,配置了出链接负载均衡,匹配规则为运营商ISP。能给实现根据ISP选路进行负载均衡,IP地址匹配不上的,走电信线路。
由于前2天防火墙恢复了出厂设置,重新配置了负载均衡,现在问题是链路不负载了,匹配不到的IP也不走默认的电信链路了
请帮忙看看是哪里问题,谢谢!
链路信息
(0)
最佳答案
那肯定就是配置的问题了,参考下案例:
某公司为达到业务流量快速转发和链路冗余需求申请了三条不同运营商的外网线路,需要实现如下需求:
1)要求内网用户访问目的地址为移动链路数据从移动链路转发、访问目的地址为联通链路数据从联通链路转发、访问目的地址为电信链路数据从电信链路转发需求。
2)财务部门因为经常访问网银等支付平台,目前不希望出口IP地址经常变化。指定财务数据从电信转发并希望当电信流量负载到带宽的90%后,后面流量负载到联通链路上。
说明:
ISP | 外网接口 | 公网地址/掩码 | 公网网关 |
移动 | 1/0/3 | 218.200.5.8/24 | 218.200.5.9 |
联通 | 1/0/2 | 14.204.0.2/24 | 14.204.0.1 |
电信 | 1/0/1 | 202.90.112.2/24 | 202.90.112.1 |
探测组名称为nqa,描述为test。用于检测链路健康性。
[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
在内网找一台地址为192.168.0.2的电脑,访问外网一个地址看是从哪个接口出?用来
判断ISP路由是否配置正确?将外网模拟设备的IP地址修改为1.4.1.1进行测试。
设备内置的电信路由表:
Teacert结果:
防火墙会话:
查看数据是否从对应链路组转发。
在内网找一台地址为192.168.0.2的电脑,访问外网一个地址看是从哪个接口出?用来
判断ISP路由是否配置正确?将外网模拟设备的IP地址修改为27.50.128.1进行测试。
设备内置的联通路由表:
Teacert结果:
防火墙会话:
在内网找一台地址为192.168.0.2的电脑,访问外网一个地址看是从哪个接口出?用来
判断ISP路由是否配置正确?将外网模拟设备的IP地址修改为43.251.244.1进行测试。
设备内置的移动路由表:
Teacert结果:
防火墙会话:
测试结果符合需求预期,可以达到数据的准确转发。
(0)
暂无评论
核对下配置
说明:
ISP | 外网接口 | 公网地址/掩码 | 公网网关 |
移动 | 1/0/3 | 218.200.5.8/24 | 218.200.5.9 |
联通 | 1/0/2 | 14.204.0.2/24 | 14.204.0.1 |
电信 | 1/0/1 | 202.90.112.2/24 | 202.90.112.1 |
探测组名称为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)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论