/nat

Ansible role to configure NAT

GNU General Public License v3.0GPL-3.0

nat

Ansible role to configure NAT between public and internal network interfaces.

By default it translates traffic between:

  • public interface, in public firewalld zone, with ip address = ansible_host variable
  • internal interface, in internal firewalld zone, with ip address = internal_ip variable

Requirements

Role Variables

  • defaults

    nat_interfaces: []      # list of network interfaces for NAT traffic
      - zone: ""            # name of firewalld zone
        interface: ""       # name of network interface

Dependencies

No ansible roles dependencies

Tags

  • nat.firewall - Configure firewall
    • nat.firewall.zone - Move interface to zone
    • nat.firewall.masquerade - Allow masquerade on public interface
  • nat.routing - Configure ip forwarding
    • nat.routing.forwarding - Allow ip forwarding
    • nat.routing.internal - Disable default routing for non-public interfaces

Examples

  • requirements.yaml

    - name: nat
      src: https://github.com/mario-slowinski/nat
  • playbook.yaml

    - hosts: servers
      gather_facts: true
      roles:
        - role: nat

License

GPL-3.0

Author Information

mario.slowinski@gmail.com