Ifb0 - no such device

Hi, I recently flashed 22.03.5 onto my Asus RT-AC68U (openwrt-22.03.5-bcm53xx-generic-asus_rt-ac68u-squashfs.trx)

Having issue setting up an ifb device, here are the commands I would follow on my previous router

root@OpenWrt:~# modprobe ifb
root@OpenWrt:~# ip link set dev ifb0 up
ip: SIOCGIFFLAGS: No such device

I'm not sure whether I'm missing any packages, I definitely have kmod-ifb installed - is there anything else?

It is a fresh install apart from qosify and a few other packages. I did notice after installing qosify, it created an "ifb-dns" device. Not sure if it has something to do with that?

I think you first need to create your IFB:

 ip link add name ${CUR_IFB} type ifb
1 Like

Thank you :partying_face:

1 Like

Note that in sqm-scripts we have a set of ifb related helper functions:

get_ifb_associated_with_if() {
    local CUR_IF
    local CUR_IFB
    local TMP
    CUR_IF=$1
    # Stray ' in the comment is a fix for broken editor syntax highlighting
    CUR_IFB=$( $TC_BINARY -p filter show parent ffff: dev ${CUR_IF} | grep -o -E ifb'[^)\ ]+' )    # '
    sqm_debug "ifb associated with interface ${CUR_IF}: ${CUR_IFB}"

    # we could not detect an associated IFB for CUR_IF
    if [ -z "${CUR_IFB}" ]; then
        TMP=$( $TC_BINARY -p filter show parent ffff: dev ${CUR_IF} )
        if [ ! -z "${TMP}" ]; then
            # oops, there is output but we failed to properly parse it? Ask for a user report
            sqm_error "#---- CUT HERE ----#"
            sqm_error "get_ifb_associated_with_if failed to extrect the ifb name from:"
            sqm_error $( $TC_BINARY -p filter show parent ffff: dev ${CUR_IF} )
            sqm_error "Please report this as an issue at https://github.com/tohojo/sqm-scripts"
            sqm_error "Please copy and paste everything below the cut-here line into your issue report, thanks."
        else
            sqm_debug "Currently no ifb is associated with ${CUR_IF}, this is normal during starting of the sqm system."
        fi
    fi
    echo ${CUR_IFB}
}

ifb_name() {
    local CUR_IF
    local MAX_IF_NAME_LENGTH
    local IFB_PREFIX
    local NEW_IFB
    CUR_IF=$1
    MAX_IF_NAME_LENGTH=15
    IFB_PREFIX="ifb4"
    NEW_IFB=$( echo -n "${IFB_PREFIX}${CUR_IF}" | head -c $MAX_IF_NAME_LENGTH )

    echo ${NEW_IFB}
}

# if required
create_new_ifb_for_if() {
    local NEW_IFB
    NEW_IFB=$(ifb_name $1)
    create_ifb ${NEW_IFB}
    RET=$?
    echo $NEW_IFB
    return $RET
}


# TODO: report failures
create_ifb() {
    local CUR_IFB
    CUR_IFB=${1}
    $IP link add name ${CUR_IFB} type ifb
}

delete_ifb() {
    local CUR_IFB
    CUR_IFB=${1}
    $IP link set dev ${CUR_IFB} down
    $IP link delete ${CUR_IFB} type ifb
}


# the best match is either the IFB already associated with the current interface
# or a new named IFB
get_ifb_for_if() {
    local CUR_IF
    local CUR_IFB
    CUR_IF=$1
    # if an ifb is already associated return that
    CUR_IFB=$( get_ifb_associated_with_if ${CUR_IF} )
    [ -z "$CUR_IFB" ] && CUR_IFB=$( create_new_ifb_for_if ${CUR_IF} )
    [ -z "$CUR_IFB" ] && sqm_warn "Could not find existing IFB for ${CUR_IF}, nor create a new IFB instead..."
    echo ${CUR_IFB}
}

I would guess the simple solution from my earlier post might throw an error if you try to create an IFB that already exists... but that is probably benign...

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.