Commit 5614e835 authored by nanahira's avatar nanahira

fix initialize and resolv

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