Skip to contentSkip to conversation

Connection states information tables

DISCUSSION Lorenzo Rossi 2 participants 2 messages Sep 21, 2004

lore
Share & tools
lore
#0 lore raw

Hi,
i have a question concerning the tables where are maintained the informations about the connections state.
I configured my firewall script with the following lines, to permit the SSH traffic originated from the protected zone to go to Internet.

iptables -A TCP_IN -i $INTERFACE -p tcp --sport 22 -m state --state ESTABLISHED -J ACCEPT

iptables -A TCP_OUT -o $INTERFACE -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT

The custom chain TCP_IN is listed in the default INPUT chain. The custom chain TCP_OUT is listed in the dafault OUTPUT chain. The dafault policy for the INPUT and OUTPUT chains, as you can imagine, is to DROP.

My question is:
How many state tables are used? one table for each main chain? One for INPUT and one for OUTPUT?

I'm a bit confused..... :)

Thanks
Lorenzo

#1 lore raw
Quoted 3 lines · Lorenzo Rossi

My question is:
How many state tables are used? one table for each main chain? One for INPUT and one for OUTPUT?

Only one table is used, regardless of how many tables and/or chains you have. Everything goes into that one table. Having separate tables, one for each chain, wouldn't be of much use (than you couldn't match incoming and outgoing packets of single connection, unless you traverse all those tables which is just the same as having one table).

Signature · 3 lines
Aleksandar Milivojevic <[email protected]>    Pollard Banknote Limited
Systems Administrator                           1499 Buffalo Place
Tel: (204) 474-2323 ext 276                     Winnipeg, MB  R3T 1L7