Commit 5614e835 authored by nanahira's avatar nanahira

fix initialize and resolv

parent 27802c5a
...@@ -12,7 +12,7 @@ restore_mark() { ...@@ -12,7 +12,7 @@ restore_mark() {
} }
ppp_origin() { ppp_origin() {
initialize_ipset initialize
OPTION=$1 OPTION=$1
INTERFACE=$2 INTERFACE=$2
MARK=$[1000 + $(echo "$INTERFACE" | sed "s/ppp//g")] MARK=$[1000 + $(echo "$INTERFACE" | sed "s/ppp//g")]
...@@ -21,19 +21,22 @@ ppp_origin() { ...@@ -21,19 +21,22 @@ ppp_origin() {
# ip6tables -t mangle "$OPTION" PREROUTING ! -p ospf -i "$INTERFACE" -j CONNMARK --set-xmark "$MARK" # ip6tables -t mangle "$OPTION" PREROUTING ! -p ospf -i "$INTERFACE" -j CONNMARK --set-xmark "$MARK"
} }
initialize_ipset() { initialize_process() {
ipset restore -f {{ansible_user_dir}}/nextgen-router/localnet-ipset && \
{% for subnet in localnets %} {% for subnet in localnets %}
ip rule add pref 80 to {{subnet}} lookup main && \ ip rule add pref 80 to {{subnet}} lookup main
{% endfor %} {% endfor %}
ip rule add pref 80 to 172.16.0.0/12 lookup main && \ ip rule add pref 80 to 172.16.0.0/12 lookup main
iptables-restore --noflush {{ansible_user_dir}}/iptables-gateways && \ arp -f
arp -f }
initialize() {
ipset restore -f {{ansible_user_dir}}/nextgen-router/localnet-ipset && \
initialize_process
true true
} }
eth_origin() { eth_origin() {
initialize_ipset initialize
OPTION=$1 OPTION=$1
BRIDGE_NAME=$2 BRIDGE_NAME=$2
GATEWAY_ID=$3 GATEWAY_ID=$3
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
file: file:
name: /etc/ethers name: /etc/ethers
state: touch state: touch
changed_when: false
- name: clean some rubbish packages - name: clean some rubbish packages
become: true become: true
apt: apt:
...@@ -46,6 +47,7 @@ ...@@ -46,6 +47,7 @@
file: file:
name: '{{ansible_user_dir}}/iptables-gateways' name: '{{ansible_user_dir}}/iptables-gateways'
state: touch state: touch
changed_when: false
- name: iptables-gateways stuff - name: iptables-gateways stuff
copy: copy:
src: ./files/iptables-gateways/{{item}} src: ./files/iptables-gateways/{{item}}
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
nameserver 127.0.0.1 nameserver 127.0.0.1
{% for br in bridges %} {% for br in bridges %}
{% if not (br.masq is defined and br.masq) and br.address is defined and br.address %} {% if not (br.masq is defined and br.masq) and br.address is defined and br.address %}
nameserver {{ br.address | regex_replace("/\d+$", "") }} # nameserver {{ br.address | regex_replace("/\d+$", "") }}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% for dns in smartdns.china_dns %} {% for dns in smartdns.china_dns %}
......
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