> For the complete documentation index, see [llms.txt](https://adavyshin.gitbook.io/networks/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://adavyshin.gitbook.io/networks/docs/nastroika-zone-based-firewalling.md).

# Настройка Zone Based Firewalling

Первичным действием у нас будет декларирование зон безопасности, на общение между которыми будут накладываться уже политики безопасности&#x20;

```
zone security INSIDE
zone security OUTSIDE
```

Создаём Class map, которая позволит отбирать необходмый для пропуска траффик

```
class-map type inspect match-any CM-WEB-TRAFFIC
  match protocol http
  match protocol https
!
ip access-list extended ACL-DC-4-DNS
 10 permit ip host 172.30.0.100 any
!
class-map type inspect match-all CM-DNS-TRAFFIC
  match protocol dns
  match access-group name ACL-DC-4-DNS
  
class-map type inspect match-any CM-ICMP-TRAFFIC
  match protocol dns
```

Создаём Policy map, в котором укажем какие действия будут применяться к отобранному траффику. Напомню, что у нас есть следующие действия:

* `Inspect` - испектирование сессии (stateful firewalling)&#x20;
* `Pass` - пропустить пакет (stateless firewalling)
* `Drop` - Блокировать траффик
* `Log` - Логгирование действия, не является самостоятельным действием. ⚠️ Возможно применение только вкупе с действием `Drop`!

```
policy-map type inspect PM-INSIDE-TO-OUTSIDE
 class type inspect CM-WEB-TRAFFIC
  inspect
 class type inspect CM-DNS-TRAFFIC
  inspect
 class type inspect CM-ICMP-TRAFFIC
  inspect
 class type inspect CM-DENY
  drop
```

Теперь только созданные Policy Map нам необходимо применить для траффика в направлении из INSIDE к OUTSIDE


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://adavyshin.gitbook.io/networks/docs/nastroika-zone-based-firewalling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
