LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ip-pre-up.d (https://www.linuxquestions.org/questions/linux-newbie-8/ip-pre-up-d-930500/)

KatrinAlec 02-21-2012 08:54 AM

ip-pre-up.d
 
I've written a script to set up a firewall before the interfaces come up.

The script is saved as
/etc/network/if-pre-up.d/00-firewall

I've added a line with logger, just to see when it is executed
and now that line is repeated 4 times.

I guess it might be because I've got 4 ip interfaces.

how can I prevent that?

zhjim 02-22-2012 02:15 AM

Pretending that you are using a debian system check the man page of interfaces and see if the mapping rule can help you to only run your firewall script ones. Or edit your script in /etc/network/if-pre-up.d and insert a check for the devices and only run the script if the device fits.

KatrinAlec 02-22-2012 02:41 AM

man interfaces did help, thanks

sometimes I just don't try all the man pages because I don't believe there would be an entry for stuff.
I tried man network and man if-pre-up without any luck.

I think I'll be able to do something with the variables mentioned in interfaces.

zhjim 02-22-2012 05:25 AM

Sometime one does not see the woods for the trees. If you hitting any dead spots or having more question just post and I'll see what I can do.

KatrinAlec 02-22-2012 05:38 AM

Thanks for that offer. I might take you up on it.


All times are GMT -5. The time now is 12:17 AM.