Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
nextgen-router
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
nextgen-router
Commits
3e36a23f
Commit
3e36a23f
authored
Dec 09, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename dhcpv6 vars
parent
fa0468de
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
10 deletions
+40
-10
files/bridge-post-scripts/post-up.sh.j2
files/bridge-post-scripts/post-up.sh.j2
+10
-0
files/dnsmasq/dnsmasq.conf.j2
files/dnsmasq/dnsmasq.conf.j2
+1
-1
files/ppp-post-scripts/postup.sh.j2
files/ppp-post-scripts/postup.sh.j2
+1
-1
files/services/docker-compose.yml.j2
files/services/docker-compose.yml.j2
+23
-5
variables.yaml
variables.yaml
+5
-3
No files found.
files/bridge-post-scripts/post-up.sh.j2
View file @
3e36a23f
...
...
@@ -43,6 +43,16 @@ handle_gateway {{gateway.id}} {{gateway.address}}
iptables
-t
nat
-A
POSTROUTING
-o
"
$BRIDGE_NAME
"
-j
MASQUERADE
{
% endif %
}
{
%
if
br.dhcpv6Client %
}
# Restart dhcpv6
cd
{{
ansible_user_dir
}}
/nextgen-router/services/others
{
%
for
targetbr
in
bridges %
}
{
%
if
targetbr.dhcpv6Receive %
}
docker-compose restart dhcpv6-
{{
br.name
}}
-
{{
targetbr.name
}}
{
% endif %
}
{
% endfor %
}
{
% endif %
}
{
%
if
br.up %
}
{{
br.up
}}
{
% endif %
}
files/dnsmasq/dnsmasq.conf.j2
View file @
3e36a23f
...
...
@@ -18,7 +18,7 @@ no-dhcp-interface=lo{% for br in bridges %}{% if not br.dhcp %},{{br.name}}{% en
dhcp-range={{br.name}},{{br.dhcp.start}},{{br.dhcp.end}},{{br.dhcp.time}}
{% if br.dhcpv6 %}
{% if br.dhcpv6
Receive
%}
dhcp-range=tag:{{br.name}},::,constructor:{{br.name}},ra-names,24h
{% endif %}
...
...
files/ppp-post-scripts/postup.sh.j2
View file @
3e36a23f
...
...
@@ -22,7 +22,7 @@ if [[ "$?" == 0 ]]; then
cd
{{
ansible_user_dir
}}
/nextgen-router/services/others
{
%
for
br
in
bridges %
}
{
%
if
br.dhcpv6 %
}
{
%
if
br.dhcpv6
Receive
%
}
docker-compose restart dhcpv6-
$PPP_IFACE
-
{{
br.name
}}
{
% endif %
}
{
% endfor %
}
...
...
files/services/docker-compose.yml.j2
View file @
3e36a23f
version: '2.4'
services:
dummy:
image: alpine
command: sleep infinity
lldpd:
restart: always
image: git-registry.mycard.moe/nanahira/docker-lldp
network_mode: host
{% for ppp in ppps %}
{% if ppp.dhcpv6 %}
{% if ppp.dhcpv6
Client
%}
{% for br in bridges %}
{% if br.dhcpv6 %}
{% if br.dhcpv6
Receive
%}
dhcpv6-ppp{{ppp.id}}-{{br.name}}:
restart: always
image: git-registry.mycard.moe/nanahira/docker-dhcpv6-client
...
...
@@ -20,6 +21,23 @@ services:
{% 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
...
...
variables.yaml
View file @
3e36a23f
...
...
@@ -31,7 +31,8 @@ vars:
up
:
echo "up"
# 启动脚本和关闭脚本
down
:
echo "down"
mac
:
null
# 自定义mac地址,否则bridge随机,注意dhcp会以原始mac请求dhcp,因此不建议dhcp模式使用
dhcpv6
:
true
# DHCPv6落脚点,只能有1个LAN获得
dhcpv6Client
:
false
# 是否进行 dhcpv6 请求
dhcpv6Receive
:
true
# DHCPv6得到的地址的落脚点,只能有1个LAN获得
dhcp
:
# 是否开启dhcp,不是的话直接没有这一栏
start
:
10.0.0.100
end
:
10.0.0.240
...
...
@@ -49,14 +50,15 @@ vars:
up
:
null
down
:
null
mac
:
null
ipv6
:
false
dhcpv6Client
:
false
dhcpv6Receive
:
false
dhcp
:
null
ppps
:
-
id
:
0
# ppp id,例如0代表ppp0
link
:
bond0.41
# 上行链路
username
:
user
# 拨号用户名,密码在pppoeUsers给出
mac
:
null
# 给ISP看的mac地址,null为随机
dhcpv6
:
false
# 使用这里的DHCPv6,所有ppp只能有1个
dhcpv6
Client
:
false
# 使用这里的DHCPv6,所有ppp只能有1个
pppoeUsers
:
# PPPoE帐号
-
username
:
user
password
:
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment