iptables: Use correct interface for correct side

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
This commit is contained in:
Patrick Uiterwijk 2019-03-29 00:32:15 +01:00
parent 03f9a74f8d
commit 418c704a49

View file

@ -104,9 +104,9 @@
{% for port in proxy_tcp_ports %}
{% for proxy in (groups['proxies'] + groups['proxies-internal']) %}
{% if hostvars[proxy]['datacenter'] == "phx2" %}
-A INPUT -p tcp -m tcp --dport {{ port }} --src {{ hostvars[proxy]['ansible_tun0']['ipv4']['address'] }} -j ACCEPT
{% else %}
-A INPUT -p tcp -m tcp --dport {{ port }} --src {{ hostvars[proxy]['ansible_eth0']['ipv4']['address'] }} -j ACCEPT
{% else %}
-A INPUT -p tcp -m tcp --dport {{ port }} --src {{ hostvars[proxy]['ansible_tun0']['ipv4']['address'] }} -j ACCEPT
{% endif %}
{% endfor %}
{% endfor %}