Commit 1d4a793b authored by nanahira's avatar nanahira

Merge branch 'master' of git.mycard.moe:mycard/network

parents e81dbce3 f22e74ae
# MyCard Network
SD-WAN that REALLY WORKS, even in China.
在现实世界中可以运作的 SD-WAN.
\ No newline at end of file
[defaults] [defaults]
host_key_checking = False host_key_checking = False
strategy_plugins = mitogen-0.2.9/ansible_mitogen/plugins/strategy strategy_plugins = mitogen-0.2.9/ansible_mitogen/plugins/strategy
strategy = mitogen_linear strategy = mitogen_free
...@@ -3,18 +3,19 @@ router id {{address}}; ...@@ -3,18 +3,19 @@ router id {{address}};
protocol device { protocol device {
} }
protocol direct { #protocol direct {
disabled; # disabled;
ipv4; # ipv4;
ipv6; # ipv6;
} #}
{% for interface in lan_interfaces %}
protocol direct { protocol direct {
ipv4 { ipv4;
import all;
};
ipv6; ipv6;
interface "{{interface}}";
} }
{% endfor %}
protocol kernel { protocol kernel {
ipv4 { ipv4 {
......
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
# conn: '{{item}}' # conn: '{{item}}'
# with_items: '{{ connections }}' # with_items: '{{ connections }}'
# when: "item.protocol == 'null'" # when: "item.protocol == 'null'"
- name: 'loop through list from a variable' # - name: 'loop through list from a variable'
include_tasks: 'protocols/{{item.protocol}}/configure.yaml' # include_tasks: 'protocols/{{item.protocol}}/configure.yaml'
vars: # vars:
conn: '{{item}}' # conn: '{{item}}'
with_items: '{{ connections }}' # with_items: '{{ connections }}'
# when: "item.protocol != 'null'" # when: "item.protocol != 'null'"
- name: 'frps' - name: 'frps'
include_tasks: 'protocols/wgfrp/frps.yaml' include_tasks: 'protocols/wgfrp/frps.yaml'
......
#!/usr/bin/env bash #!/usr/bin/env bash
{% for net in route_lists.mycard %}
ip rule del pref 299 to {{net}} lookup main
{% endfor %}
# 针对网关设置mark # 针对网关设置mark
{% for gateway in gateways %} {% for gateway in gateways %}
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
ipset restore -f /etc/wireguard/{{list}}.ipset ipset restore -f /etc/wireguard/{{list}}.ipset
{% endfor %} {% endfor %}
{% for net in route_lists.mycard %}
ip rule add pref 299 to {{net}} lookup main
{% endfor %}
# 针对网关设置mark # 针对网关设置mark
{% for gateway in gateways %} {% for gateway in gateways %}
......
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