0

I've just installed iptables and have ran the command below.

/sbin/iptables-save > /etc/iptables/rules.v4

When I then went to edit the file "/etc/iptables/rules.v4" I found it contained the lines below.

:INPUT ACCEPT [15079:4118707]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [153:28387]

Is anyone able to shed some light on what those numbers in the square brackets mean? I found the article linked below on securing a raspberry pi which has a section on iptables, but the numbers in the square brackets aren't the same as what I have which has led me to ask the question.

https://makezine.com/2017/09/07/secure-your-raspberry-pi-against-attackers/

For reference the article has this instead.

:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]

I had mistakenly posted this question on stackoverflow, and was told to post it here, but someone did answer and state that they were ports, and that iptables would only allow connections to the port range specified.

This didn't really make a whole lot of sense to me as I am able to connect to port 22 for SSH which is outside of the IP range mentioned in the square brackets. Is anyone able to explain it further perhaps?

2

1 Answer 1

2

The numbers are merely packet/byte counters:

# iptables -L -v
Chain INPUT (policy ACCEPT 145 packets, 39204 bytes)

# iptables-save
:INPUT ACCEPT [145:39204]
1
  • 1
    Oh I see, when are the counters reset?
    – AeroMaxx
    Commented Sep 22, 2017 at 7:57

Not the answer you're looking for? Browse other questions tagged .