Firewall_Dynamic addon

Hi again.

The addon has already been created to resolve Dynamic DNS IP addresses so they can be used by the Firewall.

Once configured, under “Firewall” → “Firewall Groups” → “Host”, the new entries will appear so they can be used in the Firewall to create rules.

To install:

  1. Decompress zip file
    firewall_dyn.ipfire.tgz.zip (10,4 KB)

  2. Copy file “firewall_dyn.ipfire.tgz” to /opt/pakfire/tmp.

  3. Unpak with:

tar xvf firewall_dyn.ipfire.tgz

To install:

./install.sh

To uninstall:

./uninstall.sh

  1. You’ll see the menu inside “IPFire”.

Any incident reports you may have will be appreciated.

Bye.

2 Likes

Hi Guys.

Aside from aesthetic and functional improvements (hosts can now be enabled/disabled), there was an issue where, no matter how many times we updated the data, if the IPFire firewall wasn’t restarted, it wouldn’t recognize the change and wouldn’t function properly.

A soft restart was performed with the command:

/usr/local/bin/firewallctrl

:white_check_mark: Faster than a full restart

:white_check_mark: No interruptions to established connections

:white_check_mark: Official IPFire method for reloading rules (I think)

firewall_dyn.ipfire.tgz.zip (11,5 KB)

This ist the last version.

It would be very interesting if someone could test it to see if there are any errors.

Bye.

1 Like

A first look at the source show 2 (little?) problems

  • the check for valid IP isn’t complete
    general_functions.pl ( the method used throughout IPFire ) reads
 sub validip
 {
	my $ip = $_[0];

	if (!($ip =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/)) {
		return 0; 
    } else {
		my @octets = ($1, $2, $3, $4);
		foreach $_ (@octets) {
			if (/^0./) { return 0; }
			if ($_ < 0 || $_ > 255) { return 0; }
		}
		return 1;
	}
 }
  • the lookup function catches the last ‘Address:’ line of nslookup only. this may be not the requested information.
    example:
    nslookup heise.de yields the following address lines
    Address:        127.0.0.1#53
    Address: 193.99.144.80
    Address: 2a02:2e0:3fe:1001:302::
    
    (the first is the server address)

A little description of the purpose and configuration would be nice, also. :wink:
What is the ‘DNS servers’ entry for, f.e.?

Good morning @bbitsch .

I think I’ve improved with what you’ve told me, and now it’s perfect. I’ve also added some cosmetic improvements.

firewall_dyn.ipfire.tgz.zip (13,7 KB)

Thanks for trying it.

See you later.

3 Likes