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

    Problems with lagg interface

    Scheduled Pinned Locked Moved 2.0-RC Snapshot Feedback and Problems - RETIRED
    4 Posts 3 Posters 2.1k 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.
    • R
      rcasas
      last edited by

      I've found some problems in lagg interface configuration.

      First of all, members are the NIC names, so you shouldn't use get_real_interface. Second, a '$' is missing in the laggif variable when adding a laggport. An at the end, 'laggproto' is missing when assigning a proto to the interface.

      This is my ending function interface_lagg_configure:

      function interface_lagg_configure(&$lagg) {
              global $config, $g;

      if (!is_array($lagg))
                      return -1;

      $members = explode(',', $lagg['members']);
              if (!count($members))
                      return -1;

      $checklist = get_interface_list();

      if ($g['booting'] || !(empty($lagg['laggif']))) {
                      mwexec("/sbin/ifconfig {$lagg['laggif']} destroy");
                      mwexec("/sbin/ifconfig {$lagg['laggif']} create");
                      $laggif = $lagg['laggif'];
              } else
                      $laggif = exec("/sbin/ifconfig lagg create");

      /* Calculate smaller mtu and enforce it */
              $smallermtu = 0;
              foreach ($members as $member) {
                      $realif = get_real_interface($member);
                      $mtu = get_interface_mtu($realif);
                      if ($smallermtu == 0 && !empty($mtu))
                              $smallermtu = $mtu;
                      else if (!empty($mtu) && $mtu < $smallermtu)
                              $smallermtu = $mtu;
              }

      /* Just in case anything is not working well */
              if ($smallermtu == 0)
                      $smallermtu = 1500;

      foreach ($members as $member) {
                      if (!array_key_exists($member, $checklist))
                              continue;
                      //$realif = get_real_interface($member);
                      $realif = $member;
                      /* make sure the parent interface is up */
                      mwexec("/sbin/ifconfig {$realif} mtu {$smallermtu}");
                      if($realif)
                              interfaces_bring_up($realif);
                      else
                              log_error("could not bring realif up – foreach(memebers)");
                      mwexec("/sbin/ifconfig {$laggif} laggport {$realif}");
              }

      mwexec("/sbin/ifconfig {$laggif} laggproto {$lagg['proto']}");

      interfaces_bring_up($laggif);

      return $laggif;
      }

      1 Reply Last reply Reply Quote 0
      • E
        eri--
        last edited by

        Should be fixed now.
        Thanks for the report.

        For reference: https://rcs.pfsense.org/projects/pfsense/repos/mainline/commits/39fbee97c86d4bf9e4fc47d62bac85720402f83f

        1 Reply Last reply Reply Quote 0
        • A
          aliet
          last edited by

          Still one typo after the commit in etc/inc/interfaces.inc:
          At line 548:
          mwexec("/sbin/ifconfig {laggif} laggport {$member}");
          Still one $ missing in laggif, it should be:
          mwexec("/sbin/ifconfig {$laggif} laggport {$member}");

          Best regards

          1 Reply Last reply Reply Quote 0
          • E
            eri--
            last edited by

            Fixed thanks.

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