diff options
author | Steven Barth <steven@midlink.org> | 2008-04-28 07:15:16 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-04-28 07:15:16 +0000 |
commit | 5266a8c01c29bd371afa32dbb1354e0ea3e76045 (patch) | |
tree | 7dbc391bf09c9804325683ce6f2a3aca5fd5fb52 /module | |
parent | beea3eae0f63a4ffa50a38a92273db43df46432d (diff) |
* Corrected Freifunk NAT rules
Diffstat (limited to 'module')
-rw-r--r-- | module/admin-core/contrib/init.d/luci_freifunk | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/module/admin-core/contrib/init.d/luci_freifunk b/module/admin-core/contrib/init.d/luci_freifunk index dbb346f0eb..6b18e14425 100644 --- a/module/admin-core/contrib/init.d/luci_freifunk +++ b/module/admin-core/contrib/init.d/luci_freifunk @@ -29,14 +29,24 @@ start() { ### Lan to Freifunk [ -n "$lanif" ] && { + config_get ipaddr lan ipaddr + config_get netmask lan netmask + + eval "$(ipcalc.sh $ipaddr $netmask)" + iptables -A forwarding_rule -i "$lanif" -o "$ffif" -j ACCEPT - iptables -t nat -A postrouting_rule -i "$lanif" -o "$ffif" -j MASQUERADE + iptables -t nat -A postrouting_rule -s "$NETWORK/$PREFIX" -o "$ffif" -j MASQUERADE } ### Freifunk to Wan [ "$internet" -gt 0 ] && { + config_get ipaddr ff ipaddr + config_get netmask ff netmask + + eval "$(ipcalc.sh $ipaddr $netmask)" + iptables -A forwarding_rule -i "$ffif" -o "$wanif" -j ACCEPT - iptables -t nat -A postrouting_rule -i "$ffif" -o "$wanif" -j MASQUERADE + iptables -t nat -A postrouting_rule -s "$NETWORK/$PREFIX" -o "$wanif" -j MASQUERADE } } |