Commit 0913e5e8 authored by nanahira's avatar nanahira

better change mac address

parent b1be5af4
...@@ -3,11 +3,4 @@ ...@@ -3,11 +3,4 @@
source {{ansible_user_dir}}/nextgen-router/scripts/utility.sh source {{ansible_user_dir}}/nextgen-router/scripts/utility.sh
export BRIDGE_NAME={{br.name}} export BRIDGE_NAME={{br.name}}
{% if br.mac is defined and br.mac %}
# Change mac
export BRIDGE_MAC={{br.mac}}
export BR
ip link set "$BRIDGE_NAME" address "$BRIDGE_MAC"
{% endif %}
true true
...@@ -7,12 +7,6 @@ export BRIDGE_NAME={{br.name}} ...@@ -7,12 +7,6 @@ export BRIDGE_NAME={{br.name}}
export BRIDGE_ADDRESS={{br.address}} export BRIDGE_ADDRESS={{br.address}}
{% endif %} {% endif %}
{% if br.mac is defined and br.mac %}
# Change mac
export BRIDGE_MAC={{br.mac}}
# ip link set "$BRIDGE_NAME" address "$BRIDGE_MAC"
{% endif %}
{% if br.moreAddresses is defined and br.moreAddresses %} {% if br.moreAddresses is defined and br.moreAddresses %}
# Add more addresses # Add more addresses
{% for address in br.moreAddresses %} {% for address in br.moreAddresses %}
......
...@@ -20,11 +20,4 @@ ip link set {{br.name}}{{link | regex_replace('\.', '')}} up ...@@ -20,11 +20,4 @@ ip link set {{br.name}}{{link | regex_replace('\.', '')}} up
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if br.mac is defined and br.mac %}
# Change mac
export BRIDGE_MAC={{br.mac}}
# ip link set "$BRIDGE_NAME" address "$BRIDGE_MAC"
{% endif %}
true true
...@@ -3,10 +3,4 @@ ...@@ -3,10 +3,4 @@
source {{ansible_user_dir}}/nextgen-router/scripts/utility.sh source {{ansible_user_dir}}/nextgen-router/scripts/utility.sh
export BRIDGE_NAME={{br.name}} export BRIDGE_NAME={{br.name}}
{% if br.mac is defined and br.mac %}
# Change mac
export BRIDGE_MAC={{br.mac}}
ip link set "$BRIDGE_NAME" address "$BRIDGE_MAC"
{% endif %}
true true
...@@ -104,6 +104,9 @@ metric {{ 1100 + br.gateways[0].id }} ...@@ -104,6 +104,9 @@ metric {{ 1100 + br.gateways[0].id }}
metric 9999 metric 9999
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if br.mac is defined and br.mac %}
hwaddress ether {{br.mac}}
{% endif %}
pre-up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-up.sh pre-up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/pre-up.sh
up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/up.sh up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/up.sh
post-up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/post-up.sh post-up {{ansible_user_dir}}/nextgen-router/scripts/{{br.name}}/post-up.sh
......
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