How do I prevent iptables from loading on boot?

2,509

Solution 1

If that can help, for those which blacklist.conf doesn't work, you can easily disable a module this way:

Add this line to your favorite contrab user

@reboot sudo rmmod iptable_nat

Solution 2

If You are determined to get clear of iptables:

sudo modprobe -r ip6_tables iptable_filter ip_tables

could do the trick for you...

Of course, If You're satisfied with result it could be made permanent...

Solution 3

Flushing iptables rules / accept everything

You may skip this step since you mentioned in your question that you have flushed all the rules.

iptables -X &&
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

After flushing your iptables rules.

Run:

  • iptables-save > save-file

  • iptables-apply save-file

Share:
2,509

Related videos on Youtube

MRVDOG
Author by

MRVDOG

Updated on September 18, 2022

Comments

  • MRVDOG
    MRVDOG over 1 year

    I am trying to take a screenshot in minecraft (binded to F2), convert it to base64, then send it to my website, but none of my screenshots are returning an image, but the dimensions are there, here is an example http://minebook.co.uk/screenshot/48462846

    Rectangle screenRectangle = new Rectangle(width, height);
    Robot robot = new Robot();
    BufferedImage image = robot.createScreenCapture(screenRectangle);
    
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    OutputStream b64 = new Base64.OutputStream(os);
    if( ImageIO.write(image, "png", b64) ) {
        String base64String = os.toString("UTF-8");
    
        // Send screenshot Base 64 to website
        String postData = "account=" + ModLoader.getMinecraftInstance().thePlayer.username + "&screenshot=" + base64String;
        URL url = new URL("http://minebook.co.uk/ingame/screenshot");
        URLConnection conn = url.openConnection();
        conn.setDoOutput(true);
        OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
    
        //write parameters
        writer.write(postData);
        writer.flush();
    
        // Get the response
        StringBuffer answer = new StringBuffer();
        BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String line;
        while ((line = reader.readLine()) != null) {
            answer.append(line);
        }
        writer.close();
        reader.close();
        ModLoader.getMinecraftInstance().thePlayer.sendChatToPlayer(answer.toString());
    }
    

    Any assistance will be greatly appreciated, and if you require more information let me know

    Vinny

    • Michael
      Michael over 11 years
      I've looked at the image. Its properties state that the size of the image is 0px x 0px and scaled to 800px x 450px.
    • MRVDOG
      MRVDOG over 11 years
      hmm, so that means that the AWT Robot isn't doing anything, because when I take the screenshot, the game is at 800px x 450px, it also explains why the base64 data is so short... I may have to see about trying to implement minecraft's screenshot methods
    • Michael
      Michael over 11 years
      The Robot should work. Have you tried to save it as a file?
    • Michael
      Michael over 11 years
      Why aren't you using the apache commons?
    • MRVDOG
      MRVDOG over 11 years
      I honestly have no Idea
    • Michael
      Michael over 11 years
    • MRVDOG
      MRVDOG about 11 years
      haha, I'm an IDIOT, guess who set screenshot_data in my database to varchar(255) instead of longtext, whoops, its working now, thanks for your help Michael
    • Michael
      Michael about 11 years
      I'm glad it's working :) And to be honest I've didn't do anything that could've helped.
    • MRVDOG
      MRVDOG about 11 years
      I'm aware, but if you hadn't tried helping, I probably wouldn't have figured it out, :D
  • Til Hund
    Til Hund almost 12 years
    Yes, I have ufw installed and disabled it in the hope this would prevent ip-tables from booting, which was without avail.
  • Til Hund
    Til Hund almost 12 years
    > Well, if you have no rules and the firewall is disabled, those modules aren't going to be loaded anyway. If so, then I do not understand the last lines from the dmesg output: >[ 20.477633] ip_tables: (C) 2000-2006 Netfilter Core Team <br> >[ 20.768856] ip6_tables: (C) 2000-2006 Netfilter Core Team <br> It seems to be loaded after any boot. Otherwise you're answer to compile my own kernel may be an option.
  • ish
    ish almost 12 years
    @TilHund - you cannot blacklist modules built into the kernel - the only way is to force-unload them if visible, else compile the kernel without them.
  • pl1nk
    pl1nk almost 12 years
    @TilHund - You did this step and when you restarted you had again iptables rules setup?
  • Til Hund
    Til Hund almost 12 years
    Yes, I did it and it appears again on any startup.
  • MRVDOG
    MRVDOG over 11 years
    the file is saving correctly, so it must be to do with either base64 encoding it, or sending it to my website then, this is the base64 class I am using iharder.sourceforge.net/current/java/base64