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
1. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The «Program», below, refers to any such program or work, and a «work based on the Program» means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term «modification».) Each licensee is addressed as «you».
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
- 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