From 2b3efa623720cc06c8b09a101970630903b8a75b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 8 Sep 2016 16:13:41 +0300 Subject: Bring up eth1, eth2 on router box --- ansible/roles/router/files/interfaces-eth1-eth2 | 11 +++++++++++ ansible/roles/router/tasks/main.yml | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 ansible/roles/router/files/interfaces-eth1-eth2 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 -- cgit v1.2.1