2020-01-22 22:38:31 +00:00
|
|
|
---
|
|
|
|
title: iptables
|
|
|
|
type: docs
|
|
|
|
---
|
|
|
|
|
2022-03-03 20:24:58 +00:00
|
|
|
[![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.logrotate) [![Build Status](https://img.shields.io/drone/build/ansible/xoxys.logrotate?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.logrotate) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/ansible/xoxys.iptables/src/branch/master/LICENSE)
|
2020-01-31 10:51:17 +00:00
|
|
|
|
|
|
|
Role to manage iptables firewall.
|
2020-01-22 22:38:31 +00:00
|
|
|
|
2022-03-03 20:24:58 +00:00
|
|
|
- [Default Variables](#default-variables)
|
|
|
|
- [iptables_app_rules](#iptables_app_rules)
|
|
|
|
- [iptables_app_rules_extra](#iptables_app_rules_extra)
|
|
|
|
- [iptables_custom_rules](#iptables_custom_rules)
|
|
|
|
- [iptables_default_head](#iptables_default_head)
|
|
|
|
- [iptables_default_tail](#iptables_default_tail)
|
|
|
|
- [iptables_keep_unmanaged](#iptables_keep_unmanaged)
|
|
|
|
- [Dependencies](#dependencies)
|
2020-01-22 22:38:31 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
## Default Variables
|
|
|
|
|
|
|
|
### iptables_app_rules
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
iptables_app_rules: []
|
|
|
|
```
|
|
|
|
|
|
|
|
### iptables_app_rules_extra
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
iptables_app_rules_extra: []
|
|
|
|
```
|
|
|
|
|
|
|
|
### iptables_custom_rules
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
iptables_custom_rules: []
|
|
|
|
```
|
|
|
|
|
|
|
|
### iptables_default_head
|
|
|
|
|
|
|
|
Default head (allow) rules.
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
2022-03-03 20:24:58 +00:00
|
|
|
iptables_default_head: |
|
|
|
|
-P INPUT ACCEPT
|
|
|
|
-P FORWARD ACCEPT
|
|
|
|
-P OUTPUT ACCEPT
|
|
|
|
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
|
|
|
|
-A INPUT -i lo -j ACCEPT
|
|
|
|
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT
|
|
|
|
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
|
2020-01-22 22:38:31 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### iptables_default_tail
|
|
|
|
|
|
|
|
Default tail (deny) rules.
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
2022-03-03 20:24:58 +00:00
|
|
|
iptables_default_tail: |
|
|
|
|
-A INPUT -j REJECT
|
|
|
|
-A FORWARD -j REJECT
|
2020-01-22 22:38:31 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### iptables_keep_unmanaged
|
|
|
|
|
|
|
|
By default this role deletes all iptables rules which are not managed by Ansible. Set this to 'yes', if you want the role to keep unmanaged rules.
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
iptables_keep_unmanaged: no
|
|
|
|
```
|
|
|
|
|
2022-03-03 20:24:58 +00:00
|
|
|
|
|
|
|
|
2020-01-22 22:38:31 +00:00
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
None.
|