#!/bin/sh -e . ../common.sh # setup random ip gen_randnet () { randnet=21.$(($RANDOM % 256)).$(($RANDOM % 256)) } gen_randnet while ! arping -I br-mesh -D -c 5 -q $randnet.1; do gen_randnet done mesh_add_ipv4 $randnet.1 255.0.0.0 # setup dhcp echo " set dhcp.mesh=dhcp set dhcp.mesh.start=2 set dhcp.mesh.limit=254 set dhcp.mesh.leasetime=60 set dhcp.mesh.interface=mesh " | uci batch /etc/init.d/dnsmasq restart # disable batman-adv-mangling with DHCP packets batctl gw off # TODO: start fake dns # start redirection httpd, add robinson IP to service httpd echo "http://$randnet.1/robinson.html" > /tmp/redirection_target enable_httpd redirection $randnet.1:81 change_service_httpd_listen $randnet.1:80 /etc/init.d/uhttpd restart # TODO: redirect all inet traffic to local httpd