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 iptables -A forwarding_rule -i "$lanif" -o "$ffif" -j ACCEPT
33 iptables -t nat -A postrouting_rule -i "$lanif" -o "$ffif" -j MASQUERADE
37 [ "$internet" -gt 0 ] && {
38 iptables -A forwarding_rule -i "$ffif" -o "$wanif" -j ACCEPT
39 iptables -t nat -A postrouting_rule -i "$ffif" -o "$wanif" -j MASQUERADE
47 ### Read interface names
48 config_get wanif wan ifname
49 config_get lanif lan ifname
50 config_get ffif ff ifname
52 [ -n "$ffif" ] || return 0
54 ### Freifunk to Freifunk
55 iptables -D forwarding_rule -i "$ffif" -o "$ffif" -j ACCEPT
59 iptables -D forwarding_rule -i "$lanif" -o "$ffif" -j ACCEPT
60 iptables -t nat -D postrouting_rule -i "$lanif" -o "$ffif" -j MASQUERADE
64 [ -n "$wanif" -gt 0 ] && {
65 iptables -D forwarding_rule -i "$ffif" -o "$wanif" -j ACCEPT
66 iptables -t nat -D postrouting_rule -i "$ffif" -o "$wanif" -j MASQUERADE