Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm learning how to use iptables on ubuntu server.

Can you please explain to me what "Allowing Established Sessions" means and why should I include it in rules?

sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

I understand concept of allowing specific ports and blocking others

sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT

block all

sudo iptables -A INPUT -j DROP

But I don't get the concept of allowing established session.



share|improve this question

2 Answers 2

up vote 0 down vote accepted

Some protocols are more complex than "send a single packet as a request, receive a single packet in response". ESTABLISHED handles transactions that are in process on a single port (e.g. HTTP keepalive), and RELATED handles new transactions on a different port that are related to an existing transaction.

share|improve this answer
makes sense. ty –  Sandro Dzneladze Jul 5 '12 at 18:49

With just the last 2 rules you will not be able to use any client on the computer as any response will be dropped. Furthermore use of the SSH server will be unreliable as related ICMP packet too big errors will be dropped.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.