Fumaça Data Springs/Anexo técnico
IPs
IPs para Fumaça e Porto Real: 10.7.0.0/16 (10.7.0.0 a 10.7.255.255)
- IP reservada para o roteador mais próximo: 10.7.0.1
- BSC -> 10.7.0.5 - 00:30:18:a2:88:95
- BTS master -> 10.7.0.6 - 00:d0:cc:08:18:24
- BTS slave -> 10.7.0.7 - 00:d0:cc:08:08:82
- servidor -> 10.7.0.10
- este wiki http://wiki.fumacaonline.org.br
- gallery (fotos) http://gallery.fumacaonline.org.br
- nebulosa -> 10.7.161.204
- morrinho -> 10.7.163.199
- igrejinha -> 10.7.161.183
- torre -> 10.7.182.85
- salao -> 10.7.163.241
- moacir -> 10.7.182.220
- moiados -> 10.7.164.123
- campinho -> [http://]
- 2a00:1508:a57:8900::ad:a3f1 salao
- 2a00:1508:a57:8900::ad:a1b7 igrejinha
- 2a00:1508:a57:8900::ad:a47b moiados
- 2a00:1508:a57:8900::ad:a3c7 morrinho
- 2a00:1508:a57:8900::ad:a1cc nebulosa
- 2a00:1508:a57:8900::75:b655 torre
- 2a00:1508:a57:8900::b8:66ee campinho
- 2a00:1508:a57:8900::75:b6dc moacir
Para abrir um browser através do SSH (como se estivesse no servidor local)
- ssh 2a00:1508:a57:8900::ad:a1b7 -D8080
- chromium-browser --proxy-server=socks://localhost:8080
Instalação do portal de controle de acesso
- Essas instruções são para o roteador que está conectado à internet, fornecendo para o resto da rede. Não sei o que acontece no caso em que houver mais de uma saída para internet
- Esse sistema de validação e portal cativo não funciona quando não há acesso internet, ou quando o acesso cai. Para isso, tem uma gambiarra descrita no fim da página
Vá para o menu system -> software do libremesh
Clique em atualizar lista de pacotes
Instalar o pacote nodogsplash e o pacote vale - atenção, o pacote vale não está disponível para a versão 16.07 da libremesh.
Substitua o arquivo /etc/nodogsplash/nodogsplash.conf pelo listado abaixo (fazendo as devidas modificações nos IP e página de redirecionamento). O IP a ser usado é o do menu network -> interfaces, interface LAN (IPV4) (sem o /16). O range são os dois primeiros números, seguidos de .0.0/16. (ex se o ip é 10.7.255.50, o range é 10.7.0.0/16.
GatewayInterface br-lan GatewayInterfaceExtra bmx+ GatewayInterfaceExtra2 anygw FirewallRuleSet authenticated-users { FirewallRule allow to 0.0.0.0/0 } FirewallRuleSet users-to-router { # Nodogsplash automatically allows tcp to GatewayPort, # at GatewayAddress, to serve the splash page. # However you may want to open up other ports, e.g. # 53 for DNS and 67 for DHCP if the router itself is # providing these services. FirewallRule allow udp port 53 FirewallRule allow tcp port 53 FirewallRule allow udp port 67 # You may want to allow ssh, http, and https to the router # for administration from the GatewayInterface. If not, # comment these out. FirewallRule allow tcp port 22 FirewallRule allow tcp port 80 FirewallRule allow tcp port 443 } # end FirewallRuleSet users-to-router FirewallRuleSet preauthenticated-users { # For preauthenticated users to resolve IP addresses in their initial # request not using the router itself as a DNS server, # you probably want to allow port 53 udp and tcp for DNS. FirewallRule allow tcp port 53 FirewallRule allow udp port 53 # For splash page content not hosted on the router, you # will want to allow port 80 tcp to the remote host here. # Doing so circumvents the usual capture and redirect of # any port 80 request to this remote host. # Note that the remote host's numerical IP address must be known # and used here. #change the IP for the address of the gateway router FirewallRule allow tcp port 80 to 10.7.122.55 } # end FirewallRuleSet preauthenticated-users EmptyRuleSetPolicy preauthenticated-users passthrough EmptyRuleSetPolicy users-to-router passthrough #change the IP for the address of the gateway router GatewayName 10.7.122.55:80 #GatewayPort 80 MaxClients 500 ClientIdleTimeout 720 ClientForceTimeout 14400 #change the range for the ip range of your mesh network GatewayIPRange 10.7.0.0/16 BinVoucher "vale.sh" ForceVoucher yes EnablePreAuth yes #change to the place where you want to redirect the users after login RedirectURL http://www.quintanalibre.org.ar/portada
Edite o arquivo /etc/nodogsplash/htdocs/splash-vale.html para refletir as necessidades e contexto da sua comunidade e salve como splash.html (substituindo o splash.html que está no mesmo diretório). Manter o iframe, assim como form e os campos dentro dele.
Vá no menu system -> startup e mude o nodogsplash para enabled
Reinicie o roteador
Gambiarra para redirecionar o tráfego para um servidor interno quando cai a internet
Esse script confere se há acesso à internet. Quando não há, ele altera o dnsmasq para direcionar todos os acessos para o servidor local. Evidente que se houverem outros serviços locais (diferentes servidores etc), essa gambiarra pode atrapalhar esses serviços.
- Copiar o código abaixo para um arquivo chamado offline-redirect.sh, modificando o endereço 10.7.0.10 para o endereço ip do servidor local.
#!/bin/sh if ! ping -q -c 3 -W 1 8.8.8.8>/dev/null then # offline; check if redirect is already there if ! grep -q address=/#/10.7.0.10 /etc/dnsmasq.d/lime-proto-anygw-10-ipv4.conf then echo "address=/#/10.7.0.10">> /etc/dnsmasq.d/lime-proto-anygw-10-ipv4.conf echo "added line" /etc/init.d/dnsmasq restart fi else #if online, delete that line in case it is there if sed -i '\|address=/#/10.7.0.10|d' /etc/dnsmasq.d/lime-proto-anygw-10-ipv4.conf then /etc/init.d/dnsmasq restart fi fi
- Copiar esse arquivo para o diretório /usr/bin
- Modificar o crontab para que o script seja executado a cada minuto. Entre com o comando
contrab -e
e adicione a linha
* * * * * /usr/bin/offline-redirect.sh