Iptables Tutorial 1.1.19
Добавить в закладки К обложке
- Посвящения - Страница 1
- Об авторе - Страница 2
- Как читать этот документ - Страница 3
- Предварительные условия - Страница 4
- Типографские соглашения - Страница 5
- Глава 1. Введение - Страница 6
- 1.2. Как он был написан - Страница 7
- 1.3. Термины, используемые в данном документе - Страница 8
- Глава 2. Подготовка - Страница 9
- 2.1. Где взять iptables - Страница 10
- 2.2. Настройка ядра - Страница 11
- 2.3. Установка пакета - Страница 14
- 2.3.1. Сборка пакета - Страница 15
- 2.3.2. Установка в Red Hat 7.1 - Страница 16
- Глава 3. Порядок прохождения таблиц и цепочек - Страница 18
- 3.1. Общие положения - Страница 19
- 3.2. Таблица Mangle - Страница 22
- 3.3. Таблица Nat - Страница 23
- 3.4. Таблица Filter - Страница 24
- Глава 4. Механизм определения состояний - Страница 25
- 4.1. Введение - Страница 26
- 4.2. Таблица трассировщика - Страница 27
- 4.3. Состояния в пространстве пользователя - Страница 28
- 4.4. TCP соединения - Страница 29
- 4.5. UDP соединения - Страница 31
- 4.6. ICMP соединения - Страница 32
- 4.7. Поведение по-умолчанию - Страница 34
- 4.8. Трассировка комплексных протоколов - Страница 35
- Глава 5. Сохранение и восстановление больших наборов правил - Страница 36
- 5.1. Плюсы - Страница 37
- 5.2. И минусы - Страница 38
- 5.3. iptables-save - Страница 39
- 5.4. iptables-restore - Страница 40
- Глава 6. Как строить правила - Страница 41
- 6.1. Основы - Страница 42
- 6.2. Таблицы - Страница 43
- 6.3. Команды - Страница 44
- 6.4. Критерии - Страница 47
- 6.4.1. Общие критерии - Страница 48
- 6.4.2. Неявные критерии - Страница 50
- 6.4.2.1. TCP критерии - Страница 51
- 6.4.2.2. UDP критерии - Страница 53
- 6.4.2.3. ICMP критерии - Страница 54
- 6.4.3. Явные критерии - Страница 55
- 6.4.3.1. Критерий Limit - Страница 56
- 6.4.3.2. Критерий MAC - Страница 57
- 6.4.3.3. Критерий Mark - Страница 58
- 6.4.3.4. Критерий Multiport - Страница 59
- 6.4.3.5. Критерий Owner - Страница 60
- 6.4.3.6. Критерий State - Страница 61
- 6.4.3.7. Критерий TOS - Страница 62
- 6.4.3.8. Критерий TTL - Страница 63
- 6.4.4. Критерий «мусора» (Unclean match) - Страница 64
- 6.5. Действия и переходы - Страница 65
- 6.5.1. Действие ACCEPT - Страница 66
- 6.5.2. Действие DNAT - Страница 67
- 6.5.3. Действие DROP - Страница 69
- 6.5.4. Действие LOG - Страница 70
- 6.5.5. Действие MARK - Страница 72
- 6.5.6. Действие MASQUERADE - Страница 73
- 6.5.7. Действие MIRROR - Страница 74
- 6.5.8. Действие QUEUE - Страница 75
- 6.5.9. Действие REDIRECT - Страница 76
- 6.5.10. Действие REJECT - Страница 77
- 6.5.11. Действие RETURN - Страница 78
- 6.5.12. Действие SNAT - Страница 79
- 6.5.13. Действие TOS - Страница 80
- 6.5.14. Действие TTL - Страница 81
- 6.5.15. Действие ULOG - Страница 82
- Глава 7. Файл rc.firewall - Страница 83
- 7.1. Пример rc.firewall - Страница 84
- 7.2. Описание сценария rc.firewall - Страница 85
- 7.2.2. Загрузка дополнительных модулей - Страница 86
- 7.2.3. Настройка /proc - Страница 87
- 7.2.4. Размещение правил по разным цепочкам - Страница 88
- 7.2.5. Установка политик по-умолчанию - Страница 90
- 7.2.6. Создание пользовательских цепочек в таблице filter - Страница 91
- 7.2.6.1. Цепочка bad_tcp_packets - Страница 92
- 7.2.6.2. Цепочка allowed - Страница 93
- 7.2.6.3. Цепочка для TCP - Страница 94
- 7.2.6.4. Цепочка для UDP - Страница 95
- 7.2.6.5. Цепочка для ICMP - Страница 96
- 7.2.7. Цепочка INPUT - Страница 97
- 7.2.8. Цепочка FORWARD - Страница 98
- 7.2.9. Цепочка OUTPUT - Страница 99
- 7.2.10. Цепочка PREROUTING таблицы nat - Страница 100
- 7.2.11. Запуск SNAT и цепочка POSTROUTING - Страница 101
- Глава 8. Примеры сценариев - Страница 102
- 8.1. Структура файла rc.firewall.txt - Страница 103
- 8.1.1. Структура - Страница 104
- 8.2. rc.firewall.txt - Страница 107
- 8.3. rc.DMZ.firewall.txt - Страница 108
- 8.4. rc.DHCP.firewall.txt - Страница 109
- 8.5. rc.UTIN.firewall.txt - Страница 110
- 8.6. rc.test-iptables.txt - Страница 111
- 8.7. rc.flush-iptables.txt - Страница 112
- 8.8. Limit-match.txt - Страница 113
- 8.9. Pid-owner.txt - Страница 114
- 8.10. Sid-owner.txt - Страница 115
- 8.11. Ttl-inc.txt - Страница 116
- 8.12. Iptables-save ruleset - Страница 117
- Приложение A. Детальное описание специальных команд - Страница 118
- A.2. Изменение и очистка ваших таблиц - Страница 119
- Приложение B. Общие проблемы и вопросы - Страница 120
- B.2. Пакеты со статусом NEW и со сброшенным битом SYN - Страница 121
- B.3. SYN/ACK – пакеты и пакеты со статусом NEW - Страница 122
- B.4. Поставщики услуг Internet, использующие зарезервированные IP-адреса - Страница 123
- B.5. Как разрешить прохождение DHCP запросов через iptables - Страница 124
- B.6. Проблемы mIRC DCC - Страница 125
- Приложение C. Типы ICMP - Страница 126
- Приложение D. Ссылки на другие ресурсы - Страница 128
- Приложение E. Благодарности - Страница 130
- Приложение F. Хронология - Страница 131
- Приложение G. GNU Free Documentation License - Страница 133
- 0. PREAMBLE - Страница 134
- 1. APPLICABILITY AND DEFINITIONS - Страница 135
- 2. VERBATIM COPYING - Страница 136
- 3. COPYING IN QUANTITY - Страница 137
- 4. MODIFICATIONS - Страница 138
- 5. COMBINING DOCUMENTS - Страница 140
- 6. COLLECTIONS OF DOCUMENTS - Страница 141
- 7. AGGREGATION WITH INDEPENDENT WORKS - Страница 142
- 8. TRANSLATION - Страница 143
- 9. TERMINATION - Страница 144
- 10. FUTURE REVISIONS OF THIS LICENSE - Страница 145
- How to use this License for your documents - Страница 146
- Приложение H. GNU General Public License - Страница 147
- 0. Preamble - Страница 148
- 1. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - Страница 149
- 2. How to Apply These Terms to Your New Programs - Страница 152
- Приложение I. Примеры сценариев - Страница 153
- I.2. Пример rc.DMZ.firewall - Страница 156
- I.3. Пример rc.UTIN.firewall - Страница 159
- I.4. Пример rc.DHCP.firewall - Страница 162
- I.5. Пример rc.flush-iptables - Страница 165
- I.6. Пример rc.test-iptables - Страница 166
Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166