Koozali.org: home of the SME Server

iptables question

Offline smeghead

  • *
  • 563
  • +0/-0
iptables question
« on: February 28, 2013, 12:55:49 PM »
Hi all

I want to use a script to add some rules to iptables, that bit is fine, but how best to refresh this rule list (a downloaded list that is updated daily).

At the moment I can just reboot the server post the download & the fresh rule set gets loaded, but that seems a bit crude; I'm thinking there may be a way using one of the other SME event/actions to force a flush & reload of the standard rule set so that I can then append my rule set once the routine is done .. but what event/action or other/better option can be used?

Ideas?

TIA

Graeme
..................

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: iptables question
« Reply #1 on: February 28, 2013, 02:07:38 PM »
signal-event remoteaccess-update should do the trick

Offline piran

  • *****
  • 502
  • +0/-0
Re: iptables question
« Reply #2 on: February 28, 2013, 03:30:25 PM »
to add some rules to iptables, that bit is fine, but how best to refresh this rule list (a downloaded list that is updated daily).

...Ideas?


Consider using SME's existing template functionality with your scripts.
Then just expand the template...
/sbin/e-smith/expand-template /etc/rc.d/init.d/masq

After that template update restart masquerading...
service masq restart

Offline smeghead

  • *
  • 563
  • +0/-0
Re: iptables question
« Reply #3 on: February 28, 2013, 05:39:51 PM »
Thanks all. that was enough of a nudge in the right direction for me to find exactly what i need.

I've also added some squid stuff into my extension so a perfect match for me is the proxy-update event which deals exclusively with both iptables (masq) & squid.

I'll write up my efforts for everyones benefit once tested.
..................