Both routers: sshd takes keys only (it is reachable from the open TollGate SSID, and on the Pi from the WAN); shared %router-sysctls in router-base (no ICMP redirects taken, loose rp_filter, kptr_restrict, BPF JIT hardened). MT6000: the lab WAN SSH rule is gone; 99_zz-wired-private (a uci-defaults script, after TollGate's setup) moves lan1-lan5 into TollGate's private network (192.168.2.1), leaves br-lan to the open SSID, rejects SSH/telnet/ LuCI from it, trims nodogsplash's router ports, and turns on the private network's DHCP, which TollGate's setup left disabled (PITFALLS #55). The kernel has CONFIG_NFT_FLOW_OFFLOAD; fw4's offloading was measured and is left off -- no gain at line rate, and it would let flows bypass nodogsplash's session enforcement (PITFALLS #56). Deployed as MT6000 generation 6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.7 KiB
Bash
46 lines
1.7 KiB
Bash
#!/bin/sh
|
|
# GL-MT6000, after TollGate's setup (99-tollgate-setup) has made its
|
|
# networks: the wired ports are the owner's, in TollGate's private network
|
|
# (br-private) with its private SSID; br-lan keeps only the open TollGate
|
|
# SSID, and nothing on it reaches the router's admin services -- anyone
|
|
# nearby can join that SSID, and nodogsplash opens the router to every
|
|
# client that has paid. Idempotent.
|
|
|
|
uci -q get network.private_bridge >/dev/null || exit 0
|
|
|
|
# br-lan: the open SSID only.
|
|
for dev in $(uci show network | sed -n "s/^network\.\([^.]*\)\.name='br-lan'$/\1/p"); do
|
|
uci -q delete network.$dev.ports
|
|
uci set network.$dev.bridge_empty='1'
|
|
done
|
|
|
|
# br-private: the switch ports.
|
|
uci -q delete network.private_bridge.ports
|
|
for port in lan1 lan2 lan3 lan4 lan5; do
|
|
uci add_list network.private_bridge.ports=$port
|
|
done
|
|
uci set network.private_bridge.bridge_empty='1'
|
|
|
|
# TollGate's private DHCP section lacks dhcpv4: OpenWrt's dnsmasq init now
|
|
# defaults it to disabled, so the private network had no DHCP at all.
|
|
uci set dhcp.private.dhcpv4='server'
|
|
|
|
# No SSH, telnet or uhttpd (LuCI) from the public zone. The portal needs
|
|
# only nodogsplash (2050), TollGate (2121), DNS and DHCP.
|
|
uci set firewall.public_no_admin=rule
|
|
uci set firewall.public_no_admin.name='Block-Admin-From-Public'
|
|
uci set firewall.public_no_admin.src='lan'
|
|
uci set firewall.public_no_admin.proto='tcp'
|
|
uci set firewall.public_no_admin.dest_port='22 23 443 8080'
|
|
uci set firewall.public_no_admin.target='REJECT'
|
|
|
|
for port in 22 23 8080; do
|
|
uci -q del_list nodogsplash.@nodogsplash[0].users_to_router="allow tcp port $port"
|
|
done
|
|
|
|
uci commit network
|
|
uci commit dhcp
|
|
uci commit firewall
|
|
uci commit nodogsplash
|
|
exit 0
|