2 # Setup static interface settings for wan if wan is not an olsr interface
4 [ ! "$(uci -q get network.wan)" == "interface" ] && exit
10 set network.wan.proto='$wan_proto'
11 set network.wan.ipaddr='$wan_ip4addr'
12 set network.wan.netmask='$wan_netmask'
13 set network.wan.gateway='$wan_gateway'
14 set network.wan.dns='$wan_dns'
17 uci_commitverbose "Setup static ip settings for wan" network
19 uci delete meshwizard.wan && uci commit meshwizard
21 # Firewall rules to allow incoming ssh and web
23 if [ "$wan_allowssh" == 1 ]; then
25 set firewall.wanssh=rule
26 set firewall.wanssh.src=wan
27 set firewall.wanssh.target=ACCEPT
28 set firewall.wanssh.proto=tcp
29 set firewall.wanssh.dest_port=22
31 uci_commitverbose "Allow incoming connections to port 22 (ssh) on wan" firewall
34 if [ "$wan_allowweb" == 1 ]; then
36 set firewall.wanweb=rule
37 set firewall.wanweb.src=wan
38 set firewall.wanweb.target=ACCEPT
39 set firewall.wanweb.proto=tcp
40 set firewall.wanweb.dest_port=80
41 set firewall.wanwebhttps=rule
42 set firewall.wanwebhttps.src=wan
43 set firewall.wanwebhttps.target=ACCEPT
44 set firewall.wanwebhttps.proto=tcp
45 set firewall.wanwebhttps.dest_port=443
47 uci_commitverbose "Allow incoming connections to port 80 and 443 (http and https) on wan" firewall