Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-1453

$ipaddress on openvz container returning 127.0.0.2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Template:
    • Team:
      Platform OS

      Description

      The $ipaddress global is getting set to 127.0.0.2 for my client node, which is not the correct ip address of the machine.

      facter on my client returns:

        interfaces => {
          lo => {
            bindings => [
              {
                address => "127.0.0.1",
                netmask => "255.0.0.0",
                network => "127.0.0.0"
              }
            ],
            bindings6 => [
              {
                address => "::1",
                netmask => "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
                network => "::1"
              }
            ],
            ip => "127.0.0.1",
            ip6 => "::1",
            mtu => 65536,
            netmask => "255.0.0.0",
            netmask6 => "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
            network => "127.0.0.0",
            network6 => "::1"
          },
          venet0 => {
            bindings => [
              {
                address => "127.0.0.2",
                netmask => "255.255.255.255",
                network => "127.0.0.2"
              }
            ],
            ip => "127.0.0.2",
            netmask => "255.255.255.255",
            network => "127.0.0.2"
          },
          venet0:0 => {
            bindings => [
              {
                address =>  <real_ip>,,
                netmask => "255.255.255.255",
                network =>  <real_ip>,
              }
            ],
            ip => <real_ip>,
            netmask => "255.255.255.255",
            network =>  <real_ip>,
          }
      
      

      This looks like a recurrence of an older problem FACT-1316, FACT-1147 and related issues.

      The client is a openvz container.

      I am running facter v3.2.0. After upgrading to facter 3.6.1 commit fb690a9ffd135c9be79f1ee283471b414550cb1b this issue is still happening.

      As a workaround I am using a custom fact containing the hostname --ip value.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            candrews Chris Andrews
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support