{% set iface_names = [] %}
{% for iface in salt['grains.get']('ip6_interfaces', {}) %}
{% if 'eth' in iface and salt['grains.get']('ip6_interfaces:' + iface, [])|length > 0 %}
{% do iface_names.append(iface) %}
{% endif %}
{% endfor -%}

{%- if iface_names|length == 1 %}
{% set iface = iface_names[0] %}
{% else %}
{% set iface = salt['grains.get']('data:iface_name', 'eth0') %}
{% endif -%}
auto lo {{ iface }}
iface lo inet loopback

iface {{ iface }} inet6 auto
  privext 0
  mtu 8950
  post-up ifconfig {{ iface }} mtu 8950
  ya-netconfig-fb-disable YES
  ya-netconfig-bb-disable YES
  pre-up ethtool -K eth0 tso off; if lsmod | grep -qE "e1000|igb"; then ethtool -G eth0 rx 4096 tx 4096; fi; true
{% if salt['pillar.get']('data:sharpei') %}
  ya-slb-tun YES
  ya-slb6-tun YES
{% endif %}
