updated lazyinstall, now includes hotspot, captive portal and init script

This commit is contained in:
Roel 2014-05-28 21:25:36 +02:00
parent c750d062be
commit 04a0cf548e
6 changed files with 113 additions and 2 deletions

38
lazyinstall/dhcp Normal file
View File

@ -0,0 +1,38 @@
config dnsmasq
option domainneeded 1
option boguspriv 1
option filterwin2k 0 # enable for dial on demand
option localise_queries 1
option rebind_protection 1 # disable if upstream must serve RFC1918 addresses
option rebind_localhost 1 # enable for RBL checking and similar services
#list rebind_domain example.lan # whitelist RFC1918 responses for domains
option local '/lan/'
option domain 'lan'
option expandhosts 1
option nonegcache 0
option authoritative 1
option readethers 1
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
#list server '/mycompany.local/1.2.3.4'
#option nonwildcard 1
#list interface br-lan
#list notinterface lo
#list bogusnxdomain '64.94.110.11'
list server '//192.168.2.1'
config dhcp lan
option interface lan
option start 100
option limit 150
option leasetime 12h
config dhcp wan
option interface wan
option ignore 1
config dhcp hotspot
option 'interface' 'hotspot'
option 'start' '100'
option 'limit' '150'
option 'dynamicdhcp' '1'

34
lazyinstall/firewall Normal file
View File

@ -0,0 +1,34 @@
config 'zone'
option 'name' 'hotspot'
option 'input' 'ACCEPT'
option 'forward' 'ACCEPT' #was REJECT
option 'output' 'ACCEPT'
config 'rule'
option 'src' 'hotspot'
option 'dest_port' '53'
option 'proto' 'tcpudp'
option 'target' 'ACCEPT'
config 'rule'
option 'src' 'hotspot'
option 'src_port' '67-68'
option 'dest_port' '67-68'
option 'proto' 'udp'
option 'target' 'ACCEPT'
config 'rule'
option 'target' 'ACCEPT'
option 'src' 'hotspot' # guest wifi interface
option 'proto' 'tcp'
option '_name' 'Website' # this can maybe go?
option 'dest_port' '80'
config 'redirect'
option 'proto' 'tcp'
option '_name' 'Website' # this can maybe go?
option 'src' 'hotspot' # guest wifi interface
option 'src_dport' '80'
option 'dest_port' '80'
option 'dest_ip' '192.168.2.1' # ip of webserver

View File

@ -10,10 +10,18 @@ swapon /dev/sda2
mv fstab_extroot /etc/config/fstab mv fstab_extroot /etc/config/fstab
echo 'Configuring wireless and hotspot'
head -n 10 /etc/config/wireless >> tmp_wireless head -n 10 /etc/config/wireless >> tmp_wireless
cat wireless >> tmp_wireless cat wireless >> tmp_wireless
mv tmp_wireless /etc/config/wireless mv tmp_wireless /etc/config/wireless
mv firewall /etc/config/firewall
mv dhcp /etc/config/dhcp
echo "address=/#/192.168.2.1 " >> /etc/dnsmasq.conf
sleep 1 sleep 1
mv network /etc/config/network mv network /etc/config/network
@ -28,6 +36,8 @@ git clone git://github.com/jngrt/meshenger.git
mv uhttpd /etc/config/uhttpd mv uhttpd /etc/config/uhttpd
mv meshenger /etc/init.d/meshenger
echo 'my ip address is:' #klopt nog niet echo 'my ip address is:' #klopt nog niet
ifconfig br-lan | grep 'inet addr' ifconfig br-lan | grep 'inet addr'

16
lazyinstall/meshenger Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh /etc/rc.common
#meshenger startup script
START=10
STOP=15
start() {
echo 'starting Meshenger'
python ~/meshenger/main.py &
}
stop() {
echo 'Killing Meshenger'
killall python
}

View File

@ -18,3 +18,9 @@ config interface 'mesh'
option mtu '1528' option mtu '1528'
option proto 'none' option proto 'none'
config interface 'hotspot'
option 'iface' 'radio0' #use your existing wifi device (look in config/wireless below)
option 'proto' 'static'
option 'ipaddr' '192.168.2.1'
option 'netmask' '255.255.255.0'
option 'type' 'bridge'

View File

@ -1,8 +1,15 @@
config wifi-iface 'wmesh' config wifi-iface 'wmesh'
option device 'radio0' option device 'radio0'
option ifname 'adhoc0' option ifname 'adhoc0'
option network 'mesh' option network 'mesh'
option mode 'adhoc' option mode 'adhoc'
option ssid 'mesh' option ssid 'mesh'
option bssid '66:66:66:66:66:66' option bssid '66:66:66:66:66:66'
config wifi-iface
option 'device' 'radio0' #use your excisting wifi device, look in the list above.
option 'ssid' 'meshenger_node' #use a unique name for your network?
option 'network' 'hotspot'
option 'mode' 'ap'
option 'encryption' 'none'
option 'isolate' '1'