Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How to modify squid proxy to support gateway load balance

    Scheduled Pinned Locked Moved Routing and Multi WAN
    3 Posts 2 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      picktrat
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • P
        picktrat
        last edited by

        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();
        }
        }

        1 Reply Last reply Reply Quote 0
        • M
          m3tr0mini
          last edited by

          is that script worked?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.