2
2064  871K ACCEPT  all  --  *    *    0.0.0.0/0  0.0.0.0/0  state RELATED,ESTABLISHED 
0     0    DROP    tcp  --  *    *    0.0.0.0/0  0.0.0.0/0  tcp flags:0x3F/0x00 
0     0    DROP    tcp  --  *    *    0.0.0.0/0  0.0.0.0/0  tcp flags:!0x17/0x02 state NEW 
0     0    DROP    tcp  --  *    *    0.0.0.0/0  0.0.0.0/0  tcp flags:0x3F/0x3F 
0     0    ACCEPT  all  --  lo   *    0.0.0.0/0  0.0.0.0/0           
61    3712 ACCEPT  tcp  --  *    *    0.0.0.0/0  0.0.0.0/0  tcp dpt:80 
0     0    ACCEPT  tcp  --  *    *    0.0.0.0/0  0.0.0.0/0  tcp dpt:443 
0     0    ACCEPT  tcp  --  *    *    0.0.0.0/0  0.0.0.0/0  tcp dpt:22 

I am a little confused by the first line of this:

2064  871K ACCEPT  all  --  *    *    0.0.0.0/0    0.0.0.0/0     state RELATED,ESTABLISHED 

What is state RELATED,ESTABLISHED?

I am trying to block access to all but 80,443,22. Am I accomplishing this here?

Ladadadada
  • 27,207

1 Answers1

6

Packets in a RELATED or ESTABLISHED state are those ones which belong to an already opened connection; you'll generally want to accept them, otherwise connections will get established correctly but nothing will be able to flow after the initial handshake.

Massimo
  • 72,827