summaryrefslogtreecommitdiffstats
path: root/vm/vagrant-router/router.yml
diff options
context:
space:
mode:
Diffstat (limited to 'vm/vagrant-router/router.yml')
-rw-r--r--vm/vagrant-router/router.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/vm/vagrant-router/router.yml b/vm/vagrant-router/router.yml
new file mode 100644
index 0000000..68b914e
--- /dev/null
+++ b/vm/vagrant-router/router.yml
@@ -0,0 +1,16 @@
+ - name: Configure router
+ hosts: router
+ remote_user: root
+
+ tasks:
+ - name: IP Forwarding
+ sysctl: name="net.ipv4.ip_forward" value="1" sysctl_set="yes" reload="yes"
+
+ - name: DNAT / eth1
+ iptables: table="nat" chain="PREROUTING" in_interface="eth1" jump="DNAT" to_destination="192.168.26.1"
+
+ - name: DNAT / eth2
+ iptables: table="nat" chain="PREROUTING" in_interface="eth2" jump="DNAT" to_destination="192.168.26.1"
+
+ - name: SNAT
+ iptables: table="nat" chain="POSTROUTING" out_interface="eth3" jump="SNAT" to_source="192.168.26.254"