diff options
author | Christian Pointner <equinox@spreadspace.org> | 2019-10-02 20:03:43 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2019-10-02 20:03:43 +0200 |
commit | cd46ebf17b7fba2c3f6cad1e7c2cf8b4edf3ada5 (patch) | |
tree | f59e09a540d81c0c0c4da4646b1cf99575259b50 /roles | |
parent | sk-2019vm can run machines now (diff) |
fix vmhost network configs
Diffstat (limited to 'roles')
-rw-r--r-- | roles/vm/host/tasks/network.yml | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/roles/vm/host/tasks/network.yml b/roles/vm/host/tasks/network.yml index 7ce3de45..16fe9314 100644 --- a/roles/vm/host/tasks/network.yml +++ b/roles/vm/host/tasks/network.yml @@ -19,6 +19,8 @@ up /sbin/sysctl net.bridge.bridge-nf-call-ip6tables=0 up /sbin/sysctl net.bridge.bridge-nf-call-arptables=0 {% if 'nat' in vm_host.network and vm_host.network.nat %} + up echo 1 > /proc/sys/net/ipv4/conf/$IFACE/forwarding + up echo 1 > /proc/sys/net/ipv4/conf/{{ ansible_default_ipv4.interface }}/forwarding up /usr/sbin/iptables -t nat -A POSTROUTING -o {{ ansible_default_ipv4.interface }} -s {{ vm_host.network.prefix | ipaddr('network/prefix') }} -j SNAT --to {{ ansible_default_ipv4.address }} down /usr/sbin/iptables -t nat -D POSTROUTING -o {{ ansible_default_ipv4.interface }} -s {{ vm_host.network.prefix | ipaddr('network/prefix') }} -j SNAT --to {{ ansible_default_ipv4.address }} {% endif %} |