# Firewall program at boottime

## craftyc

I would like to start a firewall program at boottime. Can someone help me write a script for this. It is the first time I am writing an init-script.  :Embarassed: 

Thanks in advance.

----------

## Rylan

Check the Gentoo security guide

http://www.gentoo.org/doc/en/gentoo-security.xml

Down towards the bottom is a decent rc.firewall script that you can edit to your personal needs.

----------

## craftyc

All I need to do is start a program, which inturn will start iptables. Here is what I need to do.

I have a program located at /usr/local/bin/endoshield. I want to write a script that would initiate this progam, which will start iptables at boottime.

Any ideas?

----------

## tebers

There is an updated ebuild  with iptables now, which installs as well an init-script .

Read the remark at the end of the emerge for more details.

Thorsten

----------

## lamer

 *tebers wrote:*   

> There is an updated ebuild  with iptables now, which installs as well an init-script .
> 
> Read the remark at the end of the emerge for more details.
> 
> Thorsten

 

Woah! You're fast! I just committed that today   :Smile:   Be sure to send me a mail if it doesn't work for you. I'm looking at other stuff to add like endoshield, ferm and what not as well.

----------

## craftyc

Thanks for the info. I'm emergeing now.

Anyway I have created a very very simple script. This is what it looks like:

```
#!/sbin/runscript

depend() {

    after *

}

start() {

    ebegin "Starting endoshield"

    /sbin/endoshield

    eend $? "Failed to start endoshield"

}

```

I get an error at boottime about permission being denied to do something to the file /mnt/.init.d/softscripts/firewall. Any ideas?

----------

## craftyc

After emerging the latest iptables I have found it does the main job that I wanted it to do ... Stop port scanners. So for now I am happy, until I learn a little more about firewalling in Linux.

----------

