LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   need explanation on an iptables entry (https://www.linuxquestions.org/questions/fedora-35/need-explanation-on-an-iptables-entry-597559/)

slackamp 11-06-2007 12:33 PM

need explanation on an iptables entry
 
# Generated by iptables-save v1.3.5 on Thu Jul 5 12:19:04 2007
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [12325:2319098]



What does the line ":OUTPUT ACCEPT [12325:2319098]" mean? will it cause any trouble? What would happen if I put [0:0]?

blackhole54 11-07-2007 08:45 AM

Quote:

Originally Posted by slackamp (Post 2950158)
What does the line ":OUTPUT ACCEPT [12325:2319098]" mean? will it cause any trouble? What would happen if I put [0:0]?

The output of iptables-save is an abbreviated listing of your firewall rules that iptables-restore can use to restore the state of the firewall. The line you ask about says the policy for the OUTPUT chain is DROP. The numbers in brackets are packet and byte counts for that policy that can be restored with iptables-restore. If you set them to zero, then you just lose that information.

I hope what you listed isn't the entire contents of that file. If so, all incoming packets will be dropped, including loopback packets. Normally you would want to at least accept loopback.

nomb 11-07-2007 11:19 AM

So wait, when you say packets or byte counts that can be restored, what are you saying exactly? That the chain made copies of packets as they went through and you can restore them into a packet and send them again?

blackhole54 11-07-2007 06:47 PM

Quote:

Originally Posted by nomb (Post 2951154)
So wait, when you say packets or byte counts that can be restored, what are you saying exactly? That the chain made copies of packets as they went through and you can restore them into a packet and send them again?

Not at all. Netfilter counted the packets that "dropped through the end" of the chain and were handled by the chain's policy. It also kept track of the total size of those packets. So for the data posted, 12325 packets with a total size of 2319098 bytes were ACCEPTed by the OUPUT chain's policy. You can see this same data on a running netfilter with the command:

Code:

iptables -nvL
I don't think I have ever played around with iptables-restore, but according to its man page, using the -c option will restore the packet and byte counters. It just plugs the numbers in. It doesn't replay the packets!

nomb 11-07-2007 07:00 PM

Gotcha, thats were I was a little confused.
Altho, that would be awsome if it could replicate the packets...

*starts scheming*

:D

nomb


All times are GMT -5. The time now is 10:48 PM.