{
    "name"  : "NAT配置",
    "precondition" : [],
    "problems" : {
        "nat" : {
            "desc"      : "【问题】接口 ${0} 没有配置ip nat outside，请确认这条线是否需要做NAT",
            "advice"    : [
                "【建议】可运行如下配置进行配置", 
                "配置示例：",
                "\tRuijie#config",
                "\tRuijie(config)#interface ${1}",
                "\tRuijie(config-if)#ip nat outside",
                "\tRuijie(config-if)#end",
                "\tRuijie#write"                 
            ]
        },
        "nat1" : {
            "desc"      : "【问题】接口 ${0} 没有配置ip nat inside，请确认这条线是否需要做NAT",
            "advice"    : [
                "【建议】可运行如下配置进行配置", 
                "配置示例：",
                "\tRuijie#config",
                "\tRuijie(config)#interface ${1}",
                "\tRuijie(config-if)#ip nat inside",
                "\tRuijie(config-if)#end",
                "\tRuijie#write"                 
            ]
        }
    }
}

---------------------------code-------------------------------
isProblemFound = false

wansDetail = get_share_value('wansDetail');

foreach wan in wansDetail:
    ip = wan.ip
    if ip && !wan.nat && wan.isUP :
        intf = wan.intf
        isProblemFound = true
        add_problem("nat",[intf, intf])
    end
end

lansDetail = get_share_value('lansDetail');

foreach lan in lansDetail:
    ip = lan.ip
    if ip && !lan.nat && lan.isUP :
        intf = lan.intf
        isProblemFound = true
        add_problem("nat1",[intf, intf])
    end
end

if isProblemFound == true :
    return 'warn'
else:
    return 'success'
end
