OpenClaw WebUI 的局域网访问配置方法1:推荐第一步:允许局域网访问openclaw config set gateway.bind lan作用:将网关从 loopback(仅本地)模式切换为 lan(局域网/公网可访问)模式第二步:允许非安全认证(解决 origin 限制的关键)openclaw config set gateway.controlUi.allowInsecureAuth true第三步:(可选)禁用设备认证openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth true注意:此步骤会降低安全性,仅在可信局域网内使用第四步:获取本机局域网 IPlinux系统:ifconfig windows系统:ipconfig比如测试系统的IP是: 192.168.1.53第五步:配置允许的来源 Origins(解决跨域访问)openclaw config set 'gateway.controlUi.allowedOrigins' '["http://192.168.1.53:18789"]'将 192.168.1.53 替换为你实际的局域网 IP 地址第六步:重启网关使配置生效openclaw gateway restart第七步:验证服务监听状态openclaw gateway status方法2:1、进入OpenClaw配置模式openclaw configure2. 选择 Gateway,默认端口 187893. 选额 LAN,Token, Off修改配置文件 :openclaw.json vi ~/.openclaw/openclaw.json"gateway": { "port": 18789, "mode": "local", "bind": "lan", "controlUi": { "allowedOrigins": [ "http://localhost:18789", "http://127.0.0.1:18789", "http://192.168.1.53:18789" ], "dangerouslyAllowHostHeaderoriginFallback": true, "allowInsecureAuth": true, "dangerouslyDisableDeviceAuth": true }, 执行:openclaw gateway restart查看访问地址及token :openclaw dashbaoard恢复默认配置(取消所有安全降级 / 自定义配置)openclaw config set gateway.bind loopbackopenclaw config set gateway.auth.mode deviceopenclaw config unset gateway.auth.tokenopenclaw config set gateway.controlUi.allowInsecureAuth falseopenclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth falseopenclaw gateway restart