Commit d46abe3b authored by nanahira's avatar nanahira

add macvlan support

parent 1bd6ce0c
......@@ -2,6 +2,15 @@
source {{ansible_user_dir}}/nextgen-router/scripts/utility.sh
{% if br.macvlan is defined and br.macvlan %}
# macvlans
{% for link in br.links %}
# macvlan {{br.name}}-{{link | regex_replace('\.', '-')}} of {{link}}
ip link del dev {{br.name}}-{{link | regex_replace('\.', '-')}}
{% endfor %}
{% endif %}
{% if br.linkDown is defined and br.linkDown %}
{{br.linkDown}}
{% endif %}
......
......@@ -2,6 +2,16 @@
source {{ansible_user_dir}}/nextgen-router/scripts/utility.sh
{% if br.macvlan is defined and br.macvlan %}
# macvlans
{% for link in br.links %}
# macvlan {{br.name}}-{{link | regex_replace('\.', '-')}} of {{link}}
ip link add link {{link}} dev {{br.name}}-{{link | regex_replace('\.', '-')}} type macvlan
ip link set {{br.name}}-{{link | regex_replace('\.', '-')}} up
{% endfor %}
{% endif %}
{% if br.linkUp is defined and br.linkUp %}
{{br.linkUp}}
{% endif %}
......
......@@ -69,7 +69,7 @@ auto {{br.name}}
allow-hotplug {{br.name}}
iface {{br.name}} inet {{br.type}}
{% if br.links is defined and br.links and br.links | length > 0 %}
bridge_ports{% for link in br.links %} {{link}}{% endfor %}
bridge_ports{% for link in br.links %} {% if br.macvlan is defined and br.macvlan %}{{br.name}}-{{link | regex_replace('\.', '-')}}{% else %}{{link}}{% endif %}{% endfor %}
{% else %}
bridge_ports none
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment