Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tun
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
Railgun
tun
Commits
70dd9505
Commit
70dd9505
authored
Dec 20, 2020
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
babeld
parent
e653df69
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
79 deletions
+43
-79
ansible/babeld.conf.j2
ansible/babeld.conf.j2
+20
-0
ansible/bird.conf.j2
ansible/bird.conf.j2
+2
-79
ansible/configure.yaml
ansible/configure.yaml
+13
-0
src/inventory.ts
src/inventory.ts
+8
-0
No files found.
ansible/babeld.conf.j2
0 → 100644
View file @
70dd9505
# MyCard babeld
debug 1
# router-id 00:00:00:00:00:00:00:03
redistribute local ip 10.198.0.0/24
{% for interface in lanInterfaces %}
redistribute if {{interface}}
{% endfor %}
redistribute local deny
reflect-kernel-metric true
{% for connection in connections %}
{% if connection.protocol != "null" and connection.remoteLocalAddress != address %}
interface {{connection.name}} type tunnel rxcost {{connection.metric}} faraway true rtt-max 500
{% endif %}
{% endfor %}
{% for interface in lanInterfaces %}
interface {{interface}}
{% endfor %}
ansible/bird.conf.j2
View file @
70dd9505
...
@@ -4,31 +4,12 @@
...
@@ -4,31 +4,12 @@
log stderr all;
log stderr all;
router id {{address}};
router id {{address}};
protocol device {
protocol device {}
}
#protocol direct {
# disabled;
# ipv4;
# ipv6;
#}
{% for interface in lanInterfaces %}
protocol direct {
ipv4;
ipv6;
interface "{{interface}}";
}
{% endfor %}
protocol kernel {
protocol kernel {
ipv4 {
ipv4 {
export where net != 0.0.0.0/0
;
import all
;
};
};
persist;
#kernel table main;
}
protocol kernel {
ipv6 { export all; };
}
}
{% for plan in routePlans %}
{% for plan in routePlans %}
...
@@ -49,61 +30,3 @@ protocol kernel {
...
@@ -49,61 +30,3 @@ protocol kernel {
kernel table {{plan.destMark}};
kernel table {{plan.destMark}};
}
}
{% endfor %}
{% endfor %}
protocol ospf v2 {
ipv4 {
import all;
export where source ~ [ RTS_DEVICE, RTS_STATIC ];
};
area 0 {
networks {
{% for subnet in routeLists.mycard %}
{{subnet}};
{% endfor %}
};
# interface "eth*" {
# type broadcast; # Detected by default
# cost 10; # Interface metric
# hello 5; # Default hello perid 10 is too long
# };
{% for connection in connections %}
{% if connection.protocol != "null" and not (connection.protocol == "oc" and connection.ocType == "server") and connection.remoteLocalAddress != address %}
interface "{{connection.name}}" {
type ptmp;
{% if connection.outbound %}
cost {{connection.metric}};
{% else %}
cost 50000;
{% endif %}
hello 5;
authentication cryptographic;
password "{{ospfToken}}";
};
{% endif %}
{% endfor %}
{% if ocservNeeded %}
interface "mcoc*" {
type ptmp;
cost {{ocMetric}};
hello 5;
authentication cryptographic;
password "{{ospfToken}}";
};
{% endif %}
{% for interface in lanInterfaces %}
interface "{{interface}}" {
type broadcast;
cost 1;
hello 5;
authentication cryptographic;
password "{{ospfToken}}";
};
{% endfor %}
interface "dummy0" {
stub; # Stub interface, just propagate it
};
};
}
ansible/configure.yaml
View file @
70dd9505
...
@@ -104,6 +104,12 @@
...
@@ -104,6 +104,12 @@
dest
:
'
{{ansible_user_dir}}/nextgen-network/services/bird.conf'
dest
:
'
{{ansible_user_dir}}/nextgen-network/services/bird.conf'
notify
:
restart_bird
notify
:
restart_bird
when
:
not noBird
when
:
not noBird
-
name
:
babeld conf
template
:
src
:
babeld.conf.j2
dest
:
'
{{ansible_user_dir}}/nextgen-network/services/babeld.conf'
notify
:
restart_babeld
# when: not noBird
-
name
:
frps conf
-
name
:
frps conf
template
:
template
:
src
:
protocols/wgfrp/frps.ini.j2
src
:
protocols/wgfrp/frps.ini.j2
...
@@ -142,6 +148,13 @@
...
@@ -142,6 +148,13 @@
services
:
services
:
-
bird
-
bird
when
:
not noBird
when
:
not noBird
-
name
:
restart_babeld
docker_compose
:
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
restarted
:
true
services
:
-
babeld
# when: not noBird
-
name
:
restart_frps
-
name
:
restart_frps
docker_compose
:
docker_compose
:
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
...
...
src/inventory.ts
View file @
70dd9505
...
@@ -154,6 +154,14 @@ class InventoryBuilder {
...
@@ -154,6 +154,14 @@ class InventoryBuilder {
network_mode
:
'
host
'
,
network_mode
:
'
host
'
,
cap_add
:
[
'
NET_ADMIN
'
,
'
NET_BROADCAST
'
,
'
NET_RAW
'
],
cap_add
:
[
'
NET_ADMIN
'
,
'
NET_BROADCAST
'
,
'
NET_RAW
'
],
volumes
:
[
'
./bird.conf:/etc/bird/bird.conf:ro
'
]
volumes
:
[
'
./bird.conf:/etc/bird/bird.conf:ro
'
]
},
babeld
:
{
restart
:
'
always
'
,
privileged
:
true
,
image
:
'
git-registry.mycard.moe/railgun/babeld
'
,
network_mode
:
'
host
'
,
cap_add
:
[
'
NET_ADMIN
'
,
'
NET_BROADCAST
'
,
'
NET_RAW
'
],
volumes
:
[
'
./babeld.conf:/etc/babeld.conf:ro
'
]
}
}
}
}
};
};
...
...
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