Skip to content

Commit d3b540f

Browse files
committed
openwrt: isolate vaplan in a guest zone instead of lan
Hotspot clients were placed in the OpenWrt 'lan' zone (input/forward ACCEPT), giving them reach to the router's services and any other container bridged into lan - effectively a backdoor into the whole LAN. Move vaplan into a dedicated 'guest' zone: input REJECT, intra-zone forward DROP (client isolation), forwarded only out the masqueraded wan zone. Add traffic rules allowing the access guests actually need: DHCP (67-68), DNS (53), and LuCI (80/443, password-protected). Signed-off-by: ravindu644 <droidcasts@protonmail.com>
1 parent 22fc1aa commit d3b540f

1 file changed

Lines changed: 38 additions & 2 deletions

File tree

OpenWrt-24.10-Minimal.Dockerfile

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ config interface 'wan'
4747
option proto 'dhcp'
4848
NETEOF
4949

50-
# fw3 zones: lan (vaplan, added by VirtualAP) -> masqueraded wan/eth0
50+
# fw3 zones: vaplan lives in an isolated 'guest' zone (NOT lan) so hotspot
51+
# clients reach only the internet (guest -> masqueraded wan/eth0) and never
52+
# other containers on lan. input REJECT blocks router services by default; we
53+
# punch holes below for DHCP + DNS (needed for a lease) and LuCI (admin UI).
5154
cat > /etc/config/firewall <<'FWEOF'
5255
config defaults
5356
option syn_flood '1'
@@ -57,11 +60,17 @@ config defaults
5760

5861
config zone
5962
option name 'lan'
60-
list network 'vaplan'
6163
option input 'ACCEPT'
6264
option output 'ACCEPT'
6365
option forward 'ACCEPT'
6466

67+
config zone
68+
option name 'guest'
69+
list network 'vaplan'
70+
option input 'REJECT'
71+
option output 'ACCEPT'
72+
option forward 'DROP'
73+
6574
config zone
6675
option name 'wan'
6776
list network 'wan'
@@ -75,6 +84,33 @@ config forwarding
7584
option src 'lan'
7685
option dest 'wan'
7786

87+
config forwarding
88+
option src 'guest'
89+
option dest 'wan'
90+
91+
# Guest clients need DHCP + DNS from the router itself (input is REJECT)
92+
config rule
93+
option name 'Allow-DHCP-Guest'
94+
option src 'guest'
95+
option proto 'udp'
96+
option dest_port '67-68'
97+
option target 'ACCEPT'
98+
99+
config rule
100+
option name 'Allow-DNS-Guest'
101+
option src 'guest'
102+
option proto 'tcp udp'
103+
option dest_port '53'
104+
option target 'ACCEPT'
105+
106+
# LuCI reachable from the hotspot (password-protected); router services otherwise blocked
107+
config rule
108+
option name 'Allow-LuCI-Guest'
109+
option src 'guest'
110+
option proto 'tcp'
111+
option dest_port '80 443'
112+
option target 'ACCEPT'
113+
78114
config rule
79115
option name 'Allow-DHCP-Renew'
80116
option src 'wan'

0 commit comments

Comments
 (0)