A very simple Ansible role to enable iptables masquerading and IP forwarding on a host, to use it as a NAT Gateway for example.
Ansible 2.2
Var | Default value |
---|---|
masquerade_out_interface | {{ ansible_default_ipv4.interface }} |
masquerade_source | 0.0.0.0/0 |
masquerade_dest | 0.0.0.0/0 |
masquerade_protocol | all |
- hosts: ec2-gateway
roles:
- role: abelboldu.masquerade
masquerade_out_interface: 'eth0'
masquerade_source: '10.1.0.0/16'
masquerade_protocol: 'tcp'
BSD
abel.boldu at gmx.com