Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: How to start IPTABLES script automatically on boot.

  1. #11
    Join Date
    Apr 2008
    Location
    Germany - Berlin
    Beans
    340

    Re: How to start IPTABLES script automatically on boot.

    I am sorry, it was a typo error, i have S24HAL and S24dhcdbd?
    Yet, it didn't work, my script did execute?
    Yes you can have different scripts with the same number, its just an order on boot the lowest numbers are executed first and if multiple same bumbers exists I guess they execute in alphabetical order, anyway it should execute.
    Make sure your script is executable 'chmod 755 /etc/init.d/iptables' and the first line in your script is '#!/bin/bash'
    You can check /var/log/messages to see if there are maybe errors regarding your script.

    Is there anyway to run the scripts in the RC directories without rebooting.
    You can switch between runlevels with the help of the 'init' command. To make sure switch to runlevel 1 'init 1' and then back to 3-5 'init 3', 'init 4' or 'init 5'

  2. #12
    Join Date
    May 2008
    Beans
    263

    Re: How to start IPTABLES script automatically on boot.

    ok. I have changed the permissions of the file and created links as required. and the first line in the script is #!/bin/bash

    Let me check the /var/log/messages and get back to you.



    Quote Originally Posted by Gunman1982 View Post
    Yes you can have different scripts with the same number, its just an order on boot the lowest numbers are executed first and if multiple same bumbers exists I guess they execute in alphabetical order, anyway it should execute.
    Make sure your script is executable 'chmod 755 /etc/init.d/iptables' and the first line in your script is '#!/bin/bash'
    You can check /var/log/messages to see if there are maybe errors regarding your script.



    You can switch between runlevels with the help of the 'init' command. To make sure switch to runlevel 1 'init 1' and then back to 3-5 'init 3', 'init 4' or 'init 5'

  3. #13
    Join Date
    Mar 2007
    Location
    Denver, CO
    Beans
    7,958
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: How to start IPTABLES script automatically on boot.

    If if you want to add run level scripts -- with debian the proper way to do it is with the update-rc.d executable. I would recommend this way rather than creating a bunch of symbolic links and such. It takes care of adding to the appropriate run levels and supplies the links.

    Here are some examples:
    http://www.debuntu.org/how-to-manage...th-update-rc.d

  4. #14
    Join Date
    May 2008
    Beans
    263

    Cool Re: How to start IPTABLES script automatically on boot.

    This is good information. I will try this today and get back to you.

    Thanks


    Quote Originally Posted by kevdog View Post
    If if you want to add run level scripts -- with debian the proper way to do it is with the update-rc.d executable. I would recommend this way rather than creating a bunch of symbolic links and such. It takes care of adding to the appropriate run levels and supplies the links.

    Here are some examples:
    http://www.debuntu.org/how-to-manage...th-update-rc.d

  5. #15
    Join Date
    Jul 2008
    Location
    $HOME
    Beans
    177
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to start IPTABLES script automatically on boot.

    Code:
    update-rc.d <name of script> defaults
    this will make links as per below:

    HTML Code:
    root@alice:/root# update-rc.d firewall.sh defaults
    update-rc.d: warning: /etc/init.d/firewall.sh missing LSB style header
     Adding system startup for /etc/init.d/firewall.sh ...
       /etc/rc0.d/K20firewall.sh -> ../init.d/firewall.sh
       /etc/rc1.d/K20firewall.sh -> ../init.d/firewall.sh
       /etc/rc6.d/K20firewall.sh -> ../init.d/firewall.sh
       /etc/rc2.d/S20firewall.sh -> ../init.d/firewall.sh
       /etc/rc3.d/S20firewall.sh -> ../init.d/firewall.sh
       /etc/rc4.d/S20firewall.sh -> ../init.d/firewall.sh
       /etc/rc5.d/S20firewall.sh -> ../init.d/firewall.sh
    Ubuntu 8.04/Dell Inspiron 700m Intel Celeron D 1.67Ghz 756MB G.Skill/60GB HDD
    Ubuntu 8.10 Intrepid AMD64bit SE/Custom XFX mobo/AMD Phenom X3 2.1Ghz/4GB G.Skill DDR2 800Mhz/1840GB HDD(4)

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •