Commit 71b94c9e authored by nanahira's avatar nanahira

update dhcpv6

parent 034e07e9
......@@ -46,10 +46,10 @@ iptables -t nat -A POSTROUTING -o "$BRIDGE_NAME" -j MASQUERADE
{% if br.dhcpv6Client %}
# Restart dhcpv6
cd {{ansible_user_dir}}/nextgen-router/services/others
cd {{ansible_user_dir}}/nextgen-router/services/dhcpv6
{% for targetbr in bridges %}
{% if targetbr.dhcpv6Receive %}
docker-compose restart dhcpv6-{{br.name}}-{{targetbr.name}}
docker-compose up -d --force-recreate dhcpv6-{{br.name}}-{{targetbr.name}}
{% endif %}
{% endfor %}
{% endif %}
......
version: '2.4'
services:
{% for ppp in ppps %}
{% if ppp.dhcpv6Client %}
{% for br in bridges %}
{% if br.dhcpv6Receive %}
dhcpv6-ppp{{ppp.id}}-{{br.name}}:
image: git-registry.mycard.moe/nanahira/docker-dhcpv6-client
network_mode: host
cap_add:
- NET_ADMIN
environment:
WAN_INTERFACE: ppp{{ppp.id}}
LAN_INTERFACE: {{br.name}}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% for srcbr in bridges %}
{% if srcbr.dhcpv6Client %}
{% for br in bridges %}
{% if br.dhcpv6Receive %}
dhcpv6-{{srcbr.name}}-{{br.name}}:
restart: always
image: git-registry.mycard.moe/nanahira/docker-dhcpv6-client
network_mode: host
cap_add:
- NET_ADMIN
environment:
WAN_INTERFACE: {{srcbr.name}}
LAN_INTERFACE: {{br.name}}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
......@@ -20,10 +20,10 @@ if [[ "$?" == 0 ]]; then
ip -6 route add default dev "$PPP_IFACE" metric $INIT_ID
ip -6 rule add pref 100 fwmark $INIT_ID lookup $INIT_ID
cd {{ansible_user_dir}}/nextgen-router/services/others
cd {{ansible_user_dir}}/nextgen-router/services/dhcpv6
{% for br in bridges %}
{% if br.dhcpv6Receive %}
docker-compose restart dhcpv6-$PPP_IFACE-{{br.name}}
docker-compose up -d --force-recreate dhcpv6-$PPP_IFACE-{{br.name}}
{% endif %}
{% endfor %}
fi
......
......@@ -4,39 +4,6 @@ services:
restart: always
image: git-registry.mycard.moe/nanahira/docker-lldp
network_mode: host
{% for ppp in ppps %}
{% if ppp.dhcpv6Client %}
{% for br in bridges %}
{% if br.dhcpv6Receive %}
dhcpv6-ppp{{ppp.id}}-{{br.name}}:
image: git-registry.mycard.moe/nanahira/docker-dhcpv6-client
network_mode: host
cap_add:
- NET_ADMIN
environment:
WAN_INTERFACE: ppp{{ppp.id}}
LAN_INTERFACE: {{br.name}}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% for srcbr in bridges %}
{% if srcbr.dhcpv6Client %}
{% for br in bridges %}
{% if br.dhcpv6Receive %}
dhcpv6-{{srcbr.name}}-{{br.name}}:
restart: always
image: git-registry.mycard.moe/nanahira/docker-dhcpv6-client
network_mode: host
cap_add:
- NET_ADMIN
environment:
WAN_INTERFACE: {{srcbr.name}}
LAN_INTERFACE: {{br.name}}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% for instance in services.ddns %}
ddns-{{instance.name}}:
restart: always
......
......@@ -39,6 +39,7 @@
with_items:
- git-registry.mycard.moe/nanahira/docker-smartdns
- git-registry.mycard.moe/nanahira/dnsmasq
- git-registry.mycard.moe/nanahira/docker-dhcpv6-client
handlers:
- name: load_modules
shell: 'modprobe {{item}}'
......
......@@ -121,6 +121,15 @@
{% for br in bridges %}
net.ipv6.conf.{{br.name}}.accept_ra = 2
{% endfor %}
- name: dhcpv6 directory
file:
name: '{{ansible_user_dir}}/nextgen-router/services/dhcpv6'
state: directory
recurse: true
- name: dhcpv6 docker-compose
template:
src: ./files/dhcpv6/docker-compose.yml.j2
dest: '{{ansible_user_dir}}/nextgen-router/services/dhcpv6/docker-compose.yml'
- name: dnsmasq directory
file:
name: '{{ansible_user_dir}}/nextgen-router/services/dnsmasq/{{item}}'
......
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