Results 1 to 7 of 7

Thread: iptables not loading

  1. #1
    Join Date
    Mar 2007
    Beans
    786

    iptables not loading

    I've written a nice iptables script and put it in /etc/network/if-pre-up.d and /etc/network/if-up.d but it doesn't load the script on reboot. I figured on reboot the interfaces would come up and it loads the script. What is wrong with this reasoning? And what is the solution for loading iptables on boot up?
    Registered Linux User: 450747 Registered Ubuntu User: 16269

  2. #2
    Join Date
    Feb 2010
    Beans
    69
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: iptables not loading

    I know this is probably a stupid idea but why are you trying to put iptables firewall to interface up/down scripts? Why dont you just place your scripts in /etc/init.d and configure them with update-rc.d ? That is where you usually place your firewall scripts.. They will definitelly be run after boot if you configure them with update-rc.d ....

  3. #3
    Join Date
    Mar 2007
    Beans
    786

    Re: iptables not loading

    Quote Originally Posted by koszta View Post
    I know this is probably a stupid idea but why are you trying to put iptables firewall to interface up/down scripts? Why dont you just place your scripts in /etc/init.d and configure them with update-rc.d ? That is where you usually place your firewall scripts.. They will definitelly be run after boot if you configure them with update-rc.d ....

    see solution 2

    This is how I want to do it. But it isn't working and IDK why.
    Registered Linux User: 450747 Registered Ubuntu User: 16269

  4. #4
    Join Date
    Feb 2010
    Location
    Silicon Valley
    Beans
    1,898
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: iptables not loading

    What is in your /etc/network/interfaces file for the interface you're interested in?

    What filename does your script have? The filename must be of a certain format or else it is ignored; see run-parts( 8 ) man page.

  5. #5
    Join Date
    Mar 2007
    Beans
    786

    Re: iptables not loading

    Code:
    ant2ne@rampart:/etc/network/if-pre-up.d$ ls -l
    total 4
    lrwxrwxrwx 1 root root   25 2011-03-02 09:05 hostapd -> ../../hostapd/ifupdown.sh
    lrwxrwxrwx 1 root root   16 2011-03-07 10:08 iptables.sc -> /bin/iptables.sc
    -rwxr-xr-x 1 root root 3839 2009-12-18 09:15 wireless-tools
    lrwxrwxrwx 1 root root   32 2011-03-01 19:41 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh
    iptables.sc is the script. What should it be named?
    Registered Linux User: 450747 Registered Ubuntu User: 16269

  6. #6
    Join Date
    Feb 2010
    Location
    Silicon Valley
    Beans
    1,898
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: iptables not loading

    Try iptables-sc. (Look at all the other files in /etc/network/if-*.d/. None of them use dots or underscores.)

  7. #7
    Join Date
    Mar 2007
    Beans
    786

    Re: iptables not loading

    i will try that and test it out this weekend. thanks
    Registered Linux User: 450747 Registered Ubuntu User: 16269

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
  •