LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 12-11-2007, 11:25 AM   #1
fabmejia
LQ Newbie
 
Registered: Feb 2007
Location: Bogota, Colombia
Distribution: Linux Mint 15 X64, Mageia 2, Red Hat Enterprise, Centos 6.x
Posts: 20

Rep: Reputation: 0
iptables maybe dumb question


Hello fellows,

I have a doubt about the exact meaning and use of these initial lines in my /etc/sysconfig/iptables file:

# Generated by iptables-save v1.2.8 on Wed Apr 4 16:02:16 2007

*filter

:INPUT ACCEPT [172:6880]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [813:77074]

after these lines i have all my other set of rules, which I understand more or less, but I'll like to know the exact meaning of those initial lines.

Thankyou.

Last edited by fabmejia; 12-11-2007 at 11:27 AM. Reason: clarify the question
 
Old 12-11-2007, 11:56 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by fabmejia View Post
I have a doubt about the exact meaning and use of these initial lines in my /etc/sysconfig/iptables file:

# Generated by iptables-save v1.2.8 on Wed Apr 4 16:02:16 2007

*filter

:INPUT ACCEPT [172:6880]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [813:77074]
The first line indicates the date the config was created. The second line indicates the name of the table in which the chains that follow are located. The third, fourth, and fifth lines indicate chain names, the policies which are set on them, and the packet and byte count for each.

Last edited by win32sux; 12-11-2007 at 11:58 AM.
 
Old 12-11-2007, 04:01 PM   #3
fabmejia
LQ Newbie
 
Registered: Feb 2007
Location: Bogota, Colombia
Distribution: Linux Mint 15 X64, Mageia 2, Red Hat Enterprise, Centos 6.x
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks, and these policies indicates that iptables is accepting everything or to the contrary rejecting everything?.
Because i know that the rest of the rules that follows in my rule set are opening ports and some ip addresses; as I understand that first the firewall closes everything and then we begin to open only the necessary holes to get the work done...
 
Old 12-11-2007, 08:21 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 fabmejia View Post
Thanks, and these policies indicates that iptables is accepting everything or to the contrary rejecting everything?.
Because i know that the rest of the rules that follows in my rule set are opening ports and some ip addresses; as I understand that first the firewall closes everything and then we begin to open only the necessary holes to get the work done...
Yes, that config indicates all your policies are set to ACCEPT. Ideally you'd want them to be set to DROP, but some people prefer to use a DROP rule at the end of their chains instead of setting the policy itself to DROP.
 
Old 12-12-2007, 03:39 AM   #5
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Just to make it completely clear; Policies are defaults for that chain. In other words, they specify what happens if nothing earlier in the chain does something that stops the packet falling through to the end of the chain.

So all packets that are in some way different from all the cases that you specifically thought about in designing the firewall will fall through to the default and that might be bad.

As win32sux suggests, the most secure thing is to arrange that chains drop by default. You could make a secure (well, up to a point) system that used accept-by-default, but its easier to get wrong. And its very easy to alter something that breaks your initial security when making modifications.

So drop-by-default is recommended for anything other than quick 'n dirty firewalls.
 
Old 12-12-2007, 08:06 AM   #6
fabmejia
LQ Newbie
 
Registered: Feb 2007
Location: Bogota, Colombia
Distribution: Linux Mint 15 X64, Mageia 2, Red Hat Enterprise, Centos 6.x
Posts: 20

Original Poster
Rep: Reputation: 0
Thankyou, thats exactly the clarification I was looking for. I asked because I have readded the manual pages and the documentation, but that particular part of the rule set was not clearly understandable. Thanks again.
 
  


Reply



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
maybe dumb question stryfetew Linux - Software 3 03-08-2006 12:53 PM
Another Dumb Question ?? xedios Linux - Software 2 09-01-2004 06:03 PM
dumb question xedios Linux - Software 6 08-31-2004 02:24 PM
Maybe a dumb Question But? ikw38 Linux - Newbie 6 01-23-2003 10:27 PM
dumb question but anyways... 43w45r3e Linux - Distributions 2 01-26-2002 03:20 PM

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

All times are GMT -5. The time now is 03:50 PM.

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