You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

OpenDaylight Restconf始终返回401错误的问题求助

OpenDaylight Restconf 401 Unauthorized 问题排查方案
  • 确认AAA认证模块状态
    OpenDaylight的Restconf依赖AAA认证模块,登录控制器的Karaf控制台,执行feature:list | grep aaa,检查odl-aaa-authn、odl-aaa-authz这些模块是否处于Started状态。如果未安装,执行feature:install odl-aaa-authn odl-aaa-authz补装,同时查看启动日志确认AAA模块无初始化报错。

  • 核对用户名密码准确性
    不要默认使用admin/admin,前往控制器的etc/org.opendaylight.aaa.authn.impl.ServiceModule.cfg文件,查看default-user-password字段确认实际默认密码,若之前修改过配置,需使用修改后的密码测试。

  • 修正Restconf请求路径
    0.19.2版本的network-topology端点需要添加命名空间后缀,正确请求路径应为:

    curl -u admin:admin http://$VM-IP:8181/restconf/operational/network-topology:network-topology
    

    很多401问题实际是路径不正确导致的权限匹配失败,试试用这个完整路径发起请求。

  • 检查权限配置
    打开etc/org.opendaylight.aaa.authz-service.cfg,确认admin用户所属角色拥有Restconf访问权限。可临时添加规则admin=*,允许admin访问所有资源,测试是否能正常响应。

  • 验证网络与端口
    虽能收到401,仍需确认VM的8181端口是否对外开放:

    nc -zv $VM-IP 8181
    

    若为生产环境,可能强制使用HTTPS,尝试换端口8443并忽略证书验证:

    curl -k -u admin:admin https://$VM-IP:8443/restconf/operational/network-topology:network-topology
    
  • 确认Restconf模块安装状态
    在Karaf控制台执行feature:list | grep restconf,确保odl-restconf-nb处于Started状态。如果未安装,执行feature:install odl-restconf-nb重新安装后重启控制器。

内容的提问来源于stack exchange,提问作者Zsombor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 10:01:08