Find the answer to your Linux question:
Results 1 to 3 of 3
I am trying to follow the info on Getting IPTables to survive a reboot eveything works untill I reboot but the script does not run when linux starts. The article ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2003
    Posts
    36

    using a script at startup


    I am trying to follow the info on Getting IPTables to survive a reboot

    eveything works untill I reboot but the script does not run when linux starts.
    The article says to create a script so ifupdown loads these rules on boot:
    Code:
    echo "#!/bin/sh" > /etc/network/if-up.d/iptables 
    echo "iptables-restore < /etc/firewall.conf" >> /etc/network/if-up.d/iptables 
    chmod +x /etc/network/if-up.d/iptables
    it put what I think is a symlink in if-upd but iptables still does not survive reboot.
    What am I doing wrong.

  2. #2
    RDU
    RDU is offline
    Just Joined!
    Join Date
    Aug 2010
    Posts
    89
    An easy way is to put your iptables cmd in a bash scripts, let say in /usr/local/bin or whatever, make it executable (chmod +x) and just call it in /etc/rc.local
    This will run your ruleset in the boot process, just after services (network, ...) will be started.

  3. #3
    Just Joined!
    Join Date
    Sep 2003
    Posts
    36
    Quote Originally Posted by RDU View Post
    An easy way is to put your iptables cmd in a bash scripts, let say in /usr/local/bin or whatever, make it executable (chmod +x) and just call it in /etc/rc.local
    This will run your ruleset in the boot process, just after services (network, ...) will be started.
    Code:
     pre-up iptables-restore < /etc/firewall.conf
    stuck that in interfaces. seems to work.

  4. $spacer_open
    $spacer_close

Posting Permissions

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