role.prepare_lxc_host/templates/etc/network/interfaces.d/bridge.j2
2024-03-12 21:39:29 +01:00

10 lines
561 B
Django/Jinja

auto {{ lxc_host_bridge }}
iface {{ lxc_host_bridge }} inet static
address {{ lxc_host_ipv4_addr }}
bridge_ports none
up /sbin/iptables -t nat -A POSTROUTING -s {{ lxc_host_ipv4_addr|ansible.utils.ipaddr("network/prefix") }} ! -o {{ lxc_host_bridge }} ! -d {{ lxc_host_ipv4_addr|ansible.utils.ipaddr("network/prefix") }} -j MASQUERADE
down /sbin/iptables -t nat -D POSTROUTING -s {{ lxc_host_ipv4_addr|ansible.utils.ipaddr("network/prefix") }} ! -o {{ lxc_host_bridge }} ! -d {{ lxc_host_ipv4_addr|ansible.utils.ipaddr("network/prefix") }} -j MASQUERADE