Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firewall: Settings: Advanced - 'Aliases Resolve Interval' not working #2162

Closed
petererdos opened this issue Feb 3, 2018 · 17 comments
Closed
Assignees
Labels
bug Production bug

Comments

@petererdos
Copy link

At least for host(s), the GUI feature is not triggering the resolver for any given values (for example, 60). A cron job is needed for FQDNs to be resolved (as a workaround).

OPNsense 18.1.1-amd64
FreeBSD 11.1-RELEASE-p6
LibreSSL 2.6.4

@AdSchellevis
Copy link
Member

It should be in the crontab by default, can you grep the following:

cat /var/cron/tabs/root | grep update_tables.py

it should contain:
10 * * * * (/usr/local/opnsense/scripts/filter/update_tables.py) > /dev/null

@fichtner fichtner added the support Community support label Feb 6, 2018
@petererdos
Copy link
Author

It does, but whatever the value I enter in the GUI, it will always execute every 10 minutes, it does not reflect my preference:

10 * * * * (/usr/local/opnsense/scripts/filter/update_tables.py) > /dev/null

@AdSchellevis
Copy link
Member

that's correct, the alias update invalidates content after the specified amount of time, so it can run safely every 10 minutes.

@fichtner
Copy link
Member

fichtner commented Feb 7, 2018

Er... 10 means every hour at 10 minutes, not every ten minutes... should it be */10 then?

@AdSchellevis
Copy link
Member

oops, missed that, every hour could indeed be a bit to long... (worst case an hour interval could update every 2 hours ;) ).

@petererdos
Copy link
Author

It's not just that, in the GUI, the custom value is described in the "help text" as being seconds, not hours :) Another reason why I reported this. So also a spelling error :)

@petererdos
Copy link
Author

petererdos commented Feb 7, 2018

To really use "every x minutes" instead of hours brings much more value for this GUI feature, at least for me :)

@AdSchellevis
Copy link
Member

Where are the seconds? It should be hours, the table heading contains:
image

Usually it's not a very good idea to fetch content very often, for specific cases it might be different, maybe we could support fractions of hours (e.g. 0.25, 0.1). What's your use-case for this?

@petererdos
Copy link
Author

screenshot_5

Use case:

  • (phone & laptop) dynamic hostname resolution via aliases
  • i'm using mobile data often when i'm on the road, and the service provider changes ips frequently
  • i'm using aliases in my firewall rules to permit connections only from those aliases, to allow access to certain services in my lan (port forwards mostly)

@AdSchellevis
Copy link
Member

Ah, different feature, it looks like we missed something here, I'll try to fix this before the next release.

@AdSchellevis AdSchellevis self-assigned this Feb 7, 2018
@AdSchellevis AdSchellevis added bug Production bug and removed support Community support labels Feb 7, 2018
@fichtner
Copy link
Member

fichtner commented Feb 7, 2018

well it's too late for 18.1.2 so no rush ;)

@petererdos
Copy link
Author

Thank you both :)

AdSchellevis added a commit that referenced this issue Feb 8, 2018
…gn update to configd call. for #2162

This was a bit forgotten, since the new alias update handles all types of aliases using different expiry intervals, we need to make sure we actually probe our changes in time, otherwise it's impossible to expire dns entries within a reasonable timeframe.
@AdSchellevis
Copy link
Member

@petererdos this c5555b2 should fix the culprit.

You can install the fix using:

opnsense-patch c5555b2

Then make sure you save your settings again in Firewall -> Settings -> Advanced to make sure the cron file is rewritten (or reboot).

@petererdos
Copy link
Author

petererdos commented Feb 9, 2018

Yep, it's working every one minute!

But, if I change the value '60' (coresponding to 60 seconds) to 120 (so basically 2 minutes) from Firewall -> Settings -> Advanced, this doesn't change (I will try later if it actually works):

* * * * * (/usr/local/bin/flock -n -E 0 -o /tmp/filter_update_tables.lock /usr/local/opnsense/scripts/filter/update_tables.py) > /dev/null

It will remain like this no matter the value entered in the GUI. I think, if 120 is entered, it should change to:
*/2 * * * * (/usr/local/bin/flock -n -E 0 -o /tmp/filter_update_tables.lock /usr/local/opnsense/scripts/filter/update_tables.py) > /dev/null

Unless it's saved/executed from somewhere else :)

@AdSchellevis
Copy link
Member

@petererdos the cron job shouldn't change the alias update handles the different timeouts

@petererdos
Copy link
Author

Ok, I guess it's fixed then :)
Please take over and consider closing the bug. Thank you!

@AdSchellevis
Copy link
Member

thanks for confirming

fichtner pushed a commit that referenced this issue Feb 12, 2018
…gn update to configd call. for #2162

This was a bit forgotten, since the new alias update handles all types of aliases using different expiry intervals, we need to make sure we actually probe our changes in time, otherwise it's impossible to expire dns entries within a reasonable timeframe.

(cherry picked from commit c5555b2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Production bug
Development

No branches or pull requests

3 participants