On Demand Iptable update & DNS refresh

Kia Ora,

I was not sure if this goes here or in Development...

I currently run an iptables cmd just after boot, in the space provided by the GUI on 18.06. This works fine however if there are any updates to the routing I have to reboot the router to update the iptables and refresh the DNS.

What I would like to do is have a cmd/script that I can update iptables & refresh DNS without having to reboot the router - ideally from my non-rooted Android phone.

Any help would be appreciated.



PS.. I am a novice so please type clearly and slowly. Ta.

"hotplug" events are likely what you want to use to catch changes. See, for example, https://openwrt.org/docs/guide-user/base-system/hotplug_lede

Cheers, Jeff.
That looks the ticket. I'll post back on my progress.

Glad you got it working...but to troubleshoot for others in the future - in which space on the GUI did you place it?

  • Firewall Custom Commands
  • Scheduled tasks
  • or Startup

(Make sure you were using Firewall Custom Commands section.)

I was not initially using Network > Firewall > Custom Rules - did not know this was there (amateur!). I had put my command in the System > Start-Up, Local Startup section; which was working fine except it required a reboot to update the iptables.

By moving he command to the custom firewall section, I see I can just restart the firewall to update the iptables, however does that stop all traffic while the firewall restarts? Or am I exposed somehow?



Firewall is flushed and reloaded. Since the firewall is flushed, there are no rules, therefore no exposure.

Per the Community Guidelines, there's no need to sign posts.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.