import copy


def get_config_interfaces_by_type(config_interfaces, type_str):
    """
    Extract config entries from dict by type
    :param config_interfaces: Interfaces config dict
    :param type_str: Type string to match
    :return: Interfaces config dict only containing type matching type_str
    """
    config_template = {}
    for name, config_interface in config_interfaces.items():
        if config_interface.get('type') == type_str:
            config_template[name] = copy.deepcopy(config_interface)

    return config_template