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
7df343d3
Commit
7df343d3
authored
Dec 10, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow using first or last available address as gateway
parent
71b94c9e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
15 deletions
+8
-15
files/bridge-post-scripts/post-up.sh.j2
files/bridge-post-scripts/post-up.sh.j2
+7
-0
files/services/docker-compose.yml.j2
files/services/docker-compose.yml.j2
+0
-11
install.yaml
install.yaml
+1
-1
variables.yaml
variables.yaml
+0
-3
No files found.
files/bridge-post-scripts/post-up.sh.j2
View file @
7df343d3
...
@@ -25,6 +25,13 @@ handle_gateway() {
...
@@ -25,6 +25,13 @@ handle_gateway() {
GATEWAY_ADDRESS
=
$2
GATEWAY_ADDRESS
=
$2
GATEWAY_MAC
=
$3
GATEWAY_MAC
=
$3
GATEWAY_NEXT_HOP_MARK
=
$[$GATEWAY_ID
+ 1100]
GATEWAY_NEXT_HOP_MARK
=
$[$GATEWAY_ID
+ 1100]
BRIDGE_IP
=
$(
ip
-4
addr show dev
"
$BRIDGE_NAME
"
|
grep
'inet '
|
awk
'{print $2}'
)
if
[[
"
$GATEWAY_ADDRESS
"
-eq
"_use_first"
]]
;
then
GATEWAY_ADDRESS
=
$(
subnetcalc
"
$BRIDGE_IP
"
-n
|
grep
"Host Range"
|
awk
'{print $5}'
)
fi
if
[[
"
$GATEWAY_ADDRESS
"
-eq
"_use_last"
]]
;
then
GATEWAY_ADDRESS
=
$(
subnetcalc
"
$BRIDGE_IP
"
-n
|
grep
"Host Range"
|
awk
'{print $7}'
)
fi
ip route add default via
"
$GATEWAY_ADDRESS
"
table
"
$GATEWAY_NEXT_HOP_MARK
"
ip route add default via
"
$GATEWAY_ADDRESS
"
table
"
$GATEWAY_NEXT_HOP_MARK
"
ip route add default via
"
$GATEWAY_ADDRESS
"
metric
"
$GATEWAY_NEXT_HOP_MARK
"
ip route add default via
"
$GATEWAY_ADDRESS
"
metric
"
$GATEWAY_NEXT_HOP_MARK
"
ip rule add pref 100 fwmark
"
$GATEWAY_NEXT_HOP_MARK
"
lookup
"
$GATEWAY_NEXT_HOP_MARK
"
ip rule add pref 100 fwmark
"
$GATEWAY_NEXT_HOP_MARK
"
lookup
"
$GATEWAY_NEXT_HOP_MARK
"
...
...
files/services/docker-compose.yml.j2
View file @
7df343d3
...
@@ -24,14 +24,3 @@ services:
...
@@ -24,14 +24,3 @@ services:
RRTYPE: A
RRTYPE: A
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% for instance in services.tr069 %}
tr069-daemon-{{instance.interface}}:
restart: always
image: git-registry.mycard.moe/nanahira/tr069-daemon
network_mode: host
cap_add:
- NET_ADMIN
environment:
TRO69_INTERFACE: {{instance.interface}}
TABLE: {{instance.table}}
{% endfor %}
install.yaml
View file @
7df343d3
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
tasks
:
tasks
:
-
name
:
apt
-
name
:
apt
apt
:
apt
:
name
:
net-tools,bridge-utils,ifenslave,vlan,pppoe,iproute2,iptables,ipset
name
:
net-tools,bridge-utils,ifenslave,vlan,pppoe,iproute2,iptables,ipset
,subnetcalc
update_cache
:
true
update_cache
:
true
-
name
:
Ubuntu things
-
name
:
Ubuntu things
apt
:
apt
:
...
...
variables.yaml
View file @
7df343d3
...
@@ -75,9 +75,6 @@ vars:
...
@@ -75,9 +75,6 @@ vars:
-
114.114.114.114
-
114.114.114.114
-
223.5.5.5
-
223.5.5.5
services
:
services
:
tr069
:
-
interface
:
brtr069
# tr069 网卡名
table
:
305
# tr069 路由表id
ddns
:
ddns
:
-
name
:
test-ddns
-
name
:
test-ddns
email
:
name@example.com
# cf邮箱
email
:
name@example.com
# cf邮箱
...
...
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