12345678910111213141516171819202122232425262728 |
- auto {{ item.name }}
- iface {{ item.name }} inet6 manual
- pre-up ip link add {{ item.name }} type dummy
- {% if item.ipv4 is defined %}{% for ip in item.ipv4 %}
- up ip addr add dev {{ item.name }} {{ ip }}/32
- {% endfor %}{% endif %}
- {% if item.ipv6 is defined %}{% for ip in item.ipv6 %}
- up ip addr add dev {{ item.name }} {{ ip }}/128
- {% endfor %}{% endif %}
- post-down ip link del {{ item.name }}
- {% if item.routes is defined %}{% for route in item.routes %}
- post-up ip route add {{ route.target }} {{ route.prefix }} proto static
- pre-down ip route del {{ route.target }} {{ route.prefix }} proto static
- {% endfor %}{% endif %}
- {% if item.rules is defined %}{% for rule in item.rules %}
- {% if rule.proto == "ipv4" %}
- post-up ip rule add {{ rule.selector }} {{ rule.action }}
- pre-down ip rule del {{ rule.selector }} {{ rule.action }}
- {% else %}
- post-up ip -6 rule add {{ rule.selector }} {{ rule.action }}
- pre-down ip -6 rule del {{ rule.selector }} {{ rule.action }}
- {% endif %}
- {% endfor %}{% endif %}
|