Путаница с расширением `conntrack` для iptables`

7421
Kal

На iptables-extensionsman-странице есть что сказать о conntrackрасширении (выделено мной):

Этот модуль в сочетании с отслеживанием соединения обеспечивает доступ к состоянию отслеживания соединения для данного пакета / соединения.

Я думал, conntrack это отслеживание соединения?

Почему на странице руководства написано "в сочетании с отслеживанием соединения"?

Если conntrackне отслеживание соединения, то что это?

Что такое «другое» отслеживание соединения? Откуда это взялось?

2

1 ответ на вопрос

1
Malvineous

Connection tracking is already recording things about the tracked connections, like whether one connection is related to another (such as a new FTP DATA connection being related to an existing FTP session, even though it's on a different port.)

The conntrack iptables extension provides additional criteria you can use in iptables rules to match the tracked state, for instance by allowing these related connections through.

If you don't use the conntrack extension then the connections are still tracked by the kernel (if the appropriate kernel modules are loaded) but that tracking information then goes unused as it won't be examined by any iptables rules.

Basically the whole connection tracking system is split in two - the bit in the kernel that does the actual tracking, and the bit in iptables that examines the tracking information from the kernel and decides whether to allow a given packet through or not.

This is a bit of a simplification but hopefully explains it in general terms.

"соответствующие модули ядра", как в `nf_conntrack *`? Kal 9 лет назад 0
Да. Вероятно, вам нужны только `nf_conntrack` и` xt_conntrack`, плюс ноль или более модулей `nf_conntrack_ *` в зависимости от того, какие протоколы вы хотите отслеживать. Malvineous 9 лет назад 1