Commit 0b36f463 authored by nanahira's avatar nanahira

super simplify switch rules down

parent 3e77dadd
#!/bin/bash
source {{ansible_user_dir}}/nextgen-network/scripts/utility.sh
## chnroute
{% for plan in routePlans %}
interface_switch_chnroute -D u_{{plan.name}}_chnroute {{plan.destMark}}
{% endfor %}
{% for gw in gateways %}
{% if gw.selectionMark > 0 %}
interface_switch_chnroute -D u_{{gw.isp}}_chnroute {{gw.selectionMark}}
{% endif %}
{% endfor %}
## all
{% for plan in routePlans %}
interface_switch -D u_{{plan.name}}_all {{plan.destMark}}
{% endfor %}
{% for gw in gateways %}
{% if gw.selectionMark > 0 %}
interface_switch -D u_{{gw.isp}}_all {{gw.selectionMark}}
{% endif %}
{% endfor %}
## restore mark
{% for plan in routePlans %}
ip rule del pref 400 fwmark {{plan.destMark}} lookup {{plan.destMark}}
restore_mark_switch -D {{plan.destMark}}
{% endfor %}
{% for gw in gateways %}
{% if gw.selectionMark > 0 %}
restore_mark_switch -D {{gw.selectionMark}}
{% endif %}
{% endfor %}
iptables -F NEXTGEN_SWITCH
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