Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-33516

Client IP shown as 0.0.0.0 when using multiple Reverse Proxies

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0.4
    • Fix Version/s: None
    • Component/s: Reports
    • Labels:
    • Environment:
      Server version: Apache/2.2.14 (Ubuntu)
      Architecture: 64-bit
      Server MPM: Prefork
      Barracuda Loadbalancer and Microsoft Unified Access Gateway 2010 with current updates.
    • Database:
      Microsoft SQL
    • Testing Instructions:
      Hide

      Check System Protocol at System Administration -> Reports -> Live-Logfiles -> Current Logfiles

      Show
      Check System Protocol at System Administration -> Reports -> Live-Logfiles -> Current Logfiles
    • Workaround:
      Hide

      File /lib/moodlelib.php Line 8914

      /lib/moodlelib.php Line 8914

       if (!($variablestoskip & GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR)) {
              if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
                  $addresses=explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);
                  $address = cleanremoteaddr($addresses[0]);
                  return $address ? $address : $default;
              }
          } 

      Show
      File /lib/moodlelib.php Line 8914 /lib/moodlelib.php Line 8914 if (!($variablestoskip & GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR)) { if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $addresses=explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']); $address = cleanremoteaddr($addresses[0]); return $address ? $address : $default; } }
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      We are currently using a barracuda loadbalancer in cascade to the microsoft unified access gateway.
      HTTP_X_FORWARDED_FOR is set to for example: 1.4.7.2, 192.168.1.200
      The first ipaddress is the correct client ip the second one is the uags ip-address.

      This will lead to a wrong protocol entry showing 0.0.0.0 as ip-address.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              thomas.drewermann Thomas Drewermann
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: