How to modify squid proxy to support gateway load balance



  • i think that i will be modify route.inc (/usr/local/pkg/routed/route.inc) in function setup_routed() which to client to use gateway loadbalance ??? (Load balance in pfsense 1.2 cound not suuport squid proxy)

    from picktrat in bangkok thailand



  • function setup_routed() {
    global $config;
    $gw = "";

    if (isset($config['installedpackages']['routed']['config'][0]['enable']) &&
          $config['installedpackages']['routed']['config'][0]['enable'] == "on") {
    /* if user selected individual interfaces */
    $ifdescrs = array ("wan", "lan");
    for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
    if(isset($config['interfaces']['opt' . $j]['enable']))
    $ifdescrs['opt' . $j] = "opt" . $j;
    }

    $ifarr = explode(",", $config['installedpackages']['routed']['config'][0]['iface_array']);
                    if (count($ifarr) != 0) {
    foreach($ifdescrs as $ifdescr => $ifname) {
    if (in_array($ifname, $ifarr)) {
    $gw .= setup_etc_gateways($ifname, 'enable');
    } else {
    $gw .= setup_etc_gateways($ifname, 'disable');
    }
    }
    } else {
    /* setup for all interfaces */
    $gw = setup_etc_gateways();
    }
    $fd = fopen("/etc/gateways", "w"); // to edit file gateways
    fwrite($fd, $gw);
    fclose($fd);
    restart_routed();
    } else {
    stop_routed();
    }
    }



  • is that script worked?


Locked