Italiano English
Modifica History Actions

Differenze per "NinuxUciScriptHotSpot"

Differenze tra le versioni 2 e 3
Versione 2 del 2011-03-31 15:01:06
Dimensione: 2044
Autore: ZioPRoTo
Commento:
Versione 3 del 2011-03-31 15:18:31
Dimensione: 2269
Autore: ZioPRoTo
Commento:
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 2: Linea 2:
Linea 12: Linea 11:
HOSTNAME="zioprotowrt"
LANIP=192.168.1.1
LANNET=192.168.1.0
HOSTNAME="GREG1"
LANIP=192.168.177.200
LANNET=192.168.177.0
Linea 19: Linea 18:
ESSID="ninux.org" ESSID="www.ninux.org"
Linea 37: Linea 36:
uci set network.lan.proto=dhcp uci set network.wan=interface
uci set network.wan.ifname=eth0
uci set network.wan.proto=dhcp
Linea 39: Linea 40:
uci set network.vpn=interface
uci set network.vpn.ifname=ninux
uci set network.vpn.proto=none
Linea 44: Linea 48:
uci set network.wlan.netmask=255.255.0.0 uci set network.wlan.netmask=255.255.255.0
Linea 67: Linea 71:
uci set olsrd.@Interface[0].interface=wlan uci set olsrd.@Interface[0].interface=vpn
uci set o
lsrd.@Interface[0].LinkQualityMult='default 0.3'

Ninux Uci Script HOTSPOT

set -a

/etc/init.d/dnsmasq stop
/etc/init.d/dnsmasq disable

/etc/init.d/firewall stop
/etc/init.d/firewall disable

HOSTNAME="GREG1"
LANIP=192.168.177.200
LANNET=192.168.177.0
LANMASK=255.255.255.0
LANGW=""

CHANNEL="8"
ESSID="www.ninux.org"


sysctl -w kernel.hostname=$HOSTNAME
uci set system.@system[0].hostname=$HOSTNAME

DEVICE=`uci get wireless.@wifi-iface[0].device`
uci delete wireless.$DEVICE.disabled

#disable default bridge on lan
#uci delete network.lan.type

uci set network.lan.proto=static
uci set network.lan.ipaddr=$LANIP
uci set network.lan.netmask=$LANMASK
uci set network.lan.gateway=$LANGW
uci set network.lan.dns=8.8.8.8

uci set network.wan=interface
uci set network.wan.ifname=eth0
uci set network.wan.proto=dhcp

uci set network.vpn=interface
uci set network.vpn.ifname=ninux
uci set network.vpn.proto=none

#TODO: move this config to variables on top of script
uci set network.wlan=interface
uci set network.wlan.proto=static
uci set network.wlan.ipaddr=$WLANIP
uci set network.wlan.netmask=255.255.255.0

uci set wireless.$DEVICE.channel=$CHANNEL
uci set wireless.$DEVICE.disabled=0
#uci set wireless.$DEVICE.txpower=20

uci set wireless.@wifi-iface[0].network=wlan
uci set wireless.@wifi-iface[0].mode=ap
uci set wireless.@wifi-iface[0].ssid=$ESSID
uci set wireless.@wifi-iface[0].encryption=none
uci set wireless.@wifi-iface[0].bgscan=0

rm /etc/config/olsrd
touch /etc/config/olsrd
uci add olsrd olsrd
uci set olsrd.@olsrd[0].IpVersion=4
uci set olsrd.@olsrd[0].DebugLevel=0
uci add olsrd LoadPlugin
uci set olsrd.@LoadPlugin[0]=LoadPlugin
uci set olsrd.@LoadPlugin[0].library=olsrd_txtinfo.so.0.1
uci set olsrd.@LoadPlugin[0].accept="0.0.0.0"
uci add olsrd Interface
uci set olsrd.@Interface[0]=Interface
uci set olsrd.@Interface[0].interface=vpn
uci set olsrd.@Interface[0].LinkQualityMult='default 0.3'

uci add olsrd Hna4
uci set olsrd.@Hna4[-1].netaddr=$LANNET
uci set olsrd.@Hna4[-1].netmask=$LANMASK
uci set olsrd.@LoadPlugin[0]=LoadPlugin
uci set olsrd.@LoadPlugin[0].library=olsrd_mdns.so.1.0.0
uci set olsrd.@LoadPlugin[0].NonOlsrIf=lan


uci commit

[ -x /etc/init.d/olsrd ] && /etc/init.d/olsrd enable