LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-14-2006, 05:24 AM   #1
linuxali
LQ Newbie
 
Registered: Feb 2006
Posts: 14

Rep: Reputation: 0
iptables help required


Hello Friends!

Can any one tell me how to include file in iptables. I wana inlcude a file containing ports that i would like to allow.

Regards

LinuxAli
 
Old 03-14-2006, 09:13 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
i think something like this should work (it's just an example):
Code:
if [ -f /somewhere/goodports.txt ]
then
   for i in `cat /somewhere/goodports.txt | grep -v ^# | grep -v ^$`
      do
         iptables -I OUTPUT -p TCP -o eth0 --dport $i -j ACCEPT
   done
else
         echo "No goodports.txt found..."
fi
the goodports.txt file would look kinda like (the comments are optional):
Code:
# HTTP:
80

# HTTPS:
443

# FTP:
21

# Blah blah blah
12345
i hope this at least gives you an idea of what you need...

just my ...

Last edited by win32sux; 03-16-2006 at 12:25 AM.
 
Old 03-14-2006, 10:04 PM   #3
krasl
Member
 
Registered: Nov 2005
Distribution: Fedora 4
Posts: 40

Rep: Reputation: 15
Use Webmin to administer iptables

Hello. I have been using Webmin (www.webmin.com) to administer IPTABLES and it's just a lot easier than memorizing (or man'ing) the iptables command syntax every time I want to change a rule.

Krasl
 
Old 03-14-2006, 10:07 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by krasl
I have been using Webmin (www.webmin.com) to administer IPTABLES and it's just a lot easier than memorizing (or man'ing) the iptables command syntax every time I want to change a rule.
it's also a lot less flexible...
 
Old 03-15-2006, 08:06 AM   #5
krasl
Member
 
Registered: Nov 2005
Distribution: Fedora 4
Posts: 40

Rep: Reputation: 15
Quote:
Originally Posted by win32sux
it's also a lot less flexible...
OK, but I'm a
 
Old 03-15-2006, 02:50 PM   #6
morgolis
LQ Newbie
 
Registered: Mar 2005
Posts: 11

Rep: Reputation: 0
I use ipkungfu to set up my IPtables. http://www.linuxkungfu.org/
 
Old 03-16-2006, 01:43 PM   #7
doublejoon
Member
 
Registered: Oct 2003
Location: King George, VA
Distribution: RHEL/CentOS/Scientific/Fedora, LinuxMint
Posts: 370

Rep: Reputation: 44
Quote:
Originally Posted by krasl
Hello. I have been using Webmin (www.webmin.com) to administer IPTABLES and it's just a lot easier than memorizing (or man'ing) the iptables command syntax every time I want to change a rule.

Krasl


What do you do if Webmin breaks?
 
Old 03-17-2006, 08:36 PM   #8
krasl
Member
 
Registered: Nov 2005
Distribution: Fedora 4
Posts: 40

Rep: Reputation: 15
Quote:
Originally Posted by doublejoon
What do you do if Webmin breaks?
"man iptables"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
Required IPTables restart after each boot for NATing?? Nickj Linux - Networking 4 10-13-2005 03:16 AM
IPTables for Dummies required Bill Fox Linux - Networking 1 02-14-2005 01:26 PM
IPtables Log Analyzer from http://www.gege.org/iptables/ brainlego Linux - Software 0 08-11-2003 06:08 AM
My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo ForumKid Linux - General 3 01-22-2002 07:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration