sonic-buildimage/files/image_config/interfaces/interfaces.j2
Oleksandr Ivantsiv 34ea91349c one image implementation (#215)
* Single image

* Fix review comments

* Update syncd service. Add HW mgmt to Mellanox single image.

* Add single image template for Broadcom platform.

SKU should be provided during configure:
make configure PLATFORM=broadcom SKU=Force10-S6000

* Add single image template for Cavium platform.

SKU should be provided during configure:
make configure PLATFORM=cavium SKU=AS7512

* Add description to sonic_debian_extension.j2 file.
2017-01-29 11:33:33 -08:00

51 lines
1.8 KiB
Django/Jinja

#
{% block banner %}
# =========== Managed by config engine DO NOT EDIT! ========================
# generated by templates/interfaces.j2 using sonic-cfggen
# file: interfaces
{% endblock %}
#
{% block loopback %}
# The loopback network interface
auto lo
iface lo inet loopback
# Use command 'ip addr list dev lo' to check all addresses
{% for minigraph_lo_interface in minigraph_lo_interfaces %}
iface lo {{ 'inet' if minigraph_lo_interface['addr'] | ipv4 else 'inet6' }} static
address {{ minigraph_lo_interface['addr'] }}
netmask {{ minigraph_lo_interface['mask'] }}
#
{% endfor %}
{% endblock loopback %}
#
{% block mgmt_interface %}
# The management network interface
auto eth0
{% if minigraph_mgmt_interface['addr'] %}
iface eth0 inet static
address {{ minigraph_mgmt_interface['addr'] }}
netmask {{ minigraph_mgmt_interface['mask'] }}
################ management network policy routing rules
#### management port up rules"
up ip route add default via {{ minigraph_mgmt_interface['gwaddr'] }} dev eth0 table default
up ip rule add from {{ minigraph_mgmt_interface['addr'] }}/32 table default
#### management port down rules"
down ip route delete default via {{ minigraph_mgmt_interface['gwaddr'] }} dev eth0 table default
down ip rule delete from {{ minigraph_mgmt_interface['addr'] }}/32 table default
{# TODO: COPP policy type rules #}
{% else %}
iface eth0 inet dhcp
{% endif %}
{% endblock mgmt_interface %}
#
{% block front_panel_interface %}
# The switch front panel interfaces
{% for interface in minigraph_interfaces %}
auto {{ interface['alias'] }}
iface {{ interface['alias'] }} {{ 'inet' if interface['addr'] | ipv4 else 'inet6' }} static
address {{ interface['addr'] }}
netmask {{ interface['mask'] }}
#
{% endfor %}
{% endblock front_panel_interface %}