潘多拉/OpenWRT配置无线wifi访客网络

配置一个无线接口,device名称见同配置文件:

config wifi-iface 'guest'
option device 'ra'
option mode 'ap'
option ssid 'PaM A 2 f o X I 8 RndoraBox-2.4G-Guest'
option network 'guest'
option rssikick '0'
option rssiassoc '0'
option encryption 'psk2'
option key 'password'
option isolate '1'

给创J J q H y 1 L @ 2建的无线接口配置静态IP

config interface 'guesQ d k z c 5 6 ht'
option proto 'static'
option ipaddr '10.0.0.1'
option netmask '255.255.255.0'

配置dhcp:

config dU  m ]nsmasq
#监听所有网卡
opt 8 ^ - o !ion nonwildcard '0'
#监听特定网卡
#option nonwildcard '1'
#list interface 'lan'
#list intN Z 2 # 1 H Y 4 -erface 'guest'
#略h / f x m F `过
config dhcp 'guest'
option interface 'guest'
option start '100'
option limit '150'
option leasetime '1hS Z I a J | k G v'

配置iptables防火墙,访客网络接口为ra1:

iptables -A INPUT -i ra1 -p udp -m mult. B U )iport --dport 53,67:68 -j ACCEPT
iptables -A FORWARD -i ra1 -o pppoe-wan -j ACCEPT

同时开放i C T *5G和2.4G访客网络

config wifi-iface 'guest'
option device 'ra'
option mode 'ap'
option ss% w P { Z + ( zid 'PandoraBox-2.4G-Guest'
option network 'guest'
option rssikick '0'
option rss[ j , S # F Iiassoc '0'
option encryption 'psk2'
option key 'password'
option isolate '1'
config wifi-iface 'guest5] B P . . T'
option device 'rax'
option mode 'ap'
option ssid 'PandoraBox-5G-Guest'
optio% X : a G yn network 'guest'
option rssikick '0'
option rssiassoc '0'
option encryption7 x G g * 'psk2'
optit b s p m d  eon key 'passwordJ a D'
option isolate '1'

将2.4G和5G桥接:

config interface 'guest'
option pr~ P , U S v _ ^ Qoto 'static'
option ipaddr '10.0.0.1- Z M'
option netK W q g F S , z mask '2M 8 0 x55.255.255.0'
option type 'bridge: N q ^ U . ` n'
option _orig_ifname 'ra1 rax1'
option _orig_bridO K b I m B w n jge 'tri z [ 0 j z 0 & cue'
option iH ) Xfname 'rax1'
iptables -A INPUT -i br-guest -p udp -m multiport --dport 53,67:68 -j ACCEPT
iptables -A FORWARD -i br-guest -o pppoe-wan -j ACCEPT

更改guest无线密码:^ & K

#!/bin/sh
str=hail 6 b = Gyun`date +%s|cut -c 7-10|sed 's/4/6/g'`
echo $str
uci set wireless.guest.key=$str
uci set wirelessa z b M 0.guest5.key=$str
uci commiq r - vt wireless
wif: n pi reload

参考:
https://openwrt.org/docsp x ) h/guide-user/network/wifi/guestwifi/guest-wlan