Commit 3a31c34b authored by nanahira's avatar nanahira

order

parent 0984fdbd
...@@ -7,10 +7,12 @@ iptables -t mangle -F NEXTGEN_SWITCH ...@@ -7,10 +7,12 @@ iptables -t mangle -F NEXTGEN_SWITCH
{% for plan in routePlans %} {% for plan in routePlans %}
ip rule del pref 400 fwmark {{plan.destMark}} lookup {{plan.destMark}} ip rule del pref 400 fwmark {{plan.destMark}} lookup {{plan.destMark}}
restore_mark_switch -D {{plan.destMark}} restore_mark_switch -D {{plan.destMark}}
restore_mark_switch -D {{plan.destMark}}
{% endfor %} {% endfor %}
{% for gw in gateways %} {% for gw in gateways %}
{% if gw.selectionMark > 0 %} {% if gw.selectionMark > 0 %}
restore_mark_switch -D {{gw.selectionMark}} restore_mark_switch -D {{gw.selectionMark}}
restore_mark_switch -D {{gw.selectionMark}}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
......
#!/bin/bash #!/bin/bash
source {{ansible_user_dir}}/nextgen-network/scripts/utility.sh source {{ansible_user_dir}}/nextgen-network/scripts/utility.sh
## route plans ## route plans chnroute
{% for plan in routePlans %} {% for plan in routePlans %}
ip rule add pref 400 fwmark {{plan.destMark}} lookup {{plan.destMark}} ip rule add pref 400 fwmark {{plan.destMark}} lookup {{plan.destMark}}
interface_switch_chnroute -A u_{{plan.name}}_chnroute {{plan.destMark}} interface_switch_chnroute -A u_{{plan.name}}_chnroute {{plan.destMark}}
interface_switch -A u_{{plan.name}}_all {{plan.destMark}}
restore_mark_switch -A {{plan.destMark}} restore_mark_switch -A {{plan.destMark}}
{% endfor %} {% endfor %}
## local gateways ## local gateways chnroute
{% for gw in gateways %} {% for gw in gateways %}
{% if gw.selectionMark > 0 %} {% if gw.selectionMark > 0 %}
interface_switch_chnroute -A u_{{gw.isp}}_chnroute {{gw.selectionMark}} interface_switch_chnroute -A u_{{gw.isp}}_chnroute {{gw.selectionMark}}
interface_switch -A u_{{gw.isp}}_all {{gw.selectionMark}} restore_mark_switch -A {{gw.selectionMark}}
{% endif %}
{% endfor %}
## route plans
{% for plan in routePlans %}
interface_switch -A u_{{plan.name}} {{plan.destMark}}
restore_mark_switch -A {{plan.destMark}}
{% endfor %}
## local gateways
{% for gw in gateways %}
{% if gw.selectionMark > 0 %}
interface_switch-A u_{{gw.isp}}= {{gw.selectionMark}}
restore_mark_switch -A {{gw.selectionMark}} restore_mark_switch -A {{gw.selectionMark}}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
......
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