Commit Graph

25 Commits

Author SHA1 Message Date
Stefan Schantl
96e2e870aa firewall-lib.pl: Remove prefix when dealing with ipset sets.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-03-05 14:32:58 +00:00
Stefan Schantl
07106467b8 rules.pl: Move to ipset based data for location based firewall rules.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-02-15 18:07:13 +00:00
Alexander Marx
feef6aca68 BUG12301: Iptables “host/network ‘none’ not found”
Fixes: #12301

When using hosts with MAC-addresses in a hostgroup,
the rule won't be generated if those hosts are selected as target.
There is a hint but due to a wrong hashparameter the hint was not shown.

With this patch the hint is shown again.
Additionally the rule is skipped when rules.pl creates rules.

There are no bootmessages with failed target "none" anymore.
Acked-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-02-06 17:18:31 +00:00
Stefan Schantl
18c9fd2820 firewall-lib.pl: Fix typo.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-13 19:10:15 +02:00
Stefan Schantl
006e3c6c31 firewall-lib.pl: Rework code to use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 19:21:27 +02:00
Stefan Schantl
dba780a784 firewall-lib.pl: Populate GeoIP rules only if location is available.
In case a GeoIP related firewall rule should be created, the script
now will check if the given location is still available.

Fixes #12054.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-29 13:23:43 +00:00
Arne Fitzenreiter
5653e55107 perl-scripts: suppress smartmatch experimental warning
smartmatch was introduced with perl 5.10 and was marked
as experimental in 5.14

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-08-16 12:21:26 +02:00
Michael Tremer
7ba652af8c firewall: Write correct rules bound to interface for routes IPsec tunnels
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-02-04 18:20:36 +00:00
Michael Tremer
5cf83d56fa firewall-lib.pl: Fix incorrect path to geoip-functions.pl
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-01-13 11:53:41 +01:00
Stefan Schantl
8ff42d82c4 firewall-lib.pl: Use get_geoip_locations from geoip-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-01-10 22:43:00 +00:00
Alexander Marx
8b20ca2de4 BUG11559: firewall-lib
When creating firewallrules or using firewall groups,
it should be possible to select a single IpSec subnet if there is more than one.

This patch has neccessary changes for the firewall-lib. While the network name of the IpSec changes
on save (subnet is added to name) we need to split the name or normalise the field before using it.
Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Tested-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-05-09 14:48:42 +01:00
Michael Tremer
7c8e022c4b firewall: Support multiple subnets per IPsec tunnel
Fixes #10929

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-09-22 00:26:37 +01:00
Alexander Marx
b9ca2fa60f Add support for generating GeoIP-based firewall rules.
This commit adds support to the rules.pl and firewall-lib.pl to generate
correct iptables commands for inserting GeoIP-based firewall rules
into the kernel.
2015-02-17 18:00:52 +01:00
Stefan Schantl
192a8266e2 geoip-block.cgi: Requires firewall-lib.pl. 2015-01-04 14:07:06 +01:00
Stefan Schantl
593c32275a Move "sub get_geoip_locations" to firewall-lib. 2015-01-04 01:03:21 +01:00
Michael Tremer
a21f2f6a76 firewall: Use correct interface for RED 2014-10-07 14:54:12 +02:00
Alexander Marx
48f07c1957 Firewall: make DNAT only accessible from selected source network
We added RED to the standard networks and now portforwardings are only
useable from the selected source. If selected "all" the portforwarding
can be used from any internal network. Else the access is only grnated
from the selected source network.
2014-07-18 08:44:45 +02:00
Michael Tremer
aa5f4b6568 firewall: Fix creation of automatic rules for the firewall.
If the firewall is part of a local network (e.g. GREEN),
we automatically add rules that grant/forbid access for the firewall,
too.

This has been broken for various default policies other than ALLOWED.
2014-04-12 15:16:08 +02:00
Michael Tremer
085a20ec8b firewall: Fix using aliases.
Fix coding errors, actually read aliases configuration
and fall back to default RED IP address if no suitable
alias was found.
2014-04-05 17:09:56 +02:00
Alexander Marx
c71499d8d9 Firewall: Rename defaultNetworks to netsettings 2014-03-21 12:51:18 +01:00
Alexander Marx
fd169d0adc Firewall: DNAT - Show right DNAT interface in ruletable
Now:
When using a hostgroup as source there are all corresponding DNAT
interfaces shown in ruletable depending on the entries in the group.

When in DNAT area "-automatic" is selected, the DNAT interfaces are
shown as IP-Addresses, else they are shown as "ORANGE","GREEN","BLUE"...

BUGFIX: When there is a MAC address used in a sourcegroup, the rules could not be set. Now MAC addresses get allways the public interface as DNAT
2014-03-21 12:51:09 +01:00
Alexander Marx
4e54e3c6f5 Firewall: Move some functions from rules.pl to firewall-lib.pl 2014-03-21 12:51:04 +01:00
Alexander Marx
82b837cff8 Firewall: Added new feature: Now protocols can be added to servicegroups (GRE,AH,ESP,IPIP,IPV6) 2013-12-06 08:47:11 +01:00
Alexander Marx
14bcb9a23d Firewall: New feature: Now it is possible to define a custom service with a portrange. When using this service in a rule or in a servciegroup, the rule is applied correctly. 2013-11-13 00:30:06 +01:00
Alexander Marx
6921f0ea0a Firewall: renamed /config/forwardfw to config/firewall 2013-10-24 08:15:48 +02:00