---
title: FortiOS Firewall Shaping Policy
slug: homologacao-atmosphere/fortios-firewall-shaping-policy
description: Learn how to configure shaping policies in Fortinet's FortiOS and FortiGate with this comprehensive document. It covers all the essential parameters such as firewall_shaping_policy, state, app_category, application, class_id, comment, dstaddr, dstaddr6, d
createdAt: 2021-09-10T11:50:30.000Z
---

## Resumo

- Configure shaping policies in Fortinet’s FortiOS and FortiGate

## Parâmetros

| **Parâmetro**                                       | **Tipo**   | **Escolhas \| Valor Padrão**                          | **Comentários**                                                                             |
| --------------------------------------------------- | ---------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| firewall\_shaping\_policy<br />(Possíveis valores)  | dictionary |                                                       | Configure as políticas de um shaping.                                                       |
| state                                               | string     | Escolhas:<br />- present<br />(default)<br />- absent | Indica se deve criar ou remover o objeto. Use present para criar, ou absent para excluí-lo. |



### Subcampos da opção firewall\_shaping\_policy

| **Parâmetro**                                            | **Tipo** | **Escolhas \| Valor Padrão**           | **Comentários**                                                                                                            |
| -------------------------------------------------------- | -------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| app\_category<br />(Possíveis valores)                   | list     |                                        | IDs de uma ou mais categorias de aplicativo às quais este modelador aplica modelagem de tráfego de controle de aplicativo. |
| application<br />(Possíveis valores)                     | list     |                                        | IDs de um ou mais aplicativos aos quais este modelador aplica modelagem de tráfego de controle de aplicativo.              |
| class\_id                                                | integer  |                                        | ID da classe de tráfego.                                                                                                   |
| comment                                                  | string   |                                        | Comentários.                                                                                                               |
| dstaddr<br />(Possíveis valores)                         | list     |                                        | Endereço de destino IPv4 e nomes de grupo de endereços.                                                                    |
| dstaddr6<br />(Possíveis valores)                        | list     |                                        | Endereço de destino IPv6 e nomes de grupo de endereços.                                                                    |
| dstintf<br />(Possíveis valores)                         | list     |                                        | One or more outgoing (egress) interfaces.                                                                                  |
| groups<br />(Possíveis valores)                          | list     |                                        | Apply this traffic shaping policy to user groups that have authenticated with the FortiGate.                               |
| id - *required*                                          | integer  |                                        | Shaping policy ID.                                                                                                         |
| internet\_service<br />                                  | string   | Escolhas:<br />- enable<br />- disable | Enable/disable use of Internet Services for this policy. If enabled, destination address and service are not used.         |
| internet\_service\_custom<br />(Possíveis valores)       | list     |                                        | Custom Internet Service name.                                                                                              |
| internet\_service\_id<br />(Possíveis valores)           | list     |                                        | Internet Service ID.                                                                                                       |
| internet\_service\_src                                   | string   | Escolhas:<br />- enable<br />- disable | Enable/disable use of Internet Services in source for this policy. If enabled, source address is not used.                 |
| internet\_service\_src\_custom<br />(Possíveis valores)  | list     |                                        | Custom Internet Service source name.                                                                                       |
| internet\_service\_src\_id<br />(Possíveis valores)      | list     |                                        | Internet Service source ID.                                                                                                |
| ip\_version                                              | string   | Escolhas:<br />4<br />6                | Apply this traffic shaping policy to IPv4 or IPv6 traffic.                                                                 |
| per\_ip\_shaper                                          | string   |                                        | Per-IP traffic shaper to apply with this policy.                                                                           |
| schedule                                                 | string   |                                        | Schedule name.                                                                                                             |
| service<br />(Possíveis valores)                         | list     |                                        | Service and service group names.                                                                                           |
| srcaddr<br />(Possíveis valores)                         | list     |                                        | IPv4 source address and address group names.                                                                               |
| srcaddr6<br />(Possíveis valores)                        | list     |                                        | IPv6 source address and address group names.                                                                               |
| status                                                   | string   | Escolhas:<br />- enable<br />- disable | Enable/disable this traffic shaping policy.                                                                                |
| traffic\_shaper                                          | string   |                                        | Traffic shaper to apply to traffic forwarded by the firewall policy.                                                       |
| traffic\_shaper\_reverse                                 | string   |                                        | Traffic shaper to apply to response traffic received by the firewall policy.                                               |
| url\_category<br />(Possíveis valores)                   | list     |                                        | IDs of one or more FortiGuard Web Filtering categories that this shaper applies traffic shaping to.                        |
| users<br />(Possíveis valores)                           | list     |                                        | Apply this traffic shaping policy to individual users that have authenticated with the FortiGate.                          |



### Subcampos da opção app\_category

| **Parâmetro**   | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários** |
| --------------- | -------- | ---------------------------- | --------------- |
| id - *required* | integer  |                              | Category IDs.   |



### Subcampos da opção application

