4 .
"${IPKG_INSTROOT:-}/usr/lib/opennet/on-helper.sh"
7 configure_tunnel_network() {
8 local uci_prefix=network.on_vpn
10 # Abbruch falls das Netzwerk schon vorhanden ist
11 [ -n
"$(uci_get "$uci_prefix
")" ] &&
return
13 # add new network to configuration (to be recognized by olsrd)
14 uci set
"${uci_prefix}=interface"
15 uci set
"${uci_prefix}.proto=none"
16 uci set
"${uci_prefix}.ifname=tun0"
22 configure_tunnel_firewall() {
24 uci_prefix=$(find_first_uci_section firewall zone
"name=$ZONE_TUNNEL")
26 # Abbruch falls die Zone bereits vorhanden ist
27 [ -n
"$(uci_get "$uci_prefix
")" ] &&
return
29 # Zone fuer ausgehenden Verkehr definieren
30 uci_prefix=firewall.$(uci add firewall zone)
31 uci set
"${uci_prefix}.name=$ZONE_TUNNEL"
32 uci add_list
"${uci_prefix}.network=$NETWORK_TUNNEL"
33 uci set
"${uci_prefix}.forward=REJECT"
34 uci set
"${uci_prefix}.input=REJECT"
35 uci set
"${uci_prefix}.output=ACCEPT"
36 uci set
"${uci_prefix}.masq=1"
38 # Weiterleitung aus dem lokalen Netzwerk heraus erlauben
39 uci_prefix=firewall.$(uci add firewall forwarding)
40 uci set
"${uci_prefix}.src=$ZONE_LOCAL"
41 uci set
"${uci_prefix}.dest=$ZONE_TUNNEL"
43 apply_changes firewall
47 configure_tunnel_network
48 configure_tunnel_firewall