Save Iptables Rules and Load on Boot?

Discussion in 'Security' started by mneylon, Sep 7, 2010.

Tags:
  1. mneylon

    mneylon Administrator Staff Member

    I've a few rules in iptables that I need to set on boot eg. blocking certain IP ranges entirely

    What's the sanest way of doing this? (Servers are running Debian or Ubuntu)
     
  2. BobG

    BobG New Member

  3. mneylon

    mneylon Administrator Staff Member

    Thanks Bob - I've got a load of sysadmins that do this stuff for company servers, but getting them to do stuff for my personal ones can be hard at times :)
     
  4. ralph

    ralph New Member

    I would convert the rules to iptables commands, test them, and put it at the end of the file "/etc/rc.d/rc.local" (on RedHatish distros) or "/etc/rc.local" (in Debianish ones).
    Then they will be executed following a reboot after everything else is being set up, so they will stick.
     

Share This Page