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
相关推荐
浅念-28 分钟前
C++ Protobuf 入门实战:基于通讯录项目吃透proto3语法与序列化
linux·服务器·网络·c++·protobuf·proto·proto3
2401_8685347834 分钟前
网络环境规划核心考点全梳理
网络·设计模式
M158227690551 小时前
ModbusTCP 转 Profinet 网关:上位机控制 PN 伺服方案
服务器·网络·tcp/ip
宵时待雨1 小时前
linux笔记归纳18:传输层协议TCP
linux·网络·笔记·网络协议·tcp/ip
captain3762 小时前
▲网络原理(1)-UDP
网络·网络协议·tcp/ip
zbtlink2 小时前
家用全屋WiFi技术选型思考:吸顶AP、面板AP与路由器的参数对比
网络·智能路由器
开开心心就好3 小时前
清理此电脑网盘图标工具,开源免费好用
网络·网络协议·tcp/ip·智能手机·电脑·scala·erlang
码少女3 小时前
Linux——多路复用之poll模型
linux·服务器·网络
normanhere4 小时前
防火墙来回路径不一致导致的网速异常
运维·服务器·网络