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() {
23 local uci_prefix=$(find_first_uci_section firewall zone
"name=$ZONE_TUNNEL")
25 # Abbruch falls die Zone bereits vorhanden ist
26 [ -n
"$(uci_get "$uci_prefix
")" ] &&
return
28 # Zone fuer ausgehenden Verkehr definieren
29 uci_prefix=firewall.$(uci add firewall zone)
30 uci
set "${uci_prefix}.name=$ZONE_TUNNEL"
31 uci
set "${uci_prefix}.network=$NETWORK_TUNNEL"
32 uci
set "${uci_prefix}.forward=REJECT"
33 uci
set "${uci_prefix}.input=REJECT"
34 uci
set "${uci_prefix}.output=ACCEPT"
35 uci
set "${uci_prefix}.masq=1"
37 # Weiterleitung aus dem lokalen Netzwerk heraus erlauben
38 uci_prefix=firewall.$(uci add firewall forwarding)
39 uci
set "${uci_prefix}.src=$ZONE_LOCAL"
40 uci
set "${uci_prefix}.dest=$ZONE_TUNNEL"
42 apply_changes firewall
46 configure_tunnel_network
47 configure_tunnel_firewall