---
title: Add/Remove rich rule, Allow/Deny Ip on Port
slug: homologacao-atmosphere/addremove-rich-rule-allowdeny-ip-on-port
description: Learn how to add or remove advanced rules to permit or deny IP addresses on a specific port with this comprehensive document. Discover the parameters involved, such as action, port number, and protocol, and explore a practical example for utilizing this f
createdAt: 2022-07-26T13:52:03.000Z
---

## Resumo

- Adicionar/remover regra avançada, permitir/negar Ip na porta

## Parâmetros

| **Parâmetro** | **Tipo** | **Escolhas \| Valor Padrão** | **Comentários** |
| ------------- | -------- | ---------------------------- | --------------- |
| add\_remove   | string   | - add<br />- remove          | Tipo a ação     |
| port          | integer  |                              | porta           |
| protocol      | string   | - tcp<br />- utp<br />- icmp | protocolo       |

Utiliza parâmetros do módulo [Shell](https://docs.simonops.com/homologacao-atmosphere/shell).

## Exemplos

```yaml
- shell: 
    arguments: sudo firewall-cmd --permanent --{{ input.add_remove }}-rich-rule="rule family='ipv4' port port='{{ input.port }}' protocol='{{ input.protocol }}' source address='{{ input.ip }}' {{ input.allow_deny }}"
  register: result
```

## Valores retornados

| **Chave**        | **Tipo** | **Retornado quando** | **Descrição**              |
| ---------------- | -------- | -------------------- | -------------------------- |
| output           | string   | Sempre               | Saída da execução          |
| had\_errors      | boolean  | Sempre               | Se teve erros              |
| output\_errors   | string   | Sempre               | Erros de saída da execução |
| output\_warnings | string   | Sempre               | Avisos de saída            |