| **Parâmetro**   | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários**  |
| --------------- | -------- | ---------------------------- | ---------------- |
| id - *required* | integer  |                              | Application IDs. |



### Subcampos da opção dstaddr

| **Parâmetro**     | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários** |
| ----------------- | -------- | ---------------------------- | --------------- |
| name - *required* | string   |                              | Address name.   |



### Subcampos da opção dstaddr6

| **Parâmetro**     | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários** |
| ----------------- | -------- | ---------------------------- | --------------- |
| name - *required* | string   |                              | Address name.   |



### Subcampos da opção dstintf

| **Parâmetro**     | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários**  |
| ----------------- | -------- | ---------------------------- | ---------------- |
| name - *required* | string   |                              | Interface name.  |



### Subcampos da opção groups

| **Parâmetro**     | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários** |
| ----------------- | -------- | ---------------------------- | --------------- |
| name - *required* | string   |                              | Group name.     |



### Subcampos da opção internet\_service\_custom

| **Parâmetro**     | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários**                |
| ----------------- | -------- | ---------------------------- | ------------------------------ |
| name - *required* | string   |                              | Custom Internet Service name.  |



### Subcampos da opção internet\_service\_id

| **Parâmetro**   | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários**       |
| --------------- | -------- | ---------------------------- | --------------------- |
| id - *required* | integer  |                              | Internet Service ID.  |



### Subcampos da opção internet\_service\_src\_custom

| **Parâmetro**     | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários**                |
| ----------------- | -------- | ---------------------------- | ------------------------------ |
| name - *required* | string   |                              | Custom Internet Service name.  |



### Subcampos da opção internet\_service\_src\_id

| **Parâmetro**   | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários**       |
| --------------- | -------- | ---------------------------- | --------------------- |
| id - *required* | integer  |                              | Internet Service ID.  |



### Subcampos da opção service

| **Parâmetro**     | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários** |
| ----------------- | -------- | ---------------------------- | --------------- |
| name - *required* | string   |                              | Service name.   |



### Subcampos da opção srcaddr

| **Parâmetro**     | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários** |
| ----------------- | -------- | ---------------------------- | --------------- |
| name - *required* | string   |                              | Address name.   |



### Subcampos da opção srcaddr6

| **Parâmetro**     | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários** |
| ----------------- | -------- | ---------------------------- | --------------- |
| name - *required* | string   |                              | Address name.   |



### Subcampos da opção url\_category

| **Parâmetro**   | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários**  |
| --------------- | -------- | ---------------------------- | ---------------- |
| id - *required* | integer  |                              | URL category ID. |



### Subcampos da opção users

| **Parâmetro**     | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários** |
| ----------------- | -------- | ---------------------------- | --------------- |
| name - *required* | string   |                              | User name.      |



## Exemplos

```yaml
# Exemplo: Configure shaping policies
- fortios_firewall_shaping_policy:
    host: "host"
    username: "username"
    password: "password"
    vdom: "vdom"
    https: "False"
    state: "present"
    firewall_shaping_policy:
      app_category:
       -  id:  "4"
      application:
       -  id:  "6"
      class_id: "7"
      comment: "Comments."
      dstaddr:
       -  name: "default_name_10 (source firewall.address.name firewall.addrgrp.name)"
      dstaddr6:
       -  name: "default_name_12 (source firewall.address6.name firewall.addrgrp6.name)"
      dstintf:
       -  name: "default_name_14 (source system.interface.name system.zone.name)"
      groups:
       -  name: "default_name_16 (source user.group.name)"
      id: "17"
      internet_service: "enable"
      internet_service_custom:
       -  name: "default_name_20 (source firewall.internet-service-custom.name)"
      internet_service_id:
       -  id:  "22 (source firewall.internet-service.id)"
      internet_service_src: "enable"
      internet_service_src_custom:
       -  name: "default_name_25 (source firewall.internet-service-custom.name)"
      internet_service_src_id:
       -  id:  "27 (source firewall.internet-service.id)"
      ip_version: "4"
      per_ip_shaper: "<your_own_value> (source firewall.shaper.per-ip-shaper.name)"
      schedule: "<your_own_value> (source firewall.schedule.onetime.name firewall.schedule.recurring.name firewall.schedule.group.name)"
      service:
       -  name: "default_name_32 (source firewall.service.custom.name firewall.service.group.name)"
      srcaddr:
       -  name: "default_name_34 (source firewall.address.name firewall.addrgrp.name)"
      srcaddr6:
       -  name: "default_name_36 (source firewall.address6.name firewall.addrgrp6.name)"
      status: "enable"
      traffic_shaper: "<your_own_value> (source firewall.shaper.traffic-shaper.name)"
      traffic_shaper_reverse: "<your_own_value> (source firewall.shaper.traffic-shaper.name)"
      url_category:
       -  id:  "41"
      users:
       -  name: "default_name_43 (source user.local.name)"
```



## Valores retornados

Este módulo extende os mesmos valores retornados do módulo base fortios.
