Commit db7072dd authored by nanahira's avatar nanahira

inbound metric

parent 523d202d
...@@ -12,7 +12,11 @@ local-port-readwrite 33123 ...@@ -12,7 +12,11 @@ local-port-readwrite 33123
{% for connection in connections %} {% for connection in connections %}
{% if connection.protocol != "null" and not (connection.protocol == "oc" and connection.ocType == "server") and connection.remoteLocalAddress != address %} {% if connection.protocol != "null" and not (connection.protocol == "oc" and connection.ocType == "server") and connection.remoteLocalAddress != address %}
{% if connection.inbound %}
interface {{connection.name}} type tunnel rxcost {{connection.metric}} faraway true rtt-max 500 interface {{connection.name}} type tunnel rxcost {{connection.metric}} faraway true rtt-max 500
{% else %}
interface {{connection.name}} type tunnel rxcost 50000 faraway true rtt-max 500
{% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
......
...@@ -9,3 +9,8 @@ export remoteNextMark={{conn.remoteNextMark}} ...@@ -9,3 +9,8 @@ export remoteNextMark={{conn.remoteNextMark}}
export inbound={{conn.inbound}} export inbound={{conn.inbound}}
export outbound={{conn.outbound}} export outbound={{conn.outbound}}
export mtu={{conn.mtu|int - 58}} export mtu={{conn.mtu|int - 58}}
{% if conn.inbound %}
export metric={{conn.metric}}
{% else %}
export metric=50000
{% endif %}
...@@ -19,6 +19,6 @@ ip addr del "$localRubbishAddress" dev "$dev" ...@@ -19,6 +19,6 @@ ip addr del "$localRubbishAddress" dev "$dev"
{{ansible_user_dir}}/nextgen-network/scripts/predown.sh {{ansible_user_dir}}/nextgen-network/scripts/predown.sh
{{ansible_user_dir}}/nextgen-network/scripts/postup.sh {{ansible_user_dir}}/nextgen-network/scripts/postup.sh
echo -e "interface $dev type tunnel rxcost 300 faraway true rtt-max 500 \nquit" | nc ::1 33123 echo -e "interface $dev type tunnel rxcost $metric faraway true rtt-max 500 \nquit" | nc ::1 33123
true true
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