Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
| docs:guide-user:network:wifi:guestwifi:configuration [2020/09/20 19:14] – [Guest WLAN using CLI] automate fetching the upstream zone vgaetera | docs:guide-user:network:wifi:guestwifi:configuration_command_line_interface [2024/05/28 00:53] – [Guest Wi-Fi using CLI] stokito | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Guest WLAN using CLI ====== | + | ====== Guest Wi-Fi using CLI ====== |
| - | See also: [[docs: | + | |
| This page provides a script that creates an additional separated guest network and a new guest firewall zone for your OpenWrt device. | This page provides a script that creates an additional separated guest network and a new guest firewall zone for your OpenWrt device. | ||
| Line 13: | Line 12: | ||
| # Configuration parameters | # Configuration parameters | ||
| NET_ID=" | NET_ID=" | ||
| - | WIFI_DEV=" | + | WIFI_DEV=" |
| # Fetch upstream zone | # Fetch upstream zone | ||
| Line 19: | Line 18: | ||
| network_flush_cache | network_flush_cache | ||
| network_find_wan NET_IF | network_find_wan NET_IF | ||
| - | FW_WAN=" | + | FW_WAN=" |
| # Set up guest WLAN | # Set up guest WLAN | ||
| - | uci -q batch << | + | uci -q batch << |
| + | delete network.${NET_ID}_dev | ||
| + | set network.${NET_ID}_dev=device | ||
| + | set network.${NET_ID}_dev.type=bridge | ||
| + | set network.${NET_ID}_dev.name=br-${NET_ID} | ||
| delete network.${NET_ID} | delete network.${NET_ID} | ||
| set network.${NET_ID}=interface | set network.${NET_ID}=interface | ||
| set network.${NET_ID}.proto=static | set network.${NET_ID}.proto=static | ||
| - | set network.${NET_ID}.ipaddr=192.168.3.1 | + | set network.${NET_ID}.device=br-${NET_ID} |
| - | set network.${NET_ID}.netmask=255.255.255.0 | + | set network.${NET_ID}.ipaddr=192.168.3.1/24 |
| commit network | commit network | ||
| - | delete wireless.guest | + | delete wireless.${NET_ID} |
| set wireless.${NET_ID}=wifi-iface | set wireless.${NET_ID}=wifi-iface | ||
| set wireless.${NET_ID}.device=${WIFI_DEV} | set wireless.${NET_ID}.device=${WIFI_DEV} | ||
| Line 60: | Line 63: | ||
| set firewall.${NET_ID}_dns.src=${NET_ID} | set firewall.${NET_ID}_dns.src=${NET_ID} | ||
| set firewall.${NET_ID}_dns.dest_port=53 | set firewall.${NET_ID}_dns.dest_port=53 | ||
| - | set firewall.${NET_ID}_dns.proto=tcpudp | + | add_list |
| + | add_list firewall.${NET_ID}_dns.proto=udp | ||
| set firewall.${NET_ID}_dns.target=ACCEPT | set firewall.${NET_ID}_dns.target=ACCEPT | ||
| delete firewall.${NET_ID}_dhcp | delete firewall.${NET_ID}_dhcp | ||
| Line 68: | Line 72: | ||
| set firewall.${NET_ID}_dhcp.dest_port=67 | set firewall.${NET_ID}_dhcp.dest_port=67 | ||
| set firewall.${NET_ID}_dhcp.proto=udp | set firewall.${NET_ID}_dhcp.proto=udp | ||
| + | set firewall.${NET_ID}_dhcp.family=ipv4 | ||
| set firewall.${NET_ID}_dhcp.target=ACCEPT | set firewall.${NET_ID}_dhcp.target=ACCEPT | ||
| commit firewall | commit firewall | ||
| - | EOF | + | EOI |
| - | / | + | service |
| - | / | + | service |
| - | / | + | service |
| </ | </ | ||
| Line 104: | Line 109: | ||
| You can just enter the OpenWrt web interface and simply **enable** or **disable** the guest WLAN at will. | You can just enter the OpenWrt web interface and simply **enable** or **disable** the guest WLAN at will. | ||
| + | ==== See also ==== | ||
| + | |||
| + | * [[https:// | ||