Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
You don't really need to insert it anywhere. You could execute that script as a file of it's own an you'd be fine. But if you wanna insert it into your current iptables script then that's okay too. Anywhere in the script will work, as long as there are no -I rules after this which might conflict.
i have not understood... must i create a file with that script? how i can create it? and how execute it?
Yes, you could create a file for it if you want. You'd just need to edit the /etc/example.txt part in it to match whatever file you actually have the IPs stored in. You create it just like you would any other text file: Select the code I posted, right-click on it, select "Copy", open your favorite text editor, start a new file, right-click in it, select "Paste", edit the path/filename I just told you about, select "Save", type in the file name and path you wish to save the script as.
To make the file executable you right-click on the file, select "Properties" (or whatever), and tweak the permissions accordingly. You could also just use the chmod command on it like:
chmod 755 /etc/example.sh
To execute the file you just do a:
BTW, I'm moving this thread to Newbie for better exposure.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
depends on what is broken, you could get a 'file not found error' if you input the wrong filename or a syntax error for iptables if the syntax were incorrect
the question is how do you know it isnt working?