I would like to add a host to the firewall objects. However, the host has only a dynamic IP address. It is accessible by a ddns account, i.e. it has a (sub)domain which is accessible from the internet (for example test.mooo.com - I know that this url doesn’t exist. it is only an example).
The problem is that I can only enter an IP address to define a host as a firewall object and not a domain name.
Is there any other possibility for that? or a workaround via the configuration files?
The problem with trying to use a domain name in any firewall is that it’s IP would only be looked up as the firewall is loaded. If it subsequently changes then the firewall would not see that change.
A possible way around this would be a script, running via cron, or similar, which verifies the IP and if it changes updates one of the Shorewall files in the template system and signals firewall-adjust.
however, I have no experience with scripts running via cron… Would it be too much effort for you to write such a script for me? Of course I could adjust it…
Initially I was going to ask what the difference is between “signal-event-objects-modify firewall” and “signal-event firewall-adjust”, but after a little research, my question now becomes:
What is “signal-event-objects-modify” as there is no script/executable with that name.
What I was referring to was the last post from @enzoturri where he says the command is: “signal-event-objects-modify firewall”.
I didn’t notice previously, but it looks like he correctly updated his first post: “signal-event firewall-objects-modify”.
So maybe now I ask the original question that sprung to mind: What’s the difference between the events: “firewall-objects-modify” and “firewall-adjust”, as the doc here uses “firewall-adjust”.
I have added a if condition that checks whether the IP of the host has changed at all.
Here is my code:myhostip=$(dig +short test.mooo.com) old=$(db hosts getprop myhost IpAddress) if [ "$old" != "$myhostip" ] then db hosts setprop myhost IpAddress $myhostip signal-event firewall-objects-modify fi