使用openwrt设置Guest Wifi网络

以下脚本在openwrt路由器上创建一个SSID为Guest-WIFI的访客网络,该网不设置安全检查,能访问外网,但不能访问家庭网络上的资源。

## Add a guest network
uci set network.guest=interface
uci set network.guest.type=bridge
uci set network.guest.proto=static
uci set network.guest.ipaddr=192.168.2.1
uci set network.guest.netmask=255.255.255.0



## Set DHCP for guest network
uci set dhcp.guest=dhcp
uci set dhcp.guest.interface=guest
uci set dhcp.guest.start=100
uci set dhcp.guest.limit=150
uci set dhcp.guest.leasetime=12h


## Add a Guest AP
uci add wireless wifi-iface
uci set wireless.@wifi-iface[1].network=guest
uci set wireless.@wifi-iface[1].device=radio0
uci set wireless.@wifi-iface[1].mode=ap
uci set wireless.@wifi-iface[1].encryption=none
uci set wireless.@wifi-iface[1].ssid=Guest-WIFI


## Add  a guest zone 
uci set firewall.guest=zone
uci set firewall.guest.name=guest
uci set firewall.guest.network=guest
uci set firewall.guest.input=ACCEPT
uci set firewall.guest.output=ACCEPT
uci set firewall.guest.forward=ACCEPT


## Allow forwarding from guest to wan
uci set firewall.guest2wan=forwarding
uci set firewall.guest2wan.src=guest
uci set firewall.guest2wan.dest=wan


## Allow forwarding from lan to guest
uci set firewall.lan2guest=forwarding
uci set firewall.lan2guest.src=lan
uci set firewall.lan2guest.dest=guest


## Apply changes
uci commit
/etc/init.d/network restart


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值