zoukankan      html  css  js  c++  java
  • ipvsadm DR模型的实现方式

      

    DR模型的lvs

    ————
    在实现DR模型的时候所有RS都要屏蔽掉ARP请求的响应

    实现方法:
    1.可以用路由器绑定静态VIP:MAC(DVIP)
    2.可以使用arptables
    3.可以使用 kernel parmeter(内核参数)
    { arp_ignore:接受到arp请求时的响应级别
    级别 0:只要本机接口配置了相应地址就响应;
    1:仅在目标IP是本地地址并且是配置在这个请求进来的对应接口才响应;

    arp_announce:将自己的地址向外通告时的通告级别
    级别 0:将本机任何接口的任何地址向外通告;
    1:试图仅向目标网络通告与其网络匹配的地址;
    2:仅将与本地接口匹配的网络通告 }
    linux中响应报文的源地址一定要是报文流出接口的地址
    arp_ignore和arp_announce在/proc/sys/net/ipv4/conf

    ————
    RS上:
    {sysctl -w net.conf.eth0.arp_announce=2
    sysctl -w net.conf.all.arp_announce=2

    sysctl -w net.conf.eth0.arp_ignore=1
    sysctl -w net.conf.all.arp_ignore=1}

    RS: ifconfig lo:0 xx.xx.xx.xx broadcast xx.xx.xx.xx netmask 255.255.255.255 up
    DS: ifconfig eth0:0 xx.xx.xx.xx broadcast xx.xx.xx.xx netmask 255.255.255.255 up

    RS: route add -host xx.xx.xx.xx dev lo:0
    DS: route add -host xx.xx.xx.xx dev eth0:0

    ————
    例:

    制定ipvsadm规则
    制定规则前先 -C 清空之前规则
    ipvsadm -A -t xx.xx.xx.xx:80 -s wrr
    RS1 :ipvsadm -a -t xx.xx.xx.xx:80 -r xx.xx.xx.xx -g -w 2
    RS2 :ipvsadm -a -t xx.xx.xx.xx:80 -r xx.xx.xx.xx -g -w 1

  • 相关阅读:
    Security headers quick reference Learn more about headers that can keep your site safe and quickly look up the most important details.
    Missing dollar riddle
    Where Did the Other Dollar Go, Jeff?
    proteus 与 keil 联调
    cisco router nat
    router dhcp and dns listen
    配置802.1x在交换机的端口验证设置
    ASAv931安装&初始化及ASDM管理
    S5700与Cisco ACS做802.1x认证
    playwright
  • 原文地址:https://www.cnblogs.com/zhangzhongming/p/6690240.html
Copyright © 2011-2022 走看看