* Added NAT rule for Freifunk DHCP
This commit is contained in:
parent
def5d71924
commit
de13f9f262
2 changed files with 12 additions and 1 deletions
|
@ -10,6 +10,7 @@ start() {
|
||||||
config_get wanif wan ifname
|
config_get wanif wan ifname
|
||||||
config_get lanif lan ifname
|
config_get lanif lan ifname
|
||||||
config_get ffif ff ifname
|
config_get ffif ff ifname
|
||||||
|
config_get ffdif ffdhcp ifname
|
||||||
|
|
||||||
config_get lanip lan ipaddr
|
config_get lanip lan ipaddr
|
||||||
config_get lanmask lan netmask
|
config_get lanmask lan netmask
|
||||||
|
@ -17,6 +18,9 @@ start() {
|
||||||
config_get ffip ff ipaddr
|
config_get ffip ff ipaddr
|
||||||
config_get ffmask ff netmask
|
config_get ffmask ff netmask
|
||||||
|
|
||||||
|
config_get ffdip ffdhcp ipaddr
|
||||||
|
config_get ffdmask ffdhcp netmask
|
||||||
|
|
||||||
[ -n "$ffif" ] || return 0
|
[ -n "$ffif" ] || return 0
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,6 +57,13 @@ start() {
|
||||||
iptables -t nat -A luci_freifunk_postrouting -s "$NETWORK/$PREFIX" -o "$wanif" -j MASQUERADE
|
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
|
### Hook in the chains
|
||||||
iptables -A forwarding_rule -j luci_freifunk_forwarding
|
iptables -A forwarding_rule -j luci_freifunk_forwarding
|
||||||
iptables -t nat -A postrouting_rule -j luci_freifunk_postrouting
|
iptables -t nat -A postrouting_rule -j luci_freifunk_postrouting
|
||||||
|
|
|
@ -6,6 +6,6 @@
|
||||||
<p><a href="<%=controller%>/admin/system/reboot?reboot=1"><%:reboot_do Neustart durchführen%></a></p>
|
<p><a href="<%=controller%>/admin/system/reboot?reboot=1"><%:reboot_do Neustart durchführen%></a></p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p><%:reboot_running Bitte warten: Neustart wird durchgeführt...%></p>
|
<p><%:reboot_running Bitte warten: Neustart wird durchgeführt...%></p>
|
||||||
<script type="text/javascript">setTimeout("location='<%=controller%>/admin'", 45000)</script>
|
<script type="text/javascript">setTimeout("location='<%=controller%>/admin'", 60000)</script>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%+footer%>
|
<%+footer%>
|
Loading…
Reference in a new issue