summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ansible/roles/router/files/interfaces-eth1-eth211
-rw-r--r--ansible/roles/router/tasks/main.yml8
2 files changed, 19 insertions, 0 deletions
diff --git a/ansible/roles/router/files/interfaces-eth1-eth2 b/ansible/roles/router/files/interfaces-eth1-eth2
new file mode 100644
index 0000000..ec57997
--- /dev/null
+++ b/ansible/roles/router/files/interfaces-eth1-eth2
@@ -0,0 +1,11 @@
+auto eth1
+iface eth1 inet static
+ address 10.0.0.2
+ netmask 255.255.255.0
+ gateway 10.0.0.255
+
+auto eth2
+iface eth2 inet static
+ address 10.0.0.3
+ netmask 255.255.255.0
+ gateway 10.0.0.255
diff --git a/ansible/roles/router/tasks/main.yml b/ansible/roles/router/tasks/main.yml
index 3c95278..2bfaa99 100644
--- a/ansible/roles/router/tasks/main.yml
+++ b/ansible/roles/router/tasks/main.yml
@@ -14,6 +14,14 @@
name: ferm
state: restarted
+- name: configure eth1 and eth2
+ copy:
+ src: interfaces-eth1-eth2
+ dest: /etc/network/interfaces.d
+
+- name: bring up eth1 and eth2
+ shell: ifup eth1 eth2
+
- name: set up packet forwarding sysctl config
copy:
src: enable-routing.conf