Mostrei um roteador ASUS AC-RT56U com a versão DD-WRT V24-preSP 2201412-22-2014-r25697. Agora eu quero fazer isso em um hotspot com wifidog PARA COLOCAR EM UMA PEQUENA EMPRESA (FITNESS CENTER)
Eu criei meu próprio servidor de autenticação, para solucionar problemas onde ele está errado. Quando conecto um novo dispositivo sem fio, ele não tem acesso à internet, apenas ao roteador DD-WRT e ao servidor de autenticação. Quando digito um URL (como: www.google.com), não sou redirecionado para a página de login. No meu arquivo access.log no servidor, vejo apenas o roteador DD-wrt enviando pedidos ping para o servidor. Eu tenho isso, então meu servidor de autenticação personalizado sempre responde 'Pong'.
Eu vi que há um bug sobre isso http://svn.dd-wrt.com/ticket/3344 . Mas não tem resposta. É precisamente isso que acontece no meu dispositivo. Quando eu acesso http: // routerip: 2060 eu recebo a página do portal do meu servidor de autenticação.
Agora quero saber se é possível criar uma regra iptables para que todo o tráfego não autenticado seja redirecionado para a página http: // routerip: 2060? Eu acho que o resto do processo funcionará quando o redirecionamento funcionar.
Este é o diagrama de como funciona o processo de autenticação do wifidog. O primeiro redirecionamento é aquele que não funciona. http://dev.wifidog.org/wiki/doc/developer/FlowDiagram
Eu não tenho nenhuma experiência modificando as regras do iptables.
iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT 0 -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT udp -- anywhere anywhere udp spt:bootps dpt:bootpc
DROP udp -- anywhere anywhere udp dpt:route
DROP udp -- anywhere anywhere udp dpt:route
ACCEPT udp -- anywhere anywhere udp dpt:route
ACCEPT tcp -- anywhere dd-wrt tcp dpt:telnet
DROP icmp -- anywhere anywhere
DROP igmp -- anywhere anywhere
ACCEPT 0 -- anywhere anywhere state NEW
ACCEPT 0 -- anywhere anywhere state NEW
DROP 0 -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
WiFiDog_br0_WIFI2Internet 0 -- anywhere anywhere
ACCEPT 0 -- anywhere 123.123.123.123.colo.transip.net
ACCEPT 0 -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT gre -- 192.168.128.0/24 anywhere
ACCEPT tcp -- 192.168.128.0/24 anywhere tcp dpt:1723
lan2wan 0 -- anywhere anywhere
ACCEPT 0 -- anywhere anywhere
TRIGGER 0 -- anywhere anywhere TRIGGER type:in match:0 relate:0
trigger_out 0 -- anywhere anywhere
ACCEPT 0 -- anywhere anywhere state NEW
DROP 0 -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain WiFiDog_br0_AuthServers (1 references)
target prot opt source destination
logaccept 0 -- anywhere 123.123.123.123.colo.transip.net
Chain WiFiDog_br0_Global (1 references)
target prot opt source destination
Chain WiFiDog_br0_Known (1 references)
target prot opt source destination
logaccept 0 -- anywhere anywhere
Chain WiFiDog_br0_Locked (1 references)
target prot opt source destination
logreject 0 -- anywhere anywhere
Chain WiFiDog_br0_Unknown (1 references)
target prot opt source destination
logaccept udp -- anywhere anywhere udp dpt:domain
logaccept tcp -- anywhere anywhere tcp dpt:domain
logaccept udp -- anywhere anywhere udp dpt:bootps
logaccept tcp -- anywhere anywhere tcp dpt:bootps
logreject 0 -- anywhere anywhere
Chain WiFiDog_br0_Validate (1 references)
target prot opt source destination
logaccept 0 -- anywhere anywhere
Chain WiFiDog_br0_WIFI2Internet (1 references)
target prot opt source destination
DROP 0 -- anywhere anywhere state INVALID
TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
WiFiDog_br0_AuthServers 0 -- anywhere anywhere
WiFiDog_br0_Locked 0 -- anywhere anywhere mark match 0x254
WiFiDog_br0_Global 0 -- anywhere anywhere
WiFiDog_br0_Validate 0 -- anywhere anywhere mark match 0x1
WiFiDog_br0_Known 0 -- anywhere anywhere mark match 0x2
WiFiDog_br0_Unknown 0 -- anywhere anywhere
Chain advgrp_1 (0 references)
target prot opt source destination
Chain advgrp_10 (0 references)
target prot opt source destination
Chain advgrp_2 (0 references)
target prot opt source destination
Chain advgrp_3 (0 references)
target prot opt source destination
Chain advgrp_4 (0 references)
target prot opt source destination
Chain advgrp_5 (0 references)
target prot opt source destination
Chain advgrp_6 (0 references)
target prot opt source destination
Chain advgrp_7 (0 references)
target prot opt source destination
Chain advgrp_8 (0 references)
target prot opt source destination
Chain advgrp_9 (0 references)
target prot opt source destination
Chain grp_1 (0 references)
target prot opt source destination
Chain grp_10 (0 references)
target prot opt source destination
Chain grp_2 (0 references)
target prot opt source destination
Chain grp_3 (0 references)
target prot opt source destination
Chain grp_4 (0 references)
target prot opt source destination
Chain grp_5 (0 references)
target prot opt source destination
Chain grp_6 (0 references)
target prot opt source destination
Chain grp_7 (0 references)
target prot opt source destination
Chain grp_8 (0 references)
target prot opt source destination
Chain grp_9 (0 references)
target prot opt source destination
Chain lan2wan (1 references)
target prot opt source destination
Chain logaccept (7 references)
target prot opt source destination
ACCEPT 0 -- anywhere anywhere
Chain logdrop (0 references)
target prot opt source destination
DROP 0 -- anywhere anywhere
Chain logreject (2 references)
target prot opt source destination
REJECT tcp -- anywhere anywhere reject-with tcp-reset
Chain trigger_out (1 references)
target prot opt source destination