This repository has been archived by the owner on Sep 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathUCIcommands.txt
144 lines (124 loc) · 4.96 KB
/
UCIcommands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
DHCP client on ethernet - with WLAN network - Sharing Internet (HNA announcement)
Static on ethernet - with WLAN network - Sharing Internet (HNA announcement)
uci delete network.lan.type
uci delete network.lan.force_link
uci set network.lan.proto=dhcp
uci delete network.lan.ipaddr
uci delete network.lan.netmask
uci delete network.lan.ip6assign
uci set network.lan._orig_ifname=eth0
uci set network.lan._orig_bridge=false
uci delete network.wan
uci delete network.wan6
uci commit network
/etc/init.d/network restart
opkg update
opkg install luci luci-ssl pciutils luci-app-olsr luci-app-olsr-services luci-app-olsr-viz olsrd olsrd-mod-arprefresh olsrd-mod-bmf olsrd-mod-dot-draw olsrd-mod-dyn-gw olsrd-mod-dyn-gw-plain olsrd-mod-httpinfo olsrd-mod-mdns olsrd-mod-nameservice olsrd-mod-p2pd olsrd-mod-pgraph olsrd-mod-secure olsrd-mod-txtinfo olsrd-mod-watchdog olsrd-mod-quagga wireless-tools luci-lib-json kmod-ipip ethtool snmpd iptables-mod-extra iptables-mod-iface iptables-mod-iprange
for i in `opkg list-upgradable|cut -d " " -f 1`;do opkg install $i;done
uci set uhttpd.main.rfc1918_filter=0; uci commit uhttpd
echo src/gz pittmesh openwrt.metamesh.org >> /etc/opkg.conf
/etc/init.d/uhttpd restart
/etc/init.d/odhcpd disable
uci set snmpd.public.community=PittmeshSNMP
/etc/init.d/snmpd enable
uci set system.ntp=timeserver
uci set system.ntp.enabled=1
uci set system.ntp.enable_server=1
uci set system.ntp.server=10.66.6.1
uci set system.@system[0].log_ip=10.10.220.225
uci commit system
/etc/init.d/system restart
uci set dhcp.@dnsmasq[0].server=96.89.42.101
uci commit dhcp
/etc/init.d/network restart
#run ip calc script so that variables below can be set
ipMESH=$(./mac2ip.ash $(cat /sys/class/net/eth0/address));
ipWLAN=$(echo "10.$(echo $ipMESH|cut -d "." -f 3-4).1");
ipHNA=$(echo "10.$(echo $ipMESH|cut -d "." -f 3-4).0");
uci set network.mesh=interface
uci set network.mesh.proto=static
uci set network.mesh.ipaddr=`echo $ipMESH`
uci set network.mesh.netmask=255.192.0.0
uci set network.wlan=interface
uci set network.wlan.proto=static
uci set network.wlan.ipaddr=`echo $ipWLAN`
uci set network.wlan.netmask=255.255.255.0
uci commit network
uci add dhcp dhcp
uci set dhcp.@dhcp[2].interface=wlan
uci set dhcp.@dhcp[2].start=10
uci set dhcp.@dhcp[2].limit=253
uci set dhcp.@dhcp[2].leasetime=1h
uci set dhcp.@dhcp[2].force=1
uci commit dhcp
/etc/init.d/dnsmasq restart
/etc/init.d/network restart
uci delete wireless.radio0.disabled
uci set wireless.radio0.txpower=30
uci set wireless.radio0.country=US
uci add wireless wifi-iface
uci set wireless.@wifi-iface[1].device=radio0
uci set wireless.@wifi-iface[1].encryption=none
uci set wireless.@wifi-iface[1].ssid=PittMesh-Backhaul
uci set wireless.@wifi-iface[1].mode=adhoc
uci set wireless.@wifi-iface[1].network=mesh
uci set wireless.@wifi-iface[0].network=wlan
uci set wireless.@wifi-iface[0].ssid=PittMesh-RANDOMSTRING-501
uci set wireless.@wifi-iface[0].disabled=0
uci commit wireless
/etc/init.d/network restart
uci add olsrd Hna4
uci set olsrd.@Hna4[0].netaddr=`echo $ipHNA`
uci set olsrd.@Hna4[0].netmask=255.255.255.0
uci add olsrd Hna4
uci set olsrd.@Hna4[1].netaddr=0.0.0.0
uci set olsrd.@Hna4[1].netmask=0.0.0.0
uci set olsrd.@Interface[0].ignore=0
uci set olsrd.@Interface[0].Mode=mesh
uci set olsrd.@Interface[0].interface='mesh'
uci add olsrd InterfaceDefaults
uci set olsrd.@InterfaceDefaults[0].Mode=mesh
uci add olsrd Interface
uci set olsrd.@Interface[1].ignore=0
uci set olsrd.@Interface[1].interface=lan
uci set olsrd.@Interface[1].Mode=ether
uci set olsrd.@olsrd[0].LinkQualityAlgorithm=etx_ffeth
uci commit olsrd
uci set firewall.@defaults[0].forward=ACCEPT
uci set firewall.@zone[0].masq=1
uci delete firewall.@zone[1]
uci delete firewall.@forwarding[0]
uci add firewall zone
uci set firewall.@zone[1].input=ACCEPT
uci set firewall.@zone[1].forward=ACCEPT
uci set firewall.@zone[1].output=ACCEPT
uci set firewall.@zone[1].name=wlan
uci set firewall.@zone[1].network=wlan
uci add firewall forwarding
uci set firewall.@forwarding[0].dest=wlan
uci set firewall.@forwarding[0].src=lan
uci add firewall zone
uci set firewall.@zone[2].input=ACCEPT
uci set firewall.@zone[2].forward=ACCEPT
uci set firewall.@zone[2].output=ACCEPT
uci set firewall.@zone[2].name=mesh
uci set firewall.@zone[2].network=mesh
uci add firewall forwarding
uci set firewall.@forwarding[1].dest=wlan
uci set firewall.@forwarding[1].src=mesh
uci add firewall forwarding
uci set firewall.@forwarding[2].dest=mesh
uci set firewall.@forwarding[2].src=lan
uci add firewall forwarding
uci set firewall.@forwarding[3].dest=mesh
uci set firewall.@forwarding[3].src=wlan
uci delete firewall.@rule[0]
uci delete firewall.@rule[1]
uci delete firewall.@rule[2]
uci commit firewall
uci delete firewall.@rule[0]
uci delete firewall.@rule[0]
uci commit firewall
echo iptables -I FORWARD -i wlan0-1 -d 192.168.0.0/16 -j DROP >> /etc/firewall.user
echo iptables -I FORWARD -i wlan0-1 -d 10.0.0.0/8 -j DROP >> /etc/firewall.user
echo iptables -I FORWARD -i wlan0-1 -d 172.16.0.0/12 -j DROP >> /etc/firewall.user