Problems with lagg interface

  • 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))
                    //$realif = get_real_interface($member);
                    $realif = $member;
                    /* make sure the parent interface is up */
                    mwexec("/sbin/ifconfig {$realif} mtu {$smallermtu}");
                            log_error("could not bring realif up – foreach(memebers)");
                    mwexec("/sbin/ifconfig {$laggif} laggport {$realif}");

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


    return $laggif;

  • Still one typo after the commit in etc/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

  • Fixed thanks.

Log in to reply