- [ "$LIMIT_UP" -gt 0 -a "$LIMIT_DOWN" -gt 0 ] && {
- iptables -t mangle -N luci_splash_mark_out
- iptables -t mangle -N luci_splash_mark_in
- iptables -t mangle -I PREROUTING -j luci_splash_mark_out
- iptables -t mangle -I POSTROUTING -j luci_splash_mark_in
- }
+ $IPT -t mangle -N luci_splash_mark_out
+ $IPT -t mangle -N luci_splash_mark_in
+ $IPT -t mangle -I PREROUTING -j luci_splash_mark_out
+ $IPT -t mangle -I POSTROUTING -j luci_splash_mark_in
+
+ if [ "$HAS_IPV6" = 1 ]; then
+ $IPT6 -t mangle -N luci_splash_mark_out
+ $IPT6 -t mangle -N luci_splash_mark_in
+ $IPT6 -t mangle -I PREROUTING -j luci_splash_mark_out
+ $IPT6 -t mangle -I POSTROUTING -j luci_splash_mark_in
+ fi
+
+ ### Build the main and portal rule
+ config_foreach iface_add iface
+ config_foreach subnet_add subnet