diff --git a/ffpb/ffpb-ebtables-net-rules/files/lib/gluon/ebtables/110-ffpb-net-allow-ipv4-space b/ffpb/ffpb-ebtables-net-rules/files/lib/gluon/ebtables/110-ffpb-net-allow-ipv4-space index fdf2e9cace96a7b6291fea87b27c82e81a0cc14e..72c940265bd0c5cd08355744ece608a63827bd62 100644 --- a/ffpb/ffpb-ebtables-net-rules/files/lib/gluon/ebtables/110-ffpb-net-allow-ipv4-space +++ b/ffpb/ffpb-ebtables-net-rules/files/lib/gluon/ebtables/110-ffpb-net-allow-ipv4-space @@ -1,4 +1,7 @@ -rule 'FFPB_NET_ONLY -p IPv4 --ip-protocol udp --ip-destination-port 67 -j RETURN' -rule 'FFPB_NET_ONLY -p IPv4 --ip-src 10.132.0.0/17 -j RETURN' -rule 'FFPB_NET_ONLY -p ARP --arp-ip-src 10.132.0.0/17 --arp-ip-dst 10.132.0.0/17 -j RETURN' -rule 'FFPB_NET_ONLY -p ARP --arp-ip-src 0.0.0.0/0 --arp-ip-dst 10.132.0.0/17 -j RETURN' +siteConfig = require("gluon.site_config") +prefix4 = siteConfig.prefix4 + +rule ('FFPB_NET_ONLY -p IPv4 --ip-protocol udp --ip-destination-port 67 -j RETURN') +rule ('FFPB_NET_ONLY -p IPv4 --ip-src ' .. prefix4 .. ' -j RETURN') +rule ('FFPB_NET_ONLY -p ARP --arp-ip-src ' .. prefix4 .. ' --arp-ip-dst ' .. prefix4 .. ' -j RETURN') +rule ('FFPB_NET_ONLY -p ARP --arp-ip-src 0.0.0.0/0 --arp-ip-dst ' .. prefix4 .. ' -j RETURN') diff --git a/ffpb/ffpb-ebtables-net-rules/files/lib/gluon/ebtables/110-ffpb-net-allow-ipv6-spaces b/ffpb/ffpb-ebtables-net-rules/files/lib/gluon/ebtables/110-ffpb-net-allow-ipv6-spaces index 90a79c9a017d3d825514afababc1b08e2c744f7d..1c3f9ad69484d8c091af24725bdba5c086a03989 100644 --- a/ffpb/ffpb-ebtables-net-rules/files/lib/gluon/ebtables/110-ffpb-net-allow-ipv6-spaces +++ b/ffpb/ffpb-ebtables-net-rules/files/lib/gluon/ebtables/110-ffpb-net-allow-ipv6-spaces @@ -1,5 +1,19 @@ -rule 'FFPB_NET_ONLY -p IPv6 --ip6-src fe80::/10 -j RETURN' -rule 'FFPB_NET_ONLY -p IPv6 --ip6-dst ff00::/8 -j RETURN' -rule 'FFPB_NET_ONLY -p IPv6 --ip6-src fdca:ffee:ff12:132::/64 -j RETURN' -rule 'FFPB_NET_ONLY -p IPv6 --ip6-src 2001:470:6d:860::/64 -j RETURN' -rule 'FFPB_NET_ONLY -p IPv6 --ip6-src 2a03:2260:113::/48 -j RETURN' +siteConfig = require("gluon.site_config") + +-- iterate through lists +function list_iter (_table) + local i = 0 + local n = table.getn(_table) + return function () + i = i + 1 + if i <= n then return _table[i] end + end +end + +rule ('FFPB_NET_ONLY -p IPv6 --ip6-src fe80::/10 -j RETURN') +rule ('FFPB_NET_ONLY -p IPv6 --ip6-dst ff00::/8 -j RETURN') +rule ('FFPB_NET_ONLY -p IPv6 --ip6-src ' .. siteConfig.prefix6 .. ' -j RETURN') + +for prefix in list_iter(siteConfig.additional_prefix6) do + rule ('FFPB_NET_ONLY -p IPv6 --ip6-src ' .. prefix .. ' -j RETURN') +end