zoukankan      html  css  js  c++  java
  • pf负载均衡

    ip2="192.168.0.2"
    ip3="192.168.0.3"
    int_if  = "dc0"
    ext_if1 = "fxp0"
    ext_if2 = "fxp1"
    ext_gw1 = "222.88.33.11"
    ext_gw2 = "219.150.10.9"


    #  nat outgoing connections on each internet interface
    nat on $ext_if1 from $ip2 to any -> ($ext_if1)
    nat on $ext_if2 from $ip3 to any -> ($ext_if2)

    #  default deny
    block in  from any to any
    block out from any to any

    #  pass all outgoing packets on internal interface
    pass out on $int_if from any to any
    #  pass in quick any packets destined for the gateway itself
    pass in quick on $int_if from any to $int_if

    pass in on $int_if route-to \
        ($ext_if1 $ext_gw1) \
         from $ip2 to any keep state

    pass in on $int_if route-to \
         ($ext_if2 $ext_gw2)  \
        from $ip3 to any keep state

    #  general "pass out" rules for external interfaces
    pass out on $ext_if1 proto tcp from any to any flags S/SA modulate state
    pass out on $ext_if1 proto { udp, icmp } from any to any keep state
    pass out on $ext_if2 proto tcp from any to any flags S/SA modulate state
    pass out on $ext_if2 proto { udp, icmp } from any to any keep state

    #  route packets from any IPs on $ext_if1 to $ext_gw1 and the same for
    #  $ext_if2 and $ext_gw2
    pass out on $ext_if1 route-to ($ext_if2 $ext_gw2) from $ext_if2 to any
    pass out on $ext_if2 route-to ($ext_if1 $ext_gw1) from $ext_if1 to any

  • 相关阅读:
    spring aop简单理解
    动态代理
    静态代理
    spring的i o c简单回顾
    java注解的概念理解
    Eclipse中配置Tomcat
    java中Optional和Stream流的部分操作
    java中的stream的Map收集器操作
    java中的二进制运算简单理解
    Class.forName和ClassLoader.loadClass区别(转)
  • 原文地址:https://www.cnblogs.com/studio313/p/1632270.html
Copyright © 2011-2022 走看看