diff --git a/static_iface.j2 b/static_iface.j2
index b242c1f6987d82c2eb6b0ef5feb755d2cd35b90e..27b46a7f7c2bed6c8c98cab9665c82c428d927bd 100644
--- a/static_iface.j2
+++ b/static_iface.j2
@@ -1,3 +1,4 @@
+auto {{ifname}}
 iface {{ifname}} inet static
     address {{ip}}
     netmask {{netmask}}
@@ -7,12 +8,14 @@ iface {{ifname}} inet static
 {% endif %}
 
 {% if type == "router" %}
+auto {{ifname2}}
 iface {{ifname2}} inet static
     address {{ip2}}
     netmask {{netmask}}
     {% if inventory_hostname == "R1" %}
-    post-up ip route add 3.0.0.0/24 nexthop via 2.0.0.2
+    post-up ip route add 3.0.0.0/24 nexthop via {{gateway}}
     {% else %}
-    post-up ip route add 1.0.0.0/24 nexthop via 2.0.0.1
+    post-up ip route add 1.0.0.0/24 nexthop via {{gateway}}
     {% endif %}
-{% endif %}
\ No newline at end of file
+{% endif %}
+