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

facter 3.12.2 choses wrong ip as main ip

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:
    • Team:
      Platform OS
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      Hi people,
      I did some debugging with Eric Sorenson on slack about this. I have a server with multiple ip addresses on a single interface. One address is considered the main address. This one is persistant and always present. the others are floating ips.they might be added/removed during runtime. The setup at the moment:

      # facter -p networking.interfaces.enp5s0.ip
      10.254.4.100
       # facter -p networking.ip
      10.254.4.100
       # facter --version
      3.12.2
       # ip -4 a s dev enp5s0
      2: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
          inet 10.254.4.100/32 scope global enp5s0
             valid_lft forever preferred_lft forever
          inet 10.254.4.103/32 scope global enp5s0
             valid_lft forever preferred_lft forever
          inet 10.254.4.17 peer 10.254.4.1/32 scope global enp5s0
             valid_lft forever preferred_lft forever
       # ip -4 r s
      default via 10.254.4.1 dev enp5s0 proto static 
      10.254.4.1 dev enp5s0 proto kernel scope link src 10.254.4.17 
       # 
      

      The system run Archlinux, the addresses are configured via systemd-networkd. I consider 10.254.4.17 as the main ip address. This is the only static ip address and used as source in the routing table. In my opinion this should be the identifier for the primary address.

      A long long time ago, I can still remember... this system was configured with puppet4+facter2. The fact ipaddress was written into multiple templates, this was 10.254.4.17. That's why I know for sure, that something changed and facter now detects a different ip as main ip. The box was also rebooted in the past. One thought was that facter simply uses the first configured ip on the interface as main ip. I don't know if the ordering was different in the past. Eric assumed that maybe facter expects a source address at the default route. I tried that:

      # ip -4 route replace default via 10.254.4.1 dev enp5s0 src 10.254.4.17
      # ip -4 r s
      default via 10.254.4.1 dev enp5s0 src 10.254.4.17 
      10.254.4.1 dev enp5s0 proto kernel scope link src 10.254.4.17
      # facter -p networking.ip
      10.254.4.100
      

      facter -p networking:

      {
        "networking": {
          "domain": "REMOVED",
          "fqdn": "REMOVED",
          "hostname": "REMOVED",
          "interfaces": {
            "enp5s0": {
              "bindings": [
                {
                  "address": "10.254.4.100",
                  "netmask": "255.255.255.255",
                  "network": "10.254.4.100"
                },
                {
                  "address": "10.254.4.103",
                  "netmask": "255.255.255.255",
                  "network": "10.254.4.103"
                },
                {
                  "address": "10.254.4.17",
                  "netmask": "255.255.255.255",
                  "network": "10.254.4.17"
                }
              ],
              "bindings6": [
                {
                  "address": "REMOVED",
                  "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
                  "network": "REMOVED"
                },
                {
                  "address": "fe80::ae16:2dff:fea4:fde",
                  "netmask": "ffff:ffff:ffff:ffff::",
                  "network": "fe80::"
                }
              ],
              "ip": "10.254.4.100",
              "ip6": "REMOVED",
              "mac": "ac:16:2d:a4:0f:de",
              "mtu": 1500,
              "netmask": "255.255.255.255",
              "netmask6": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
              "network": "10.254.4.100",
              "network6": "REMOVED"
            },
            "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"
            }
          },
          "ip": "10.254.4.100",
          "ip6": "REMOVED",
          "mac": "ac:16:2d:a4:0f:de",
          "mtu": 1500,
          "netmask": "255.255.255.255",
          "netmask6": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
          "network": "10.254.4.100",
          "network6": "REMOVED",
          "primary": "enp5s0"
        }
      }
      

      I'm not sure if https://tickets.puppetlabs.com/browse/FACT-1282 is related. Please let me know if you need more debugging information.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            bastelfreak Tim Meusel
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support