{%
if netmode_is_supported ~= true then
    print('The current netmode is not support to active port.')
    return
end
if params_valid ~= true then
    echo('Usage: ipmcset -d activeport -v <option> [portid]\n')
    echo('Options are:\n')
    echo('    0      :  Dedicated network port, without parameter [portid]\n')
    local type_table = {
        ['1'] = 'LOM',
        ['2'] = 'PCIE',
        ['5'] = 'OCP',
        ['6'] = 'OCP2'
    }
    for k, _ in pairs(port_type_list) do
        if k ~= '0' then
            echo(string.format('    %s      :  %s network port\n', k, type_table[k]))
        end
    end
    echo('\b')
else
    if port_exist ~= true then
        echo('Input port does not exist.')
    else
        echo('Set active port successfully.')
    end
end
%}