您的位置:首页 > 理论基础 > 计算机网络

使用openwrt设置Guest Wifi网络

2016-10-09 21:29 681 查看
以下脚本在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

转自:http://blog.csdn.net/boliang319/article/details/41116051
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: