Add static routes
This commit is contained in:
parent
ee51a45afe
commit
9c11fc7a83
|
@ -15,7 +15,7 @@ iface {{OOBNET_NIC}} inet static
|
|||
{% endif %}
|
||||
|
||||
{% if autobgp_interfaces is defined %}
|
||||
{% for item in autobgp_interfaces %}
|
||||
{% for item in autobgp_interfaces %}
|
||||
|
||||
auto {{ item['name'] }}
|
||||
allow-hotplug {{ item['name'] }}
|
||||
|
@ -24,24 +24,28 @@ iface {{ item['name'] }} inet static
|
|||
{% if item['mtu'] is defined %}
|
||||
mtu {{ item['mtu'] }}
|
||||
{% endif %}
|
||||
{% if item['force10G'] is defined and item['force10G']|lower == "true" %}
|
||||
{% if item['force10G'] is defined and item['force10G']|lower == "true" %}
|
||||
#Force speed to 10G
|
||||
post-up sudo ethtool -s {{ item['name'] }} autoneg off
|
||||
post-up sudo ethtool -s {{ item['name'] }} speed 10000
|
||||
{% endif %}
|
||||
{% if item['force40G'] is defined and item['force40G']|lower == "true" %}
|
||||
{% endif %}
|
||||
{% if item['force40G'] is defined and item['force40G']|lower == "true" %}
|
||||
#Force speed to 40G
|
||||
pre-up sudo ethtool -s {{ item['name'] }} autoneg off
|
||||
pre-up sudo ethtool -s {{ item['name'] }} speed 40000
|
||||
{% endif %}
|
||||
{% if item['auto40G'] is defined and item['auto40G']|lower == "true" %}
|
||||
{% endif %}
|
||||
{% if item['auto40G'] is defined and item['auto40G']|lower == "true" %}
|
||||
#Auto speed
|
||||
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 %}
|
||||
{% endfor %}
|
||||
{% 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 %}
|
||||
|
||||
{% if addressed_interfaces is defined and addressed_interfaces != [] %}
|
||||
|
@ -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