role.prepare_lxc_host/templates/etc/network/interfaces.d/bridge.j2

10 lines
561 B
Plaintext
Raw Permalink Normal View History

2024-03-12 20:39:29 +00:00
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