策略路由在服务器负载均衡中的应用案例

H3C9个月前更新 zhangyin
1,770 0

某客户现场网架构(部分)如下:

        核心交换机向上还有防火墙、IPS和路由器等设备,因策略路由配置在核心上操作,因此核心以上设备不再列出具体配置和说明。

        局部网络结构如下,两台核心做IRF,两台服务器接入交换机也做IRF,以及旁挂到核心的两台负载均衡设备LB也做IRF,做完IRF后设备之间配置链路聚合,提高冗余性。

       起初在LB上配置的SNAT方式做负载均衡,(即源地址转换,保证来回路径统一),但是这样存在一个问题,在服务器上看到的源地址为LB的VSIP(即虚服务器的IP。关于VSIP的讲解以后再说,不是本次案例的关键)因客户要求,在服务器上要看到访问终端的实际IP 和MAC地址,来监控实时的终端访问,为了解决这个问题,提出了采用策略路由的方式实现。

策略路由在服务器负载均衡中的应用案例

关键配置:(IRF配置在之前分享过,不明白的可以查阅之前的IRF配置案例,相关LB的负载配置后期在做分享)

核心配置

#

interface Vlan-interface10    //服务器网关

 description AnQuanJieRu_Server

 ip address 20.76.189.62 255.255.255.192 

#

vlan 1680      

 description hulian–LB

#

interface Vlan-interface1680   //和LB互联地址

 description Hulina–LB

 ip address 20.76.188.41 255.255.255.252

#

interface Bridge-Aggregation53  //和LB的聚合接口

 description TO_LB

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 10 30 1020 1680 //放行相关的vlan

#

物理接口配置(其他类似):

interface GigabitEthernet1/0/2

 port link-mode bridge

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 10 30 1020 1680

 combo enable fiber

 port link-aggregation group 53

#

interface GigabitEthernet2/0/2

 port link-mode bridge

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 10  30 1020 1680

 combo enable fiber

 port link-aggregation group 53

#

负载均衡LB的基础配置:

vlan 30

#

vlan 1680

#

interface Bridge-Aggregation53

 description TO_LB

 port link-type trunk

 undo port trunk permit vlan 1

 port trunk permit vlan 30 1680

#

interface Vlan-interface30   //虚服务器的IP地址,即终端访问服务器的实际地址

 description VSIP

 ip address 20.76.189.200 255.255.255.128

#

interface Vlan-interface1680

 ip address 20.76.188.42 255.255.255.252  //互联核心的地址

#

 ip route-static 0.0.0.0 0 20.76.188.41  //缺省路由到核心

#

核心策略路由配置:

创建策略路由:

#

policy-based-route 1 permit node 0

 if-match acl 3999  //匹配业务ACL

 apply next-hop 20.76.188.42  //设置匹配到ACL后下一跳为LB的互联地址

#

acl advanced 3999  //创建ACL

 description PBR     //描述信息

 rule 1 permit ip source 20.76.189.0 0.0.0.63 destination 172.45.0.0 0.0.255.255  //抓取源地址服务器地址段 和目的地址终端地址段

 rule 2 permit ip source 20.76.189.0 0.0.0.63 destination 172.46.0.0 0.0.255.255

 rule 3 permit ip source 20.76.189.0 0.0.0.63 destination 172.47.0.0 0.0.255.255

 rule 4 permit ip source 20.76.189.0 0.0.0.63 destination 12.1.1.0 0.0.0.255

#

interface Vlan-interface10    //服务器网关

 description AnQuanJieRu_Server

 ip address 20.76.189.62 255.255.255.192 

 ip policy-based-route 1   //将策略路由应用到服务器网关接口下

#

至此,策略路由在服务器负载均衡中的关键配置到此结束,欢迎留言哦!

————————————————————

对啦,由于前两天有点忙,未能及时更新,还请谅解!!!

____________________________________________


© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...