Find the answer to your Linux question:
Results 1 to 2 of 2
Greetings, I'm running Ubuntu 6.06LTS Server (command-line based, no GUI) and wish to configure IPtables. I have my script written and saved in a text file. At this point, I'm ...
  1. #1
    Just Joined!
    Join Date
    Mar 2005
    Posts
    8

    How to write an IPtables script



    Greetings,

    I'm running Ubuntu 6.06LTS Server (command-line based, no GUI) and wish to configure IPtables. I have my script written and saved in a text file. At this point, I'm confused about several things. I've searched google and unfortunately have not found a clear explanation to my questions.

    1.) How do I automatically execute the script at bootup?
    --Do I need to change the file extension of the text file?
    --Do I have to add "#!/bin/bash" to the top of the script?
    --Where do I place the script, in the /etc/init.d directory?
    --What permissions does the script need to run at bootup?

    2.) Some IPtables scripts I've come across include the following:

    modprobe ip_tables
    modprobe ip_conntrack_ftp

    My Ubuntu server is not providing FTP, just HTTP and SSH, so do I need to include these lines of code in my IPtables script?

    Thank you for your time,

    *Nick*

  2. #2
    Just Joined!
    Join Date
    Dec 2006
    Posts
    62
    Most apps configure a boot script. The last time I manually did one was on Mandrake 8 by editing:

    /etc/init.d/rc.d

    It was commented as to where/how to add the start up commands. I only mention this to stir some more expert comment.

    Execute an:

    cat /etc/init.d to view it contents. To edit replace "cat" with "vi". If your confused, don't bother as your wasting your time.

    In *nix file extensions are not important. Check the permission on your file.

    execute an "ls -las" on any directory to list details of file attributes. they will look like "rwx". The x bit is critical for execution.

    If your this new, don't bother with IP tables. Just get a router from your local store. It is cheap and removes a tedious detail from your server.

    Don't be afraid to view the "man" pages. Great advice for anyone new to Unix.

    "man mystery command.


Posting Permissions

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