openwrt 系统下通过命令行设置允许wan口进行Luci页面的访问

复制代码
# 允许 WAN 口访问 HTTP(端口 80)
uci set firewall.http_wan_rule=rule
uci set firewall.http_wan_rule.name='Allow-WAN-HTTP'
uci set firewall.http_wan_rule.src='wan'
uci set firewall.http_wan_rule.dest_port='80'
uci set firewall.http_wan_rule.proto='tcp'
uci set firewall.http_wan_rule.target='ACCEPT'
uci set firewall.http_wan_rule.enabled='1'

# 允许 WAN 口访问 HTTPS(端口 443)
uci set firewall.https_wan_rule=rule
uci set firewall.https_wan_rule.name='Allow-WAN-HTTPS'
uci set firewall.https_wan_rule.src='wan'
uci set firewall.https_wan_rule.dest_port='443'
uci set firewall.https_wan_rule.proto='tcp'
uci set firewall.https_wan_rule.target='ACCEPT'
uci set firewall.https_wan_rule.enabled='1'
复制代码
uci commit firewall
/etc/init.d/firewall restart
相关推荐
Tim风声(网络工程师)4 小时前
排查内网互联网访问流程
运维·服务器·网络
一袋米扛几楼987 小时前
【网络】网络规划与底层通信:自顶向下方法论 (Top-Down Methodology) 全解析
网络·工程
liulilittle7 小时前
TCP BBR 拥塞控制模块编译
网络·网络协议·tcp/ip
wangl_927 小时前
Modbus RTU 与 Modbus TCP 深入指南-功能码与数据模型
网络·网络协议·tcp/ip·tcp·modbus·rtu
砍材农夫8 小时前
物联网 MQTT协议和本地socket区别
网络·物联网
xhbh6668 小时前
Windows端口转发完全教程:netsh命令详解与实战案例
服务器·网络·ip·流量转发·端口流量转发
wangl_929 小时前
Modbus RTU 与 Modbus TCP 深入指南-性能分析与优化
网络·网络协议·tcp/ip·tcp·modbus·rtu
遇印记10 小时前
软考知识点
运维·服务器·网络
源远流长jerry10 小时前
Linux 网络收包机制:从网卡到 Socket 的完整路径
linux·运维·服务器·网络·网络协议·tcp/ip
上海云盾安全满满11 小时前
选择接入高防IP后,源机是否还要带有防护
网络·网络协议·tcp/ip