1 #!/bin/sh /etc/rc.common
9 ### Read interface names
10 config_get wanif wan ifname
11 config_get lanif lan ifname
12 config_get ffif ff ifname
15 [ -n "$ffif" ] || return 0
21 config_get_bool internal routing internal
22 [ -n "$wanif" ] && config_get_bool internet routing internal
25 ### Freifunk to Freifunk
26 [ "$internal" -gt 0 ] && {
27 iptables -A forwarding_rule -i "$ffif" -o "$ffif" -j ACCEPT
32 config_get ipaddr lan ipaddr
33 config_get netmask lan netmask
35 eval "$(ipcalc.sh $ipaddr $netmask)"
37 iptables -A forwarding_rule -i "$lanif" -o "$ffif" -j ACCEPT
38 iptables -t nat -A postrouting_rule -s "$NETWORK/$PREFIX" -o "$ffif" -j MASQUERADE
42 [ "$internet" -gt 0 ] && {
43 config_get ipaddr ff ipaddr
44 config_get netmask ff netmask
46 eval "$(ipcalc.sh $ipaddr $netmask)"
48 iptables -A forwarding_rule -i "$ffif" -o "$wanif" -j ACCEPT
49 iptables -t nat -A postrouting_rule -s "$NETWORK/$PREFIX" -o "$wanif" -j MASQUERADE
57 ### Read interface names
58 config_get wanif wan ifname
59 config_get lanif lan ifname
60 config_get ffif ff ifname
62 [ -n "$ffif" ] || return 0
64 ### Freifunk to Freifunk
65 iptables -D forwarding_rule -i "$ffif" -o "$ffif" -j ACCEPT
69 iptables -D forwarding_rule -i "$lanif" -o "$ffif" -j ACCEPT
70 iptables -t nat -D postrouting_rule -i "$lanif" -o "$ffif" -j MASQUERADE
74 [ -n "$wanif" -gt 0 ] && {
75 iptables -D forwarding_rule -i "$ffif" -o "$wanif" -j ACCEPT
76 iptables -t nat -D postrouting_rule -i "$ffif" -o "$wanif" -j MASQUERADE