如何自动检测强制门户

问题描述 投票:1回答:1

我正在使用CentOS 6在服务器上做热点,我想知道如何让智能手机自动识别强制门户,重定向到登录。在我的防火墙中我有这个规则:

iptables -t nat -A NET_DHCP -i eth1 -s 172.16.0.0/16 -p tcp --dport 80 -j DNAT --to 172.16.0.1:80

在Apache(httpd.conf)中:

<VirtualHost *:80>
        ErrorDocument 400 /var/www/dhcpauth/index.php
        ErrorDocument 404 /var/www/dhcpauth/index.php
        ServerPath /var/www/dhcpauth
        DocumentRoot /var/www/dhcpauth/
        <Directory /var/www/dhcpauth>
            AllowOverride All
            DirectoryIndex index.html index.html
            Options Indexes FollowSymLinks
            Order allow,deny
            Allow from all
        </Directory>
</VirtualHost>

在其他相关答案中,我找到了以下代码。它没有像我使用它那样工作:

<!--
<?xml version="1.0" encoding="UTF-8"?>
<WISPAccessGatewayParam xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.wballiance.net/wispr_2_0.xsd">
<Redirect>
<MessageType>100</MessageType>
<ResponseCode>0</ResponseCode>
<VersionHigh>2.0</VersionHigh>
<VersionLow>1.0</VersionLow>
<AccessProcedure>1.0</AccessProcedure>
<AccessLocation>Andrew Wippler is awesome</AccessLocation>
<LocationName>MyOpenAP</LocationName>
<LoginURL>http://hotspot.localnet/</LoginURL>
</Redirect>
</WISPAccessGatewayParam>
-->

如果内部域或IP访问热点,则热点正常工作,但当设备在网络中连接时,我希望看到消息“此网络需要身份验证”。有人可以帮帮我吗?

apache iptables hotspot captiveportal
1个回答
0
投票

根据以下链接,我在通过apache执行302重定向时能够进行侦察:

https://serverfault.com/questions/679393/captive-portal-popups-the-definitive-guide

应该注意的是,在虚拟主机中,Apache的唯一选择应该是FollowSymLinks选项,如:

Options FollowSymLinks

© www.soinside.com 2019 - 2024. All rights reserved.