From de13f9f262da3da7bee2c48dad8be23d09528a9f Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 28 Apr 2008 08:16:07 +0000 Subject: [PATCH] * Added NAT rule for Freifunk DHCP --- module/admin-core/contrib/init.d/luci_freifunk | 11 +++++++++++ module/admin-core/src/view/admin_system/reboot.htm | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/module/admin-core/contrib/init.d/luci_freifunk b/module/admin-core/contrib/init.d/luci_freifunk index 663112389..d3c23e54d 100644 --- a/module/admin-core/contrib/init.d/luci_freifunk +++ b/module/admin-core/contrib/init.d/luci_freifunk @@ -10,6 +10,7 @@ start() { config_get wanif wan ifname config_get lanif lan ifname config_get ffif ff ifname + config_get ffdif ffdhcp ifname config_get lanip lan ipaddr config_get lanmask lan netmask @@ -17,6 +18,9 @@ start() { config_get ffip ff ipaddr config_get ffmask ff netmask + config_get ffdip ffdhcp ipaddr + config_get ffdmask ffdhcp netmask + [ -n "$ffif" ] || return 0 @@ -53,6 +57,13 @@ start() { iptables -t nat -A luci_freifunk_postrouting -s "$NETWORK/$PREFIX" -o "$wanif" -j MASQUERADE } + ### Freifunk DHCP to Wan + [ "$internet" -gt 0 -a -n "$ffdif" ] && { + eval "$(ipcalc.sh $ffdip $ffdmask)" + + iptables -t nat -A luci_freifunk_postrouting -s "$NETWORK/$PREFIX" -o "$wanif" -j MASQUERADE + } + ### Hook in the chains iptables -A forwarding_rule -j luci_freifunk_forwarding iptables -t nat -A postrouting_rule -j luci_freifunk_postrouting diff --git a/module/admin-core/src/view/admin_system/reboot.htm b/module/admin-core/src/view/admin_system/reboot.htm index b6c38b75c..e81be408c 100644 --- a/module/admin-core/src/view/admin_system/reboot.htm +++ b/module/admin-core/src/view/admin_system/reboot.htm @@ -6,6 +6,6 @@

<%:reboot_do Neustart durchführen%>

<% else %>

<%:reboot_running Bitte warten: Neustart wird durchgeführt...%>

- + <% end %> <%+footer%> \ No newline at end of file -- 2.25.1