Add static routes
This commit is contained in:
parent
ee51a45afe
commit
9c11fc7a83
|
@ -39,7 +39,11 @@ iface {{ item['name'] }} inet static
|
|||
pre-up sudo /bin/ip link set down {{ item['name'] }} && sleep 1
|
||||
pre-up sudo ethtool -s {{ item['name'] }} speed 40000 duplex full autoneg on
|
||||
post-up sudo /bin/ip link set up {{ item['name'] }}
|
||||
|
||||
{% endif %}
|
||||
{% if item['routes'] is defined %}
|
||||
{% for route in item['routes'] %}
|
||||
up ip route add {{ route['network'] } via {{ route['gateway'] } || true
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
@ -61,6 +65,11 @@ iface {{ item['name'] }} inet static
|
|||
post-up sudo ethtool -s {{ item['name'] }} autoneg off
|
||||
post-up sudo ethtool -s {{ item['name'] }} speed 10000
|
||||
{% endif %}
|
||||
{% if item['routes'] is defined %}
|
||||
{% for route in item['routes'] %}
|
||||
up ip route add {{ route['network'] } via {{ route['gateway'] } || true
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
@ -89,6 +98,12 @@ auto {{ item['name'] }}
|
|||
bond-mode active-backup
|
||||
bond-miimon 100
|
||||
bond-slaves none
|
||||
{% if item['routes'] is defined %}
|
||||
{% for route in item['routes'] %}
|
||||
up ip route add {{ route['network'] } via {{ route['gateway'] } || true
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
@ -110,6 +125,12 @@ iface {{ item['name'] }} inet static
|
|||
mtu {{ item['mtu'] }}
|
||||
{% endif %}
|
||||
vlan-raw-device {{ item['vlan-raw-device'] }}
|
||||
{% if item['routes'] is defined %}
|
||||
{% for route in item['routes'] %}
|
||||
up ip route add {{ route['network'] } via {{ route['gateway'] } || true
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue